Spaces:
Running
on
Zero
Running
on
Zero
Update model.py
Browse files
model.py
CHANGED
|
@@ -118,13 +118,13 @@ class ModelHandler:
|
|
| 118 |
|
| 119 |
# 4. Set TCD Scheduler
|
| 120 |
print("Configuring TCDScheduler...")
|
| 121 |
-
# --- FIX:
|
| 122 |
self.pipeline.scheduler = TCDScheduler.from_config(
|
| 123 |
self.pipeline.scheduler.config,
|
| 124 |
-
use_karras_sigmas=True
|
|
|
|
| 125 |
)
|
| 126 |
-
|
| 127 |
-
print(" [OK] TCDScheduler loaded (Karras enabled).")
|
| 128 |
|
| 129 |
# 5. Load Adapters (IP-Adapter, TCD-LoRA & Style LoRA)
|
| 130 |
print("Loading Adapters...")
|
|
@@ -145,7 +145,7 @@ class ModelHandler:
|
|
| 145 |
print(f"Loading IP-Adapter from local file: {ip_adapter_local_path}")
|
| 146 |
self.pipeline.load_ip_adapter_instantid(ip_adapter_local_path)
|
| 147 |
|
| 148 |
-
# 5b. Load TCD LoRA
|
| 149 |
print("Loading TCD-SDXL-LoRA...")
|
| 150 |
tcd_lora_filename = "pytorch_lora_weights.safetensors"
|
| 151 |
tcd_lora_path = os.path.join("./models", tcd_lora_filename)
|
|
|
|
| 118 |
|
| 119 |
# 4. Set TCD Scheduler
|
| 120 |
print("Configuring TCDScheduler...")
|
| 121 |
+
# --- FIX: Set timestep_spacing="trailing" for proper distilled sampling ---
|
| 122 |
self.pipeline.scheduler = TCDScheduler.from_config(
|
| 123 |
self.pipeline.scheduler.config,
|
| 124 |
+
use_karras_sigmas=True,
|
| 125 |
+
timestep_spacing="trailing"
|
| 126 |
)
|
| 127 |
+
print(" [OK] TCDScheduler loaded (Karras + Trailing Spacing).")
|
|
|
|
| 128 |
|
| 129 |
# 5. Load Adapters (IP-Adapter, TCD-LoRA & Style LoRA)
|
| 130 |
print("Loading Adapters...")
|
|
|
|
| 145 |
print(f"Loading IP-Adapter from local file: {ip_adapter_local_path}")
|
| 146 |
self.pipeline.load_ip_adapter_instantid(ip_adapter_local_path)
|
| 147 |
|
| 148 |
+
# 5b. Load TCD LoRA (Correct filename)
|
| 149 |
print("Loading TCD-SDXL-LoRA...")
|
| 150 |
tcd_lora_filename = "pytorch_lora_weights.safetensors"
|
| 151 |
tcd_lora_path = os.path.join("./models", tcd_lora_filename)
|