linoyts HF Staff commited on
Commit
da4a65b
·
verified ·
1 Parent(s): 21ecd4e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +44 -47
app.py CHANGED
@@ -438,7 +438,6 @@ css = """
438
 
439
  with gr.Blocks(css=css) as demo:
440
  with gr.Column(elem_id="col-container"):
441
- #gr.Markdown('<img src="https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-Image/qwen_image_logo.png" alt="Qwen-Image Logo" width="400" style="display: block; margin: 0 auto;">')
442
  gr.HTML("""
443
  <div id="logo-title">
444
  <img src="https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-Image/qwen_image_logo.png" alt="Qwen-Image Logo" width="400" style="display: block; margin: 0 auto;">
@@ -446,57 +445,55 @@ with gr.Blocks(css=css) as demo:
446
  </div>
447
  """)
448
  gr.Markdown("[Learn more](https://github.com/QwenLM/Qwen-Image) about the Qwen-Image series. Try on [Qwen Chat](https://chat.qwen.ai/), or [download model](https://huggingface.co/Qwen/Qwen-Image) to run locally with ComfyUI or diffusers.")
 
449
  with gr.Row():
450
- prompt = gr.Text(
451
- label="Prompt",
452
- show_label=False,
453
- placeholder="Enter your prompt",
454
- container=False,
455
- )
456
- run_button = gr.Button("Run", scale=0, variant="primary")
457
-
458
- result = gr.Image(label="Result", show_label=False, type="pil")
459
-
460
- with gr.Accordion("Advanced Settings", open=False):
461
- # Negative prompt UI element is removed here
462
-
463
- seed = gr.Slider(
464
- label="Seed",
465
- minimum=0,
466
- maximum=MAX_SEED,
467
- step=1,
468
- value=0,
469
- )
470
-
471
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
472
-
473
- with gr.Row():
474
- aspect_ratio = gr.Radio(
475
- label="Aspect ratio (width:height)",
476
- choices=["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"],
477
- value="16:9",
478
- )
479
- prompt_enhance = gr.Checkbox(label="Prompt Enhance", value=False)
480
-
481
- with gr.Row():
482
- guidance_scale = gr.Slider(
483
- label="Guidance scale",
484
- minimum=0.0,
485
- maximum=10.0,
486
- step=0.1,
487
- value=1.0,
488
- )
489
-
490
- num_inference_steps = gr.Slider(
491
- label="Number of inference steps",
492
- minimum=1,
493
- maximum=20,
494
- step=1,
495
- value=4,
496
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
497
 
498
  gr.Examples(examples=examples, inputs=[prompt], outputs=[result, seed], fn=infer, cache_examples=False)
499
 
 
500
  gr.on(
501
  triggers=[run_button.click, prompt.submit],
502
  fn=infer,
 
438
 
439
  with gr.Blocks(css=css) as demo:
440
  with gr.Column(elem_id="col-container"):
 
441
  gr.HTML("""
442
  <div id="logo-title">
443
  <img src="https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-Image/qwen_image_logo.png" alt="Qwen-Image Logo" width="400" style="display: block; margin: 0 auto;">
 
445
  </div>
446
  """)
447
  gr.Markdown("[Learn more](https://github.com/QwenLM/Qwen-Image) about the Qwen-Image series. Try on [Qwen Chat](https://chat.qwen.ai/), or [download model](https://huggingface.co/Qwen/Qwen-Image) to run locally with ComfyUI or diffusers.")
448
+
449
  with gr.Row():
450
+ with gr.Column(scale=1):
451
+ prompt = gr.Text(
452
+ label="Prompt",
453
+ show_label=False,
454
+ placeholder="Enter your prompt",
455
+ container=False,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
456
  )
457
+ run_button = gr.Button("Run", variant="primary")
458
+
459
+ with gr.Accordion("Advanced Settings", open=False):
460
+ seed = gr.Slider(
461
+ label="Seed",
462
+ minimum=0,
463
+ maximum=MAX_SEED,
464
+ step=1,
465
+ value=0,
466
+ )
467
+ randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
468
+ with gr.Row():
469
+ aspect_ratio = gr.Radio(
470
+ label="Aspect ratio (width:height)",
471
+ choices=["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"],
472
+ value="16:9",
473
+ )
474
+ prompt_enhance = gr.Checkbox(label="Prompt Enhance", value=False)
475
+ with gr.Row():
476
+ guidance_scale = gr.Slider(
477
+ label="Guidance scale",
478
+ minimum=0.0,
479
+ maximum=10.0,
480
+ step=0.1,
481
+ value=1.0,
482
+ )
483
+ num_inference_steps = gr.Slider(
484
+ label="Number of inference steps",
485
+ minimum=1,
486
+ maximum=20,
487
+ step=1,
488
+ value=4,
489
+ )
490
+
491
+ with gr.Column(scale=1):
492
+ result = gr.Image(label="Result", show_label=False, type="pil")
493
 
494
  gr.Examples(examples=examples, inputs=[prompt], outputs=[result, seed], fn=infer, cache_examples=False)
495
 
496
+
497
  gr.on(
498
  triggers=[run_button.click, prompt.submit],
499
  fn=infer,