Spaces:
Configuration error
Configuration error
Update ip_adapter_inpainting.py
Browse files- ip_adapter_inpainting.py +4 -3
ip_adapter_inpainting.py
CHANGED
@@ -12,7 +12,7 @@ init_seg()
|
|
12 |
init_img2txt()
|
13 |
|
14 |
ip_model = MODEL("inpaint")
|
15 |
-
|
16 |
|
17 |
def generate(img_openpose_gen: Image, img_human: Image, img_clothes: Image, segment_id: int):
|
18 |
cropped_clothes = get_cropped(img_openpose_gen, segment_id, False).resize((512, 768))
|
@@ -28,15 +28,16 @@ def generate(img_openpose_gen: Image, img_human: Image, img_clothes: Image, segm
|
|
28 |
|
29 |
ip_gen = ip_model.model.generate(
|
30 |
prompt=prompt,
|
|
|
31 |
pil_image=img_clothes,
|
32 |
num_samples=1,
|
33 |
num_inference_steps=50,
|
34 |
seed=123,
|
35 |
image=composite,
|
36 |
mask_image=mask,
|
37 |
-
strength=0.
|
38 |
guidance_scale=7,
|
39 |
-
scale=
|
40 |
)[0]
|
41 |
|
42 |
cropped_head = get_cropped_face(composite)
|
|
|
12 |
init_img2txt()
|
13 |
|
14 |
ip_model = MODEL("inpaint")
|
15 |
+
negative_prompt = "(deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime:1.4), text, close up, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long nec"
|
16 |
|
17 |
def generate(img_openpose_gen: Image, img_human: Image, img_clothes: Image, segment_id: int):
|
18 |
cropped_clothes = get_cropped(img_openpose_gen, segment_id, False).resize((512, 768))
|
|
|
28 |
|
29 |
ip_gen = ip_model.model.generate(
|
30 |
prompt=prompt,
|
31 |
+
negative_prompt=negative_prompt,
|
32 |
pil_image=img_clothes,
|
33 |
num_samples=1,
|
34 |
num_inference_steps=50,
|
35 |
seed=123,
|
36 |
image=composite,
|
37 |
mask_image=mask,
|
38 |
+
strength=0.75,
|
39 |
guidance_scale=7,
|
40 |
+
scale=1.1
|
41 |
)[0]
|
42 |
|
43 |
cropped_head = get_cropped_face(composite)
|