Upload app.py
Browse files
app.py
CHANGED
@@ -148,6 +148,13 @@ img_transform = transforms.Compose([
|
|
148 |
|
149 |
openpose_model = OpenposeDetector.from_pretrained('lllyasviel/ControlNet').to(args.device)
|
150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
def resize_img(input_image, max_side=640, min_side=512, size=None,
|
152 |
pad_to_max_side=False, mode=Image.BILINEAR, base_pixel_number=64):
|
153 |
w, h = input_image.size
|
@@ -163,8 +170,7 @@ def resize_img(input_image, max_side=640, min_side=512, size=None,
|
|
163 |
@spaces.GPU
|
164 |
def dress_process(garm_img, face_img, pose_img, prompt, cloth_guidance_scale, caption_guidance_scale,
|
165 |
face_guidance_scale,self_guidance_scale, cross_guidance_scale,if_ipa, if_post, if_control, denoise_steps, seed=42):
|
166 |
-
image_face_fusion = pipeline('face_fusion_torch', model='damo/cv_unet_face_fusion_torch',
|
167 |
-
model_revision='v1.0.3')
|
168 |
if prompt is None:
|
169 |
prompt = "a photography of a model"
|
170 |
prompt = prompt + ', best quality, high quality'
|
|
|
148 |
|
149 |
openpose_model = OpenposeDetector.from_pretrained('lllyasviel/ControlNet').to(args.device)
|
150 |
|
151 |
+
unet.requires_grad_(False)
|
152 |
+
ref_unet.requires_grad_(False)
|
153 |
+
image_encoder.requires_grad_(False)
|
154 |
+
vae.requires_grad_(False)
|
155 |
+
text_encoder.requires_grad_(False)
|
156 |
+
|
157 |
+
|
158 |
def resize_img(input_image, max_side=640, min_side=512, size=None,
|
159 |
pad_to_max_side=False, mode=Image.BILINEAR, base_pixel_number=64):
|
160 |
w, h = input_image.size
|
|
|
170 |
@spaces.GPU
|
171 |
def dress_process(garm_img, face_img, pose_img, prompt, cloth_guidance_scale, caption_guidance_scale,
|
172 |
face_guidance_scale,self_guidance_scale, cross_guidance_scale,if_ipa, if_post, if_control, denoise_steps, seed=42):
|
173 |
+
image_face_fusion = pipeline('face_fusion_torch', model='damo/cv_unet_face_fusion_torch',)
|
|
|
174 |
if prompt is None:
|
175 |
prompt = "a photography of a model"
|
176 |
prompt = prompt + ', best quality, high quality'
|