tonyassi commited on
Commit
1cf384f
·
verified ·
1 Parent(s): 4e04816

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -58,6 +58,7 @@ def swap_faces(src_img, dest_img):
58
  return out_img
59
 
60
  def open_side():
 
61
  return gr.Sidebar(open=True)
62
 
63
  # ---------- Custom CSS ----------
@@ -131,7 +132,11 @@ CUSTOM_CSS = """
131
  """
132
 
133
  # ---------- UI (Blocks) ----------
134
- with gr.Blocks(title="Image Face Swap", css=CUSTOM_CSS) as demo:
 
 
 
 
135
  # Sticky banner
136
  gr.HTML(
137
  '<a class="sticky-cta" '
@@ -237,5 +242,6 @@ with gr.Blocks(title="Image Face Swap", css=CUSTOM_CSS) as demo:
237
  demo.queue()
238
 
239
  if __name__ == "__main__":
240
- # In Gradio 4.x, theme goes here, NOT in gr.Blocks()
 
241
  demo.launch(theme=gr.themes.Soft())
 
58
  return out_img
59
 
60
  def open_side():
61
+ # for 4.x Sidebar API
62
  return gr.Sidebar(open=True)
63
 
64
  # ---------- Custom CSS ----------
 
132
  """
133
 
134
  # ---------- UI (Blocks) ----------
135
+ # NOTE: no css= here – we inject CSS via <style> tag instead
136
+ with gr.Blocks(title="Image Face Swap") as demo:
137
+ # Inject custom CSS manually
138
+ gr.HTML(f"<style>{CUSTOM_CSS}</style>")
139
+
140
  # Sticky banner
141
  gr.HTML(
142
  '<a class="sticky-cta" '
 
242
  demo.queue()
243
 
244
  if __name__ == "__main__":
245
+ # If this line ever complains about theme=, just drop the arg:
246
+ # demo.launch()
247
  demo.launch(theme=gr.themes.Soft())