Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -150,9 +150,10 @@ examples = [
|
|
| 150 |
]
|
| 151 |
|
| 152 |
with gr.Blocks() as demo:
|
| 153 |
-
gr.Markdown("# Qwen-Image-Edit [FAST] with HF
|
| 154 |
gr.Markdown("✨ **8-step lightning inferencing with lightx2v's LoRA.**")
|
| 155 |
gr.Markdown("⚠️ **Prompt rewriting requires your own [Hugging Face token](https://huggingface.co/settings/tokens)**")
|
|
|
|
| 156 |
|
| 157 |
with gr.Row():
|
| 158 |
with gr.Column():
|
|
@@ -190,29 +191,31 @@ with gr.Blocks() as demo:
|
|
| 190 |
step=1,
|
| 191 |
value=1
|
| 192 |
)
|
| 193 |
-
|
| 194 |
-
rewrite_toggle = gr.Checkbox(label="Use Prompt Rewriter (Requires HF Token)", value=False, interactive=True)
|
| 195 |
-
hf_token_input = gr.Textbox(
|
| 196 |
-
label="Your Hugging Face Token",
|
| 197 |
-
type="password",
|
| 198 |
-
placeholder="hf_xxxxxxxxxxxxxxxx",
|
| 199 |
-
visible=False,
|
| 200 |
-
info="Required for prompt rewriting - get yours from [Hugging Face settings](https://huggingface.co/settings/tokens)"
|
| 201 |
-
)
|
| 202 |
-
|
| 203 |
-
def toggle_token_visibility(checked):
|
| 204 |
-
return gr.update(visible=checked)
|
| 205 |
-
|
| 206 |
-
rewrite_toggle.change(
|
| 207 |
-
toggle_token_visibility,
|
| 208 |
-
inputs=[rewrite_toggle],
|
| 209 |
-
outputs=[hf_token_input]
|
| 210 |
-
)
|
| 211 |
|
| 212 |
run_button = gr.Button("Edit", variant="primary")
|
| 213 |
|
| 214 |
with gr.Column():
|
| 215 |
-
result = gr.Gallery(label="Output Images", show_label=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
|
| 217 |
|
| 218 |
|
|
|
|
| 150 |
]
|
| 151 |
|
| 152 |
with gr.Blocks() as demo:
|
| 153 |
+
gr.Markdown("# Qwen-Image-Edit [FAST] with HF Prompt Enhancement")
|
| 154 |
gr.Markdown("✨ **8-step lightning inferencing with lightx2v's LoRA.**")
|
| 155 |
gr.Markdown("⚠️ **Prompt rewriting requires your own [Hugging Face token](https://huggingface.co/settings/tokens)**")
|
| 156 |
+
gr.Markdown("🚧 **Work in progress, further improvements coming soon.**")
|
| 157 |
|
| 158 |
with gr.Row():
|
| 159 |
with gr.Column():
|
|
|
|
| 191 |
step=1,
|
| 192 |
value=1
|
| 193 |
)
|
| 194 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
|
| 196 |
run_button = gr.Button("Edit", variant="primary")
|
| 197 |
|
| 198 |
with gr.Column():
|
| 199 |
+
result = gr.Gallery(label="Output Images", show_label=False, columns=1)
|
| 200 |
+
|
| 201 |
+
with gr.Group():
|
| 202 |
+
rewrite_toggle = gr.Checkbox(label="Use Prompt Rewriter (Requires HF Token)", value=False, interactive=True)
|
| 203 |
+
hf_token_input = gr.Textbox(
|
| 204 |
+
label="Your Hugging Face Token",
|
| 205 |
+
type="password",
|
| 206 |
+
placeholder="hf_xxxxxxxxxxxxxxxx",
|
| 207 |
+
visible=False,
|
| 208 |
+
info="Required for prompt rewriting - get yours from [Hugging Face settings](https://huggingface.co/settings/tokens). API tokens are kept safe locally, but as good practice please make sure to double check the source code. Invalid or missing keys will revert to the original prompt entered."
|
| 209 |
+
)
|
| 210 |
+
|
| 211 |
+
def toggle_token_visibility(checked):
|
| 212 |
+
return gr.update(visible=checked)
|
| 213 |
+
|
| 214 |
+
rewrite_toggle.change(
|
| 215 |
+
toggle_token_visibility,
|
| 216 |
+
inputs=[rewrite_toggle],
|
| 217 |
+
outputs=[hf_token_input]
|
| 218 |
+
)
|
| 219 |
|
| 220 |
|
| 221 |
|