lixiang46 commited on
Commit
8cf7184
1 Parent(s): 16b66b2
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -198,23 +198,26 @@ def infer_pose(prompt,
198
  negative_prompt = "nsfw,脸部阴影,低分辨率,jpeg伪影、模糊、糟糕,黑脸,霓虹灯",
199
  seed = 66,
200
  randomize_seed = False,
201
- guidance_scale = 6.0,
202
  num_inference_steps = 50,
203
- controlnet_conditioning_scale = 0.7,
204
  control_guidance_end = 0.9,
205
- strength = 1.0
 
206
  ):
207
  if randomize_seed:
208
  seed = random.randint(0, MAX_SEED)
209
  generator = torch.Generator().manual_seed(seed)
210
  init_image = resize_image(image, MAX_IMAGE_SIZE)
211
  pipe = pipe_pose.to("cuda")
 
212
  condi_img = process_dwpose_condition(np.array(init_image), MAX_IMAGE_SIZE)
213
  image = pipe(
214
  prompt= prompt ,
215
  image = init_image,
216
  controlnet_conditioning_scale = controlnet_conditioning_scale,
217
  control_guidance_end = control_guidance_end,
 
218
  strength= strength ,
219
  control_image = condi_img,
220
  negative_prompt= negative_prompt ,
 
198
  negative_prompt = "nsfw,脸部阴影,低分辨率,jpeg伪影、模糊、糟糕,黑脸,霓虹灯",
199
  seed = 66,
200
  randomize_seed = False,
201
+ guidance_scale = 5.0,
202
  num_inference_steps = 50,
203
+ controlnet_conditioning_scale = 0.5,
204
  control_guidance_end = 0.9,
205
+ strength = 1.0,
206
+ ip_scale = 0.5,
207
  ):
208
  if randomize_seed:
209
  seed = random.randint(0, MAX_SEED)
210
  generator = torch.Generator().manual_seed(seed)
211
  init_image = resize_image(image, MAX_IMAGE_SIZE)
212
  pipe = pipe_pose.to("cuda")
213
+ pipe.set_ip_adapter_scale([ip_scale])
214
  condi_img = process_dwpose_condition(np.array(init_image), MAX_IMAGE_SIZE)
215
  image = pipe(
216
  prompt= prompt ,
217
  image = init_image,
218
  controlnet_conditioning_scale = controlnet_conditioning_scale,
219
  control_guidance_end = control_guidance_end,
220
+ ip_adapter_image=[ipa_img],
221
  strength= strength ,
222
  control_image = condi_img,
223
  negative_prompt= negative_prompt ,