Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -260,11 +260,13 @@ def generate_30(
|
|
| 260 |
latent_file_3 = gr.File(), # Add latents file input
|
| 261 |
latent_file_4 = gr.File(), # Add latents file input
|
| 262 |
latent_file_5 = gr.File(), # Add latents file input
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
|
|
|
|
|
|
| 268 |
samples=1,
|
| 269 |
progress=gr.Progress(track_tqdm=True) # Add progress as a keyword argument
|
| 270 |
):
|
|
@@ -301,6 +303,8 @@ def generate_30(
|
|
| 301 |
pil_image_5=sd_image_e,
|
| 302 |
prompt=prompt,
|
| 303 |
negative_prompt=negative_prompt,
|
|
|
|
|
|
|
| 304 |
scale_1=latent_file_1_scale,
|
| 305 |
scale_2=latent_file_2_scale,
|
| 306 |
scale_3=latent_file_3_scale,
|
|
@@ -341,11 +345,13 @@ def generate_60(
|
|
| 341 |
latent_file_3 = gr.File(), # Add latents file input
|
| 342 |
latent_file_4 = gr.File(), # Add latents file input
|
| 343 |
latent_file_5 = gr.File(), # Add latents file input
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
|
|
|
|
|
|
| 349 |
samples=1,
|
| 350 |
progress=gr.Progress(track_tqdm=True) # Add progress as a keyword argument
|
| 351 |
):
|
|
@@ -382,6 +388,8 @@ def generate_60(
|
|
| 382 |
pil_image_5=sd_image_e,
|
| 383 |
prompt=prompt,
|
| 384 |
negative_prompt=negative_prompt,
|
|
|
|
|
|
|
| 385 |
scale_1=latent_file_1_scale,
|
| 386 |
scale_2=latent_file_2_scale,
|
| 387 |
scale_3=latent_file_3_scale,
|
|
@@ -422,11 +430,13 @@ def generate_90(
|
|
| 422 |
latent_file_3 = gr.File(), # Add latents file input
|
| 423 |
latent_file_4 = gr.File(), # Add latents file input
|
| 424 |
latent_file_5 = gr.File(), # Add latents file input
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
|
|
|
|
|
|
| 430 |
samples=1,
|
| 431 |
progress=gr.Progress(track_tqdm=True) # Add progress as a keyword argument
|
| 432 |
):
|
|
@@ -463,6 +473,8 @@ def generate_90(
|
|
| 463 |
pil_image_5=sd_image_e,
|
| 464 |
prompt=prompt,
|
| 465 |
negative_prompt=negative_prompt,
|
|
|
|
|
|
|
| 466 |
scale_1=latent_file_1_scale,
|
| 467 |
scale_2=latent_file_2_scale,
|
| 468 |
scale_3=latent_file_3_scale,
|
|
@@ -530,19 +542,32 @@ with gr.Blocks(theme=gr.themes.Origin(),css=css) as demo:
|
|
| 530 |
run_button_60 = gr.Button("Run 60 Seconds", scale=0)
|
| 531 |
run_button_90 = gr.Button("Run 90 Seconds", scale=0)
|
| 532 |
result = gr.Gallery(label="Result", columns=1, show_label=False)
|
| 533 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 534 |
with gr.Row():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 535 |
latent_file = gr.File(label="Image Prompt (Required)")
|
| 536 |
file_1_strength = gr.Slider(
|
| 537 |
-
label="Img 1
|
| 538 |
minimum=0.0,
|
| 539 |
maximum=16.0,
|
| 540 |
step=0.01,
|
| 541 |
-
value=
|
| 542 |
)
|
| 543 |
latent_file_2 = gr.File(label="Image Prompt 2 (Optional)")
|
| 544 |
file_2_strength = gr.Slider(
|
| 545 |
-
label="Img 2
|
| 546 |
minimum=0.0,
|
| 547 |
maximum=16.0,
|
| 548 |
step=0.01,
|
|
@@ -550,27 +575,27 @@ with gr.Blocks(theme=gr.themes.Origin(),css=css) as demo:
|
|
| 550 |
)
|
| 551 |
latent_file_3 = gr.File(label="Image Prompt 3 (Optional)")
|
| 552 |
file_3_strength = gr.Slider(
|
| 553 |
-
label="Img 3
|
| 554 |
minimum=0.0,
|
| 555 |
maximum=16.0,
|
| 556 |
step=0.01,
|
| 557 |
-
value=
|
| 558 |
)
|
| 559 |
latent_file_4 = gr.File(label="Image Prompt 4 (Optional)")
|
| 560 |
file_4_strength = gr.Slider(
|
| 561 |
-
label="Img 4
|
| 562 |
minimum=0.0,
|
| 563 |
maximum=16.0,
|
| 564 |
step=0.01,
|
| 565 |
-
value=
|
| 566 |
)
|
| 567 |
latent_file_5 = gr.File(label="Image Prompt 5 (Optional)")
|
| 568 |
file_5_strength = gr.Slider(
|
| 569 |
-
label="Img 5
|
| 570 |
minimum=0.0,
|
| 571 |
maximum=16.0,
|
| 572 |
step=0.01,
|
| 573 |
-
value=
|
| 574 |
)
|
| 575 |
style_selection = gr.Radio(
|
| 576 |
show_label=True,
|
|
@@ -663,6 +688,8 @@ with gr.Blocks(theme=gr.themes.Origin(),css=css) as demo:
|
|
| 663 |
latent_file_3,
|
| 664 |
latent_file_4,
|
| 665 |
latent_file_5,
|
|
|
|
|
|
|
| 666 |
file_1_strength,
|
| 667 |
file_2_strength,
|
| 668 |
file_3_strength,
|
|
@@ -693,6 +720,8 @@ with gr.Blocks(theme=gr.themes.Origin(),css=css) as demo:
|
|
| 693 |
latent_file_3,
|
| 694 |
latent_file_4,
|
| 695 |
latent_file_5,
|
|
|
|
|
|
|
| 696 |
file_1_strength,
|
| 697 |
file_2_strength,
|
| 698 |
file_3_strength,
|
|
@@ -723,6 +752,8 @@ with gr.Blocks(theme=gr.themes.Origin(),css=css) as demo:
|
|
| 723 |
latent_file_3,
|
| 724 |
latent_file_4,
|
| 725 |
latent_file_5,
|
|
|
|
|
|
|
| 726 |
file_1_strength,
|
| 727 |
file_2_strength,
|
| 728 |
file_3_strength,
|
|
|
|
| 260 |
latent_file_3 = gr.File(), # Add latents file input
|
| 261 |
latent_file_4 = gr.File(), # Add latents file input
|
| 262 |
latent_file_5 = gr.File(), # Add latents file input
|
| 263 |
+
text_scale: float = 1.0,
|
| 264 |
+
ip_scale: float = 1.0,
|
| 265 |
+
latent_file_1_scale: float = 1.0,
|
| 266 |
+
latent_file_2_scale: float = 1.0,
|
| 267 |
+
latent_file_3_scale: float = 1.0,
|
| 268 |
+
latent_file_4_scale: float = 1.0,
|
| 269 |
+
latent_file_5_scale: float = 1.0,
|
| 270 |
samples=1,
|
| 271 |
progress=gr.Progress(track_tqdm=True) # Add progress as a keyword argument
|
| 272 |
):
|
|
|
|
| 303 |
pil_image_5=sd_image_e,
|
| 304 |
prompt=prompt,
|
| 305 |
negative_prompt=negative_prompt,
|
| 306 |
+
text_scale=text_scale,
|
| 307 |
+
ip_scale=ip_scale,
|
| 308 |
scale_1=latent_file_1_scale,
|
| 309 |
scale_2=latent_file_2_scale,
|
| 310 |
scale_3=latent_file_3_scale,
|
|
|
|
| 345 |
latent_file_3 = gr.File(), # Add latents file input
|
| 346 |
latent_file_4 = gr.File(), # Add latents file input
|
| 347 |
latent_file_5 = gr.File(), # Add latents file input
|
| 348 |
+
text_scale: float = 1.0,
|
| 349 |
+
ip_scale: float = 1.0,
|
| 350 |
+
latent_file_1_scale: float = 1.0,
|
| 351 |
+
latent_file_2_scale: float = 1.0,
|
| 352 |
+
latent_file_3_scale: float = 1.0,
|
| 353 |
+
latent_file_4_scale: float = 1.0,
|
| 354 |
+
latent_file_5_scale: float = 1.0,
|
| 355 |
samples=1,
|
| 356 |
progress=gr.Progress(track_tqdm=True) # Add progress as a keyword argument
|
| 357 |
):
|
|
|
|
| 388 |
pil_image_5=sd_image_e,
|
| 389 |
prompt=prompt,
|
| 390 |
negative_prompt=negative_prompt,
|
| 391 |
+
text_scale=text_scale,
|
| 392 |
+
ip_scale=ip_scale,
|
| 393 |
scale_1=latent_file_1_scale,
|
| 394 |
scale_2=latent_file_2_scale,
|
| 395 |
scale_3=latent_file_3_scale,
|
|
|
|
| 430 |
latent_file_3 = gr.File(), # Add latents file input
|
| 431 |
latent_file_4 = gr.File(), # Add latents file input
|
| 432 |
latent_file_5 = gr.File(), # Add latents file input
|
| 433 |
+
text_scale: float = 1.0,
|
| 434 |
+
ip_scale: float = 1.0,
|
| 435 |
+
latent_file_1_scale: float = 1.0,
|
| 436 |
+
latent_file_2_scale: float = 1.0,
|
| 437 |
+
latent_file_3_scale: float = 1.0,
|
| 438 |
+
latent_file_4_scale: float = 1.0,
|
| 439 |
+
latent_file_5_scale: float = 1.0,
|
| 440 |
samples=1,
|
| 441 |
progress=gr.Progress(track_tqdm=True) # Add progress as a keyword argument
|
| 442 |
):
|
|
|
|
| 473 |
pil_image_5=sd_image_e,
|
| 474 |
prompt=prompt,
|
| 475 |
negative_prompt=negative_prompt,
|
| 476 |
+
text_scale=text_scale,
|
| 477 |
+
ip_scale=ip_scale,
|
| 478 |
scale_1=latent_file_1_scale,
|
| 479 |
scale_2=latent_file_2_scale,
|
| 480 |
scale_3=latent_file_3_scale,
|
|
|
|
| 542 |
run_button_60 = gr.Button("Run 60 Seconds", scale=0)
|
| 543 |
run_button_90 = gr.Button("Run 90 Seconds", scale=0)
|
| 544 |
result = gr.Gallery(label="Result", columns=1, show_label=False)
|
| 545 |
+
text_strength = gr.Slider(
|
| 546 |
+
label="Text Strength",
|
| 547 |
+
minimum=0.0,
|
| 548 |
+
maximum=16.0,
|
| 549 |
+
step=0.01,
|
| 550 |
+
value=1.0,
|
| 551 |
+
)
|
| 552 |
with gr.Row():
|
| 553 |
+
ip_strength = gr.Slider(
|
| 554 |
+
label="Image Strength",
|
| 555 |
+
minimum=0.0,
|
| 556 |
+
maximum=16.0,
|
| 557 |
+
step=0.01,
|
| 558 |
+
value=1.0,
|
| 559 |
+
)
|
| 560 |
latent_file = gr.File(label="Image Prompt (Required)")
|
| 561 |
file_1_strength = gr.Slider(
|
| 562 |
+
label="Img 1 %",
|
| 563 |
minimum=0.0,
|
| 564 |
maximum=16.0,
|
| 565 |
step=0.01,
|
| 566 |
+
value=1.0,
|
| 567 |
)
|
| 568 |
latent_file_2 = gr.File(label="Image Prompt 2 (Optional)")
|
| 569 |
file_2_strength = gr.Slider(
|
| 570 |
+
label="Img 2 %",
|
| 571 |
minimum=0.0,
|
| 572 |
maximum=16.0,
|
| 573 |
step=0.01,
|
|
|
|
| 575 |
)
|
| 576 |
latent_file_3 = gr.File(label="Image Prompt 3 (Optional)")
|
| 577 |
file_3_strength = gr.Slider(
|
| 578 |
+
label="Img 3 %",
|
| 579 |
minimum=0.0,
|
| 580 |
maximum=16.0,
|
| 581 |
step=0.01,
|
| 582 |
+
value=1.0,
|
| 583 |
)
|
| 584 |
latent_file_4 = gr.File(label="Image Prompt 4 (Optional)")
|
| 585 |
file_4_strength = gr.Slider(
|
| 586 |
+
label="Img 4 %",
|
| 587 |
minimum=0.0,
|
| 588 |
maximum=16.0,
|
| 589 |
step=0.01,
|
| 590 |
+
value=1.0,
|
| 591 |
)
|
| 592 |
latent_file_5 = gr.File(label="Image Prompt 5 (Optional)")
|
| 593 |
file_5_strength = gr.Slider(
|
| 594 |
+
label="Img 5 %",
|
| 595 |
minimum=0.0,
|
| 596 |
maximum=16.0,
|
| 597 |
step=0.01,
|
| 598 |
+
value=1.0,
|
| 599 |
)
|
| 600 |
style_selection = gr.Radio(
|
| 601 |
show_label=True,
|
|
|
|
| 688 |
latent_file_3,
|
| 689 |
latent_file_4,
|
| 690 |
latent_file_5,
|
| 691 |
+
text_strength,
|
| 692 |
+
ip_strength,
|
| 693 |
file_1_strength,
|
| 694 |
file_2_strength,
|
| 695 |
file_3_strength,
|
|
|
|
| 720 |
latent_file_3,
|
| 721 |
latent_file_4,
|
| 722 |
latent_file_5,
|
| 723 |
+
text_strength,
|
| 724 |
+
ip_strength,
|
| 725 |
file_1_strength,
|
| 726 |
file_2_strength,
|
| 727 |
file_3_strength,
|
|
|
|
| 752 |
latent_file_3,
|
| 753 |
latent_file_4,
|
| 754 |
latent_file_5,
|
| 755 |
+
text_strength,
|
| 756 |
+
ip_strength,
|
| 757 |
file_1_strength,
|
| 758 |
file_2_strength,
|
| 759 |
file_3_strength,
|