alexnasa commited on
Commit
52369c9
·
verified ·
1 Parent(s): 45b2b49

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -23
app.py CHANGED
@@ -215,32 +215,31 @@ def resize_keep_aspect_ratio(pil_image, target_size=1024):
215
 
216
  @spaces.GPU()
217
  def generate_image(
218
- prompt,
219
- cond_size, target_height, target_width,
 
 
 
 
220
  seed,
221
- vae_skip_iter, control_weight_lambda,
 
222
  double_attention,
223
  single_attention,
224
  ip_scale,
225
- latent_sblora_scale_str, vae_lora_scale,
226
- indices,
227
  session_id,
228
- *images_captions_faces,
229
  ):
230
  torch.cuda.empty_cache()
231
  num_images = 1
232
 
233
- images = list(images_captions_faces[:num_inputs])
234
- captions = list(images_captions_faces[num_inputs:2 * num_inputs])
235
- idips_checkboxes = list(images_captions_faces[2 * num_inputs:3 * num_inputs])
236
-
237
- images = [images[i] for i in indices]
238
- captions = [captions[i] for i in indices]
239
- idips_checkboxes = [idips_checkboxes[i] for i in indices]
240
 
241
  print(f"Length of images: {len(images)}")
242
  print(f"Length of captions: {len(captions)}")
243
- print(f"indices: {indices}")
244
 
245
  print(f"Control weight lambda: {control_weight_lambda}")
246
  if control_weight_lambda != "no":
@@ -649,7 +648,8 @@ if __name__ == "__main__":
649
  # ],
650
  # ],
651
  # inputs=[
652
- # prompt, seed,
 
653
  # cond_size,
654
  # target_height,
655
  # target_width,
@@ -673,15 +673,21 @@ if __name__ == "__main__":
673
  gen_btn.click(
674
  generate_image,
675
  inputs=[
676
- prompt, cond_size, target_height, target_width, seed,
677
- vae_skip_iter, weight_id_ip_str,
678
- double_attention, single_attention,
679
- db_latent_lora_scale_str, sb_latent_lora_scale_str, vae_lora_scale_str,
680
- indices_state,
 
 
 
 
 
 
 
 
 
681
  session_state,
682
- *images,
683
- *captions,
684
- *idip_checkboxes,
685
  ],
686
  outputs=output
687
  )
 
215
 
216
  @spaces.GPU()
217
  def generate_image(
218
+ prompt,
219
+ image_1, caption_1, use_id_1,
220
+ image_2, caption_2, use_id_2,
221
+ cond_size,
222
+ target_height,
223
+ target_width,
224
  seed,
225
+ vae_skip_iter,
226
+ control_weight_lambda,
227
  double_attention,
228
  single_attention,
229
  ip_scale,
230
+ latent_sblora_scale_str,
231
+ vae_lora_scale,
232
  session_id,
 
233
  ):
234
  torch.cuda.empty_cache()
235
  num_images = 1
236
 
237
+ images = [image_1, image_2]
238
+ captions = [caption_1, caption_2]
239
+ idips_checkboxes = [use_id_1, use_id_2]
 
 
 
 
240
 
241
  print(f"Length of images: {len(images)}")
242
  print(f"Length of captions: {len(captions)}")
 
243
 
244
  print(f"Control weight lambda: {control_weight_lambda}")
245
  if control_weight_lambda != "no":
 
648
  # ],
649
  # ],
650
  # inputs=[
651
+ # prompt,
652
+ # seed,
653
  # cond_size,
654
  # target_height,
655
  # target_width,
 
673
  gen_btn.click(
674
  generate_image,
675
  inputs=[
676
+ prompt,
677
+ images[0], captions[0], idip_checkboxes[0],
678
+ images[1], captions[1], idip_checkboxes[1],
679
+ cond_size,
680
+ target_height,
681
+ target_width,
682
+ seed,
683
+ vae_skip_iter,
684
+ weight_id_ip_str,
685
+ double_attention,
686
+ single_attention,
687
+ db_latent_lora_scale_str,
688
+ sb_latent_lora_scale_str,
689
+ vae_lora_scale_str,
690
  session_state,
 
 
 
691
  ],
692
  outputs=output
693
  )