multimodalart HF Staff commited on
Commit
7b8b14d
·
verified ·
1 Parent(s): af4a1b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -9
app.py CHANGED
@@ -49,14 +49,16 @@ pipe.set_adapters(["light_migration"], adapter_weights=[1.])
49
  pipe.fuse_lora(adapter_names=["light_migration"], lora_scale=1.25)
50
  pipe.unload_lora_weights()
51
 
52
- pipe.transformer.__class__ = QwenImageTransformer2DModel
53
- pipe.transformer.set_attn_processor(QwenDoubleStreamAttnProcessorFA3())
54
 
55
- optimize_pipeline_(
56
- pipe,
57
- image=[Image.new("RGB", (1024, 1024)), Image.new("RGB", (1024, 1024))],
58
- prompt="prompt"
59
- )
 
 
 
60
 
61
  MAX_SEED = np.iinfo(np.int32).max
62
 
@@ -194,7 +196,7 @@ css = '''
194
  .image-container { min-height: 300px; }
195
  '''
196
 
197
- with gr.Blocks(theme=gr.themes.Citrus(), css=css) as demo:
198
  with gr.Column(elem_id="col-container"):
199
  gr.Markdown("## 💡 Qwen Image Edit — Light Migration")
200
  gr.Markdown("""
@@ -299,4 +301,4 @@ with gr.Blocks(theme=gr.themes.Citrus(), css=css) as demo:
299
  # API endpoint
300
  gr.api(infer_light_migration, api_name="infer_light_migration")
301
 
302
- demo.launch(mcp_server=True)
 
49
  pipe.fuse_lora(adapter_names=["light_migration"], lora_scale=1.25)
50
  pipe.unload_lora_weights()
51
 
52
+ spaces.aoti_blocks_load(pipe.transformer, "zerogpu-aoti/Qwen-Image", variant="fa3")
 
53
 
54
+ #pipe.transformer.__class__ = QwenImageTransformer2DModel
55
+ #pipe.transformer.set_attn_processor(QwenDoubleStreamAttnProcessorFA3())
56
+
57
+ #optimize_pipeline_(
58
+ # pipe,
59
+ # image=[Image.new("RGB", (1024, 1024)), Image.new("RGB", (1024, 1024))],
60
+ # prompt="prompt"
61
+ #)
62
 
63
  MAX_SEED = np.iinfo(np.int32).max
64
 
 
196
  .image-container { min-height: 300px; }
197
  '''
198
 
199
+ with gr.Blocks() as demo:
200
  with gr.Column(elem_id="col-container"):
201
  gr.Markdown("## 💡 Qwen Image Edit — Light Migration")
202
  gr.Markdown("""
 
301
  # API endpoint
302
  gr.api(infer_light_migration, api_name="infer_light_migration")
303
 
304
+ demo.launch(mcp_server=True, theme=gr.themes.Citrus(), css=css, footer_links=["api", "gradio", "settings"])