Spaces:
Running
on
Zero
Running
on
Zero
Update generator.py
Browse files- generator.py +7 -4
generator.py
CHANGED
|
@@ -31,7 +31,8 @@ class Generator:
|
|
| 31 |
input_image,
|
| 32 |
user_prompt="",
|
| 33 |
negative_prompt="",
|
| 34 |
-
guidance_scale
|
|
|
|
| 35 |
num_inference_steps=6,
|
| 36 |
img2img_strength=0.3,
|
| 37 |
depth_strength=0.3,
|
|
@@ -40,6 +41,7 @@ class Generator:
|
|
| 40 |
):
|
| 41 |
# 1. Pre-process Inputs
|
| 42 |
print("Processing Input...")
|
|
|
|
| 43 |
processed_image = resize_image_to_1mp(input_image)
|
| 44 |
target_width, target_height = processed_image.size
|
| 45 |
|
|
@@ -58,6 +60,7 @@ class Generator:
|
|
| 58 |
final_prompt = f"{Config.STYLE_TRIGGER}, {user_prompt}"
|
| 59 |
|
| 60 |
print(f"Prompt: {final_prompt}")
|
|
|
|
| 61 |
|
| 62 |
# 4. Generate Control Maps
|
| 63 |
print("Generating Control Maps (Depth, LineArt)...")
|
|
@@ -111,9 +114,9 @@ class Generator:
|
|
| 111 |
control_guidance_end=control_guidance_end,
|
| 112 |
clip_skip=2,
|
| 113 |
|
| 114 |
-
# ---
|
| 115 |
-
eta=0.
|
| 116 |
-
#
|
| 117 |
|
| 118 |
).images[0]
|
| 119 |
|
|
|
|
| 31 |
input_image,
|
| 32 |
user_prompt="",
|
| 33 |
negative_prompt="",
|
| 34 |
+
# --- CHANGED: Default guidance_scale to 0.0 for TCD ---
|
| 35 |
+
guidance_scale=0.0,
|
| 36 |
num_inference_steps=6,
|
| 37 |
img2img_strength=0.3,
|
| 38 |
depth_strength=0.3,
|
|
|
|
| 41 |
):
|
| 42 |
# 1. Pre-process Inputs
|
| 43 |
print("Processing Input...")
|
| 44 |
+
# Reverted to original aspect-ratio preserving resize
|
| 45 |
processed_image = resize_image_to_1mp(input_image)
|
| 46 |
target_width, target_height = processed_image.size
|
| 47 |
|
|
|
|
| 60 |
final_prompt = f"{Config.STYLE_TRIGGER}, {user_prompt}"
|
| 61 |
|
| 62 |
print(f"Prompt: {final_prompt}")
|
| 63 |
+
print(f"Negative Prompt: {negative_prompt}")
|
| 64 |
|
| 65 |
# 4. Generate Control Maps
|
| 66 |
print("Generating Control Maps (Depth, LineArt)...")
|
|
|
|
| 114 |
control_guidance_end=control_guidance_end,
|
| 115 |
clip_skip=2,
|
| 116 |
|
| 117 |
+
# --- TCD Specific Parameter ---
|
| 118 |
+
eta=0.3,
|
| 119 |
+
# ------------------------------
|
| 120 |
|
| 121 |
).images[0]
|
| 122 |
|