Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -234,7 +234,7 @@ def generate_and_update_history(*args, **kwargs):
|
|
| 234 |
})
|
| 235 |
if len(generation_history) > 10: # Limit history to 10 items
|
| 236 |
generation_history.pop()
|
| 237 |
-
return images[0], json.dumps(metadata, indent=2),
|
| 238 |
|
| 239 |
if torch.cuda.is_available():
|
| 240 |
pipe = load_pipeline(MODEL)
|
|
@@ -417,7 +417,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 417 |
inputs=inputs,
|
| 418 |
outputs=[result, gr_metadata, history_gallery],
|
| 419 |
)
|
| 420 |
-
|
| 421 |
negative_prompt.submit(
|
| 422 |
fn=utils.randomize_seed_fn,
|
| 423 |
inputs=[seed, randomize_seed],
|
|
@@ -429,7 +429,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 429 |
inputs=inputs,
|
| 430 |
outputs=[result, gr_metadata, history_gallery],
|
| 431 |
)
|
| 432 |
-
|
| 433 |
run_button.click(
|
| 434 |
fn=utils.randomize_seed_fn,
|
| 435 |
inputs=[seed, randomize_seed],
|
|
@@ -441,16 +441,11 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 441 |
inputs=inputs,
|
| 442 |
outputs=[result, gr_metadata, history_gallery],
|
| 443 |
)
|
| 444 |
-
|
| 445 |
generate_from_json.click(
|
| 446 |
fn=generate_and_update_history,
|
| 447 |
inputs=inputs,
|
| 448 |
outputs=[result, gr_metadata, history_gallery],
|
| 449 |
)
|
| 450 |
-
|
| 451 |
-
history_gallery.select(
|
| 452 |
-
fn=handle_image_click,
|
| 453 |
-
outputs=[selected_image, selected_metadata],
|
| 454 |
-
)
|
| 455 |
-
|
| 456 |
demo.queue(max_size=20).launch(debug=IS_COLAB, share=IS_COLAB)
|
|
|
|
| 234 |
})
|
| 235 |
if len(generation_history) > 10: # Limit history to 10 items
|
| 236 |
generation_history.pop()
|
| 237 |
+
return images[0], json.dumps(metadata, indent=2), update_history_list()
|
| 238 |
|
| 239 |
if torch.cuda.is_available():
|
| 240 |
pipe = load_pipeline(MODEL)
|
|
|
|
| 417 |
inputs=inputs,
|
| 418 |
outputs=[result, gr_metadata, history_gallery],
|
| 419 |
)
|
| 420 |
+
|
| 421 |
negative_prompt.submit(
|
| 422 |
fn=utils.randomize_seed_fn,
|
| 423 |
inputs=[seed, randomize_seed],
|
|
|
|
| 429 |
inputs=inputs,
|
| 430 |
outputs=[result, gr_metadata, history_gallery],
|
| 431 |
)
|
| 432 |
+
|
| 433 |
run_button.click(
|
| 434 |
fn=utils.randomize_seed_fn,
|
| 435 |
inputs=[seed, randomize_seed],
|
|
|
|
| 441 |
inputs=inputs,
|
| 442 |
outputs=[result, gr_metadata, history_gallery],
|
| 443 |
)
|
| 444 |
+
|
| 445 |
generate_from_json.click(
|
| 446 |
fn=generate_and_update_history,
|
| 447 |
inputs=inputs,
|
| 448 |
outputs=[result, gr_metadata, history_gallery],
|
| 449 |
)
|
| 450 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 451 |
demo.queue(max_size=20).launch(debug=IS_COLAB, share=IS_COLAB)
|