czq0719 commited on
Commit
0bb9020
·
1 Parent(s): 430845d

Add gradio app

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -19,7 +19,7 @@ from diffusers import (
19
  StableDiffusionXLImg2ImgPipeline,
20
  DPMSolverMultistepScheduler,
21
  )
22
-
23
  # =========================
24
  # 0) Variant names / display order (MUST be BEFORE Blocks)
25
  # =========================
@@ -818,7 +818,7 @@ def ui_run_full_gpu(*args, **kwargs):
818
  # =========================
819
  # 10) Gradio UI (matches your reference fixes)
820
  # =========================
821
- with gr.Blocks(title="CritiFusion (SDXL) Demo", theme=gr.themes.Soft()) as demo:
822
  gr.Markdown(
823
  "## CritiFusion Demo (SDXL)\n"
824
  "- You can run **Variants** (outputs 4 variants in one click).\n"
@@ -872,7 +872,7 @@ with gr.Blocks(title="CritiFusion (SDXL) Demo", theme=gr.themes.Soft()) as demo:
872
  fn=ui_run_once_gpu,
873
  inputs=[user_prompt, seed, H, W, preset, total_steps_refine, last_k, guidance, enabled_variants, save_outputs, out_dir],
874
  outputs=[gallery, meta_json],
875
- api_name=False,
876
  )
877
 
878
  with gr.Tab("Full CADR Pipeline"):
@@ -913,8 +913,12 @@ with gr.Blocks(title="CritiFusion (SDXL) Demo", theme=gr.themes.Soft()) as demo:
913
  fn=ui_run_full_gpu,
914
  inputs=[p2, seed2, H2, W2, preset2, align_mode, align_score, save2, out2],
915
  outputs=[base_img, final_img, enhanced, meta2],
916
- api_name=False,
917
  )
918
 
919
- # IMPORTANT: share=True fixes "localhost not accessible"
920
- demo.queue().launch(debug=True, show_api=False)
 
 
 
 
 
19
  StableDiffusionXLImg2ImgPipeline,
20
  DPMSolverMultistepScheduler,
21
  )
22
+ os.environ["TOGETHER_NO_BANNER"] = "1"
23
  # =========================
24
  # 0) Variant names / display order (MUST be BEFORE Blocks)
25
  # =========================
 
818
  # =========================
819
  # 10) Gradio UI (matches your reference fixes)
820
  # =========================
821
+ with gr.Blocks(title="CritiFusion (SDXL) Demo") as demo:
822
  gr.Markdown(
823
  "## CritiFusion Demo (SDXL)\n"
824
  "- You can run **Variants** (outputs 4 variants in one click).\n"
 
872
  fn=ui_run_once_gpu,
873
  inputs=[user_prompt, seed, H, W, preset, total_steps_refine, last_k, guidance, enabled_variants, save_outputs, out_dir],
874
  outputs=[gallery, meta_json],
875
+ api_visibility="private",
876
  )
877
 
878
  with gr.Tab("Full CADR Pipeline"):
 
913
  fn=ui_run_full_gpu,
914
  inputs=[p2, seed2, H2, W2, preset2, align_mode, align_score, save2, out2],
915
  outputs=[base_img, final_img, enhanced, meta2],
916
+ api_visibility="private",
917
  )
918
 
919
+ # IMPORTANT: share=True fixes "localhost not accessible
920
+ demo.queue().launch(
921
+ debug=True,
922
+ theme=gr.themes.Soft(),
923
+ footer_links=["gradio", "settings"],
924
+ )