Spaces:
Runtime error
Runtime error
Update generator.py
Browse files- generator.py +11 -1
generator.py
CHANGED
|
@@ -323,6 +323,12 @@ class RetroArtConverter:
|
|
| 323 |
depth_control_scale
|
| 324 |
]
|
| 325 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 326 |
# IP-Adapter face embeddings (SIMPLE - pipeline handles everything!)
|
| 327 |
if face_embeddings is not None:
|
| 328 |
print(f"Adding face embeddings for IP-Adapter...")
|
|
@@ -345,6 +351,10 @@ class RetroArtConverter:
|
|
| 345 |
# Use depth for both ControlNet slots (identity scale = 0)
|
| 346 |
pipe_kwargs["control_image"] = [depth_image, depth_image]
|
| 347 |
pipe_kwargs["controlnet_conditioning_scale"] = [0.0, depth_control_scale]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 348 |
|
| 349 |
# Generate
|
| 350 |
print(f"Generating: Steps={num_inference_steps}, CFG={guidance_scale}, Strength={strength}")
|
|
@@ -385,4 +395,4 @@ class RetroArtConverter:
|
|
| 385 |
gc.collect()
|
| 386 |
|
| 387 |
|
| 388 |
-
print("[OK] Generator class ready with InstantID support")
|
|
|
|
| 323 |
depth_control_scale
|
| 324 |
]
|
| 325 |
|
| 326 |
+
# Control guidance timing (when each ControlNet is active)
|
| 327 |
+
# [start, start] - both active from beginning
|
| 328 |
+
# [end, end] - both active until end
|
| 329 |
+
pipe_kwargs["control_guidance_start"] = [0.0, 0.0]
|
| 330 |
+
pipe_kwargs["control_guidance_end"] = [1.0, 1.0]
|
| 331 |
+
|
| 332 |
# IP-Adapter face embeddings (SIMPLE - pipeline handles everything!)
|
| 333 |
if face_embeddings is not None:
|
| 334 |
print(f"Adding face embeddings for IP-Adapter...")
|
|
|
|
| 351 |
# Use depth for both ControlNet slots (identity scale = 0)
|
| 352 |
pipe_kwargs["control_image"] = [depth_image, depth_image]
|
| 353 |
pipe_kwargs["controlnet_conditioning_scale"] = [0.0, depth_control_scale]
|
| 354 |
+
|
| 355 |
+
# Control guidance timing for both slots
|
| 356 |
+
pipe_kwargs["control_guidance_start"] = [0.0, 0.0]
|
| 357 |
+
pipe_kwargs["control_guidance_end"] = [1.0, 1.0]
|
| 358 |
|
| 359 |
# Generate
|
| 360 |
print(f"Generating: Steps={num_inference_steps}, CFG={guidance_scale}, Strength={strength}")
|
|
|
|
| 395 |
gc.collect()
|
| 396 |
|
| 397 |
|
| 398 |
+
print("[OK] Generator class ready with InstantID support")
|