Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse filesfurther de-tune to get it within 30 seconds.
app.py
CHANGED
|
@@ -57,7 +57,7 @@ def generate_image(
|
|
| 57 |
Args:
|
| 58 |
prompt (str): Text description of the image to generate. Include: subject, style (e.g. photorealistic/anime/oil painting/watercolor/3D render), composition (e.g. close-up/wide shot/dynamic angle), lighting (e.g. soft/dramatic/backlit), colors (e.g. vibrant/muted/monochrome), mood (e.g. serene/dramatic/mysterious), setting. Specify text inquotes with position if needed. Keep under 200 words for best results.
|
| 59 |
negative_prompt (str): Text description of traits to exclude e.g. text, watermark, copyright, blurry, low resolution
|
| 60 |
-
num_inference_steps (int): Use
|
| 61 |
"""
|
| 62 |
# Hardcode the negative prompt as requested
|
| 63 |
# negative_prompt = "text, watermark, copyright, blurry, low resolution"
|
|
@@ -112,7 +112,7 @@ css = """
|
|
| 112 |
with gr.Blocks(css=css) as demo:
|
| 113 |
with gr.Column(elem_id="col-container"):
|
| 114 |
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;">')
|
| 115 |
-
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. <br /> **This version does not include the 'prompt polisher', and defaults to
|
| 116 |
with gr.Row():
|
| 117 |
prompt = gr.Text(
|
| 118 |
label="Prompt",
|
|
@@ -163,7 +163,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 163 |
minimum=1,
|
| 164 |
maximum=50,
|
| 165 |
step=1,
|
| 166 |
-
value=
|
| 167 |
)
|
| 168 |
|
| 169 |
gr.Examples(
|
|
@@ -177,7 +177,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 177 |
aspect_ratio="16:9",
|
| 178 |
negative_prompt="text, watermark, copyright, blurry, low resolution",
|
| 179 |
guidance_scale=4.0,
|
| 180 |
-
num_inference_steps=
|
| 181 |
),
|
| 182 |
cache_examples=False
|
| 183 |
)
|
|
|
|
| 57 |
Args:
|
| 58 |
prompt (str): Text description of the image to generate. Include: subject, style (e.g. photorealistic/anime/oil painting/watercolor/3D render), composition (e.g. close-up/wide shot/dynamic angle), lighting (e.g. soft/dramatic/backlit), colors (e.g. vibrant/muted/monochrome), mood (e.g. serene/dramatic/mysterious), setting. Specify text inquotes with position if needed. Keep under 200 words for best results.
|
| 59 |
negative_prompt (str): Text description of traits to exclude e.g. text, watermark, copyright, blurry, low resolution
|
| 60 |
+
num_inference_steps (int): Use 16 or fewer steps to keep generation time under 30 seconds. Only specify if instructed by the User.
|
| 61 |
"""
|
| 62 |
# Hardcode the negative prompt as requested
|
| 63 |
# negative_prompt = "text, watermark, copyright, blurry, low resolution"
|
|
|
|
| 112 |
with gr.Blocks(css=css) as demo:
|
| 113 |
with gr.Column(elem_id="col-container"):
|
| 114 |
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;">')
|
| 115 |
+
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. <br /> **This version does not include the 'prompt polisher', and defaults to 16 inference steps to target ~30s generation times**.")
|
| 116 |
with gr.Row():
|
| 117 |
prompt = gr.Text(
|
| 118 |
label="Prompt",
|
|
|
|
| 163 |
minimum=1,
|
| 164 |
maximum=50,
|
| 165 |
step=1,
|
| 166 |
+
value=16,
|
| 167 |
)
|
| 168 |
|
| 169 |
gr.Examples(
|
|
|
|
| 177 |
aspect_ratio="16:9",
|
| 178 |
negative_prompt="text, watermark, copyright, blurry, low resolution",
|
| 179 |
guidance_scale=4.0,
|
| 180 |
+
num_inference_steps=16
|
| 181 |
),
|
| 182 |
cache_examples=False
|
| 183 |
)
|