alexnasa commited on
Commit
055f941
·
verified ·
1 Parent(s): c4b9ec5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -24
app.py CHANGED
@@ -213,24 +213,13 @@ def resize_keep_aspect_ratio(pil_image, target_size=1024):
213
  return pil_image.resize((new_W, new_H))
214
 
215
 
216
- cond_size,
217
- target_height,
218
- target_width,
219
- seed,
220
- vae_skip_iter,
221
- weight_id_ip_str,
222
- double_attention,
223
- single_attention,
224
- db_latent_lora_scale_str,
225
- sb_latent_lora_scale_str,
226
- vae_lora_scale_str,
227
- session_state,
228
-
229
  @spaces.GPU()
230
  def generate_image(
231
  prompt,
232
- image_1, caption_1, use_id_1,
233
- image_2, caption_2, use_id_2,
 
 
234
  cond_size = 256,
235
  target_height = 768,
236
  target_width = 768,
@@ -626,23 +615,23 @@ if __name__ == "__main__":
626
  examples=[
627
  [
628
  "ENT1 wearing a tiny hat",
629
- "sample/hamster.jpg", "a hamster", True,
630
  ],
631
  [
632
  "ENT1 in a red dress is smiling",
633
- "sample/woman.jpg", "a woman", True,
634
- None, None, True,
635
  ],
636
  [
637
  "ENT1 and ENT2 standing together in a park.",
638
- "sample/woman.jpg", "a woman", True,
639
- "sample/girl.jpg", "a girl", True,
640
  ],
641
  ],
642
  inputs=[
643
  prompt,
644
- images[0], captions[0], idip_checkboxes[0],
645
- images[1], captions[1], idip_checkboxes[1],
646
  ],
647
  outputs=output,
648
  fn=generate_image,
@@ -655,8 +644,10 @@ if __name__ == "__main__":
655
  generate_image,
656
  inputs=[
657
  prompt,
658
- images[0], captions[0], idip_checkboxes[0],
659
- images[1], captions[1], idip_checkboxes[1],
 
 
660
  cond_size,
661
  target_height,
662
  target_width,
 
213
  return pil_image.resize((new_W, new_H))
214
 
215
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  @spaces.GPU()
217
  def generate_image(
218
  prompt,
219
+ image_1, caption_1,
220
+ image_2, caption_2,
221
+ use_id_1 = True,
222
+ use_id_2 = True,
223
  cond_size = 256,
224
  target_height = 768,
225
  target_width = 768,
 
615
  examples=[
616
  [
617
  "ENT1 wearing a tiny hat",
618
+ "sample/hamster.jpg", "a hamster",
619
  ],
620
  [
621
  "ENT1 in a red dress is smiling",
622
+ "sample/woman.jpg", "a woman",
623
+ None, None,
624
  ],
625
  [
626
  "ENT1 and ENT2 standing together in a park.",
627
+ "sample/woman.jpg", "a woman",
628
+ "sample/girl.jpg", "a girl",
629
  ],
630
  ],
631
  inputs=[
632
  prompt,
633
+ images[0], captions[0],
634
+ images[1], captions[1],
635
  ],
636
  outputs=output,
637
  fn=generate_image,
 
644
  generate_image,
645
  inputs=[
646
  prompt,
647
+ images[0], captions[0],
648
+ images[1], captions[1],
649
+ idip_checkboxes[0],
650
+ idip_checkboxes[1],
651
  cond_size,
652
  target_height,
653
  target_width,