altayavci commited on
Commit
dc69b4c
1 Parent(s): eb756d1

Update ip_adapter_inpainting.py

Browse files
Files changed (1) hide show
  1. ip_adapter_inpainting.py +4 -1
ip_adapter_inpainting.py CHANGED
@@ -24,12 +24,15 @@ def generate(img_openpose_gen: Image, img_human: Image, img_clothes: Image, segm
24
  )
25
  composite = alpha_composite_manuel(composite)
26
 
 
 
 
27
  mask = get_blurred_mask(img_openpose_gen, segment_id)
28
  prompt = derive_caption(img_clothes)
29
 
30
  ip_gen = ip_model.model.generate(
31
  prompt=prompt,
32
- pil_image=img_clothes,
33
  num_samples=1,
34
  num_inference_steps=50,
35
  seed=42,
 
24
  )
25
  composite = alpha_composite_manuel(composite)
26
 
27
+ input_clothes = get_cropped(img_clothes, segment_id, False, False).resize(img_openpose_gen.size)
28
+ input_clothes = alpha_composite_manuel(input_clothes)
29
+
30
  mask = get_blurred_mask(img_openpose_gen, segment_id)
31
  prompt = derive_caption(img_clothes)
32
 
33
  ip_gen = ip_model.model.generate(
34
  prompt=prompt,
35
+ pil_image=input_clothes,
36
  num_samples=1,
37
  num_inference_steps=50,
38
  seed=42,