Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
220 |
seed,
|
221 |
-
vae_skip_iter,
|
|
|
222 |
double_attention,
|
223 |
single_attention,
|
224 |
ip_scale,
|
225 |
-
latent_sblora_scale_str,
|
226 |
-
|
227 |
session_id,
|
228 |
-
*images_captions_faces,
|
229 |
):
|
230 |
torch.cuda.empty_cache()
|
231 |
num_images = 1
|
232 |
|
233 |
-
images =
|
234 |
-
captions =
|
235 |
-
idips_checkboxes =
|
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,
|
|
|
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,
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
)
|