Keshabwi66 commited on
Commit
c1925b9
·
verified ·
1 Parent(s): 3d55b2f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -130,12 +130,12 @@ def start_tryon(person_img, pose_img, mask_img, cloth_img, garment_des, denoise_
130
  pipe.unet_encoder.to(device)
131
 
132
  # Resize and prepare images
133
- garm_img = cloth_img.convert("RGB").resize((768, 1024))
134
- human_img = person_img.convert("RGB").resize((768, 1024))
135
- mask = mask_img.convert("RGB").resize((768, 1024))
136
 
137
  # Prepare pose image (already uploaded)
138
- pose_img = pose_img.resize((768, 1024))
139
 
140
 
141
 
@@ -196,11 +196,11 @@ def start_tryon(person_img, pose_img, mask_img, cloth_img, garment_des, denoise_
196
  pose_img=pose_img_tensor.to(device, torch.float16),
197
  text_embeds_cloth=prompt_embeds_cloth.to(device, torch.float16),
198
  cloth=garm_tensor.to(device, torch.float16),
199
- mask_image=mask_tensor,
200
- image=human_img,
201
  height=1024,
202
  width=768,
203
- ip_adapter_image=garm_img.resize((768, 1024)),
204
  guidance_scale=2.0,
205
  )[0]
206
 
 
130
  pipe.unet_encoder.to(device)
131
 
132
  # Resize and prepare images
133
+ garm_img = cloth_img.convert("RGB").resize((768, 1024)).to(device, torch.float16)
134
+ human_img = person_img.convert("RGB").resize((768, 1024)).to(device, torch.float16)
135
+ mask = mask_img.convert("RGB").resize((768, 1024)).to(device, torch.float16)
136
 
137
  # Prepare pose image (already uploaded)
138
+ pose_img = pose_img.resize((768, 1024)).to(device, torch.float16)
139
 
140
 
141
 
 
196
  pose_img=pose_img_tensor.to(device, torch.float16),
197
  text_embeds_cloth=prompt_embeds_cloth.to(device, torch.float16),
198
  cloth=garm_tensor.to(device, torch.float16),
199
+ mask_image=mask_tensor.to(device, torch.float16),
200
+ image=human_img.to(device, torch.float16),
201
  height=1024,
202
  width=768,
203
+ ip_adapter_image=garm_img.resize((768, 1024)).to(device, torch.float16),
204
  guidance_scale=2.0,
205
  )[0]
206