alexnasa commited on
Commit
45b2b49
·
verified ·
1 Parent(s): 75c21f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +65 -62
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
- examples=[
609
- [
610
- "ENT1 wearing a tiny hat",
611
- 42, 256, 768, 768,
612
- 3, 5,
613
- 0.85, 1.3,
614
- 0.05, 0.8,
615
- "sample/hamster.jpg", None, None, None, None, None,
616
- "a hamster", None, None, None, None, None,
617
- False, False, False, False, False, False
618
- ],
619
- [
620
- "ENT1 in a red dress is smiling",
621
- 42, 256, 768, 768,
622
- 3, 5,
623
- 0.85, 1.3,
624
- 0.05, 0.8,
625
- "sample/woman.jpg", None, None, None, None, None,
626
- "a woman", None, None, None, None, None,
627
- True, False, False, False, False, False
628
- ],
629
- [
630
- "ENT1 and ENT2 standing together in a park.",
631
- 42, 256, 768, 768,
632
- 2, 5,
633
- 0.85, 1.3,
634
- 0.05, 0.8,
635
- "sample/woman.jpg", "sample/girl.jpg", None, None, None, None,
636
- "a woman", "a girl", None, None, None, None,
637
- True, True, False, False, False, False
638
- ],
639
- [
640
- "ENT1, ENT2, and ENT3 standing together in a park.",
641
- 42, 256, 768, 768,
642
- 2.5, 5,
643
- 0.8, 1.2,
644
- 0.05, 0.8,
645
- "sample/woman.jpg", "sample/girl.jpg", "sample/old_man.jpg", None, None, None,
646
- "a woman", "a girl", "an old man", None, None, None,
647
- True, True, True, False, False, False
648
- ],
649
- ],
650
- inputs=[
651
- prompt, seed,
652
- cond_size,
653
- target_height,
654
- target_width,
655
- weight_id,
656
- weight_ip,
657
- ip_scale_str,
658
- vae_lora_scale,
659
- vae_skip_iter_s1,
660
- vae_skip_iter_s2,
661
- *images,
662
- *captions,
663
- *idip_checkboxes
664
- ],
665
- outputs=accordion_states,
666
- fn=open_accordion_on_example_selection,
667
- cache_examples=True,
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,