Spaces:
Configuration error
Configuration error
Update ip_adapter_inpainting.py
Browse files- ip_adapter_inpainting.py +4 -5
ip_adapter_inpainting.py
CHANGED
@@ -19,11 +19,10 @@ def generate(img_openpose_gen: Image, img_human: Image, img_clothes: Image, segm
|
|
19 |
cropped_clothes = get_cropped(img_openpose_gen, segment_id, False, False).resize((512, 768))
|
20 |
cropped_body = get_cropped(img_human, segment_id, True, False).resize((512, 768))
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
composite = alpha_composite_manuel(cropped_body)
|
27 |
|
28 |
mask = get_blurred_mask(composite, segment_id)
|
29 |
prompt = derive_caption(img_clothes)
|
|
|
19 |
cropped_clothes = get_cropped(img_openpose_gen, segment_id, False, False).resize((512, 768))
|
20 |
cropped_body = get_cropped(img_human, segment_id, True, False).resize((512, 768))
|
21 |
|
22 |
+
composite = Image.alpha_composite(cropped_body.convert('RGBA'),
|
23 |
+
cropped_clothes.convert('RGBA')
|
24 |
+
)
|
25 |
+
composite = alpha_composite_manuel(composite)
|
|
|
26 |
|
27 |
mask = get_blurred_mask(composite, segment_id)
|
28 |
prompt = derive_caption(img_clothes)
|