Spaces:
Running on Zero
Running on Zero
Commit ·
cb8dc60
1
Parent(s): 8bd41aa
fix
Browse files
app.py
CHANGED
|
@@ -17,6 +17,8 @@ SKIN_LORA = "tlennon-ie/qwen-edit-skin"
|
|
| 17 |
# Fixed prompt for head swap
|
| 18 |
FIXED_PROMPT = """head_swap: start with Picture 1 as the base image, keeping its lighting, environment, and background. remove the head from Picture 1 completely and replace it with the head from Picture 2. ensure the head and body have correct anatomical proportions, and blend the skin tones, shadows, and lighting naturally so the final result appears as one coherent, realistic person."""
|
| 19 |
|
|
|
|
|
|
|
| 20 |
# Cache for loaded pipe
|
| 21 |
pipe_cache = None
|
| 22 |
|
|
@@ -144,9 +146,11 @@ def face_swap(
|
|
| 144 |
result = pipe(
|
| 145 |
image=input_images_list, # Passamos a lista aqui
|
| 146 |
prompt=final_prompt,
|
|
|
|
|
|
|
| 147 |
# input_image removido pois não existe neste pipeline
|
| 148 |
num_inference_steps=num_inference_steps,
|
| 149 |
-
guidance_scale=guidance_scale,
|
| 150 |
generator=generator
|
| 151 |
).images[0]
|
| 152 |
|
|
|
|
| 17 |
# Fixed prompt for head swap
|
| 18 |
FIXED_PROMPT = """head_swap: start with Picture 1 as the base image, keeping its lighting, environment, and background. remove the head from Picture 1 completely and replace it with the head from Picture 2. ensure the head and body have correct anatomical proportions, and blend the skin tones, shadows, and lighting naturally so the final result appears as one coherent, realistic person."""
|
| 19 |
|
| 20 |
+
DEFAULT_NEGATIVE_PROMPT = "bad quality, worst quality, low resolution, blur, distortion, unnatural blending, cartoon, illustration, painting"
|
| 21 |
+
|
| 22 |
# Cache for loaded pipe
|
| 23 |
pipe_cache = None
|
| 24 |
|
|
|
|
| 146 |
result = pipe(
|
| 147 |
image=input_images_list, # Passamos a lista aqui
|
| 148 |
prompt=final_prompt,
|
| 149 |
+
negative_prompt=DEFAULT_NEGATIVE_PROMPT,
|
| 150 |
+
true_cfg_scale=guidance_scale,
|
| 151 |
# input_image removido pois não existe neste pipeline
|
| 152 |
num_inference_steps=num_inference_steps,
|
| 153 |
+
#guidance_scale=guidance_scale,
|
| 154 |
generator=generator
|
| 155 |
).images[0]
|
| 156 |
|