Spaces:
Running
on
Zero
Running
on
Zero
Update app_local.py
Browse files- app_local.py +32 -19
app_local.py
CHANGED
|
@@ -341,30 +341,43 @@ with gr.Blocks(title="Qwen Image Editor Fast") as demo:
|
|
| 341 |
# cache_examples=True
|
| 342 |
# )
|
| 343 |
|
| 344 |
-
# Main processing
|
| 345 |
-
|
| 346 |
-
input_image,
|
| 347 |
-
prompt,
|
| 348 |
-
seed,
|
| 349 |
-
randomize_seed,
|
| 350 |
-
true_guidance_scale,
|
| 351 |
-
num_inference_steps,
|
| 352 |
-
rewrite_toggle,
|
| 353 |
-
num_images_per_prompt
|
| 354 |
-
]
|
| 355 |
-
|
| 356 |
-
outputs = [result, seed, prompt_info]
|
| 357 |
-
|
| 358 |
-
run_button.click(
|
| 359 |
fn=infer,
|
| 360 |
-
inputs=
|
| 361 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 362 |
)
|
| 363 |
|
| 364 |
prompt.submit(
|
| 365 |
fn=infer,
|
| 366 |
-
inputs=
|
| 367 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 368 |
)
|
| 369 |
|
| 370 |
if __name__ == "__main__":
|
|
|
|
| 341 |
# cache_examples=True
|
| 342 |
# )
|
| 343 |
|
| 344 |
+
# Main processing
|
| 345 |
+
run_event = run_button.click(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 346 |
fn=infer,
|
| 347 |
+
inputs=[
|
| 348 |
+
input_image,
|
| 349 |
+
prompt,
|
| 350 |
+
seed,
|
| 351 |
+
randomize_seed,
|
| 352 |
+
true_guidance_scale,
|
| 353 |
+
num_inference_steps,
|
| 354 |
+
rewrite_toggle,
|
| 355 |
+
num_images_per_prompt
|
| 356 |
+
],
|
| 357 |
+
outputs=[result, seed, prompt_info]
|
| 358 |
)
|
| 359 |
|
| 360 |
prompt.submit(
|
| 361 |
fn=infer,
|
| 362 |
+
inputs=[
|
| 363 |
+
input_image,
|
| 364 |
+
prompt,
|
| 365 |
+
seed,
|
| 366 |
+
randomize_seed,
|
| 367 |
+
true_guidance_scale,
|
| 368 |
+
num_inference_steps,
|
| 369 |
+
rewrite_toggle,
|
| 370 |
+
num_images_per_prompt
|
| 371 |
+
],
|
| 372 |
+
outputs=[result, seed, prompt_info]
|
| 373 |
+
)
|
| 374 |
+
|
| 375 |
+
# Vectorize prompt info visibility
|
| 376 |
+
run_event.then(
|
| 377 |
+
fn=lambda: gr.update(visible=True),
|
| 378 |
+
inputs=None,
|
| 379 |
+
outputs=[prompt_info],
|
| 380 |
+
queue=False
|
| 381 |
)
|
| 382 |
|
| 383 |
if __name__ == "__main__":
|