Update app.py
Browse files
app.py
CHANGED
|
@@ -306,18 +306,10 @@ def generate(
|
|
| 306 |
)
|
| 307 |
|
| 308 |
if ip_slot is not None:
|
| 309 |
-
#
|
| 310 |
-
#
|
| 311 |
-
#
|
| 312 |
-
|
| 313 |
-
ip_embeds = pipe.prepare_ip_adapter_image_embeds(
|
| 314 |
-
ip_adapter_image=ip_image,
|
| 315 |
-
ip_adapter_image_embeds=None,
|
| 316 |
-
device=DEVICE,
|
| 317 |
-
num_images_per_prompt=1,
|
| 318 |
-
do_classifier_free_guidance=True,
|
| 319 |
-
)
|
| 320 |
-
call_kwargs["ip_adapter_image_embeds"] = ip_embeds
|
| 321 |
|
| 322 |
# 4. Run generation
|
| 323 |
result = pipe(**call_kwargs).images[0]
|
|
|
|
| 306 |
)
|
| 307 |
|
| 308 |
if ip_slot is not None:
|
| 309 |
+
# diffusers 0.27.2 accepts a raw PIL image here; CLIP encoding happens
|
| 310 |
+
# internally. The shape-mismatch bug we saw earlier appeared in newer
|
| 311 |
+
# versions, which is why diffusers is pinned in requirements.txt.
|
| 312 |
+
call_kwargs["ip_adapter_image"] = ip_image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
|
| 314 |
# 4. Run generation
|
| 315 |
result = pipe(**call_kwargs).images[0]
|