Update app.py
Browse files
app.py
CHANGED
@@ -212,6 +212,7 @@ def resize_keep_aspect_ratio(pil_image, target_size=1024):
|
|
212 |
new_W = int(round(W * scaling_factor))
|
213 |
return pil_image.resize((new_W, new_H))
|
214 |
|
|
|
215 |
@spaces.GPU()
|
216 |
def generate_image(
|
217 |
prompt,
|
@@ -604,68 +605,70 @@ if __name__ == "__main__":
|
|
604 |
with gr.Column():
|
605 |
output = gr.Image(label="Result")
|
606 |
|
607 |
-
examples = gr.Examples(
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
)
|
|
|
|
|
669 |
|
670 |
gen_btn.click(
|
671 |
generate_image,
|
|
|
212 |
new_W = int(round(W * scaling_factor))
|
213 |
return pil_image.resize((new_W, new_H))
|
214 |
|
215 |
+
|
216 |
@spaces.GPU()
|
217 |
def generate_image(
|
218 |
prompt,
|
|
|
605 |
with gr.Column():
|
606 |
output = gr.Image(label="Result")
|
607 |
|
608 |
+
# examples = gr.Examples(
|
609 |
+
# examples=[
|
610 |
+
# [
|
611 |
+
# "ENT1 wearing a tiny hat",
|
612 |
+
# 42, 256, 768, 768,
|
613 |
+
# 3, 5,
|
614 |
+
# 0.85, 1.3,
|
615 |
+
# 0.05, 0.8,
|
616 |
+
# "sample/hamster.jpg", None, None, None, None, None,
|
617 |
+
# "a hamster", None, None, None, None, None,
|
618 |
+
# False, False, False, False, False, False
|
619 |
+
# ],
|
620 |
+
# [
|
621 |
+
# "ENT1 in a red dress is smiling",
|
622 |
+
# 42, 256, 768, 768,
|
623 |
+
# 3, 5,
|
624 |
+
# 0.85, 1.3,
|
625 |
+
# 0.05, 0.8,
|
626 |
+
# "sample/woman.jpg", None, None, None, None, None,
|
627 |
+
# "a woman", None, None, None, None, None,
|
628 |
+
# True, False, False, False, False, False
|
629 |
+
# ],
|
630 |
+
# [
|
631 |
+
# "ENT1 and ENT2 standing together in a park.",
|
632 |
+
# 42, 256, 768, 768,
|
633 |
+
# 2, 5,
|
634 |
+
# 0.85, 1.3,
|
635 |
+
# 0.05, 0.8,
|
636 |
+
# "sample/woman.jpg", "sample/girl.jpg", None, None, None, None,
|
637 |
+
# "a woman", "a girl", None, None, None, None,
|
638 |
+
# True, True, False, False, False, False
|
639 |
+
# ],
|
640 |
+
# [
|
641 |
+
# "ENT1, ENT2, and ENT3 standing together in a park.",
|
642 |
+
# 42, 256, 768, 768,
|
643 |
+
# 2.5, 5,
|
644 |
+
# 0.8, 1.2,
|
645 |
+
# 0.05, 0.8,
|
646 |
+
# "sample/woman.jpg", "sample/girl.jpg", "sample/old_man.jpg", None, None, None,
|
647 |
+
# "a woman", "a girl", "an old man", None, None, None,
|
648 |
+
# True, True, True, False, False, False
|
649 |
+
# ],
|
650 |
+
# ],
|
651 |
+
# inputs=[
|
652 |
+
# prompt, seed,
|
653 |
+
# cond_size,
|
654 |
+
# target_height,
|
655 |
+
# target_width,
|
656 |
+
# weight_id,
|
657 |
+
# weight_ip,
|
658 |
+
# ip_scale_str,
|
659 |
+
# vae_lora_scale,
|
660 |
+
# vae_skip_iter_s1,
|
661 |
+
# vae_skip_iter_s2,
|
662 |
+
# *images,
|
663 |
+
# *captions,
|
664 |
+
# *idip_checkboxes
|
665 |
+
# ],
|
666 |
+
# outputs=output,
|
667 |
+
# fn=generate_image,
|
668 |
+
# cache_examples=True,
|
669 |
+
# )
|
670 |
+
|
671 |
+
|
672 |
|
673 |
gen_btn.click(
|
674 |
generate_image,
|