Spaces:
Runtime error
Runtime error
Update models.py
Browse files
models.py
CHANGED
|
@@ -385,14 +385,14 @@ def setup_ip_adapter(pipe, image_encoder):
|
|
| 385 |
return None, False
|
| 386 |
|
| 387 |
|
| 388 |
-
# --- START FIX: Use CompelForSDXL
|
| 389 |
def setup_compel(pipe):
|
| 390 |
"""Setup CompelForSDXL for better SDXL prompt handling."""
|
| 391 |
print("Setting up Compel for enhanced prompt processing (using CompelForSDXL)...")
|
| 392 |
try:
|
| 393 |
-
# Pass the whole pipeline
|
| 394 |
-
compel = CompelForSDXL(pipe)
|
| 395 |
-
print(" [OK] CompelForSDXL loaded successfully")
|
| 396 |
return compel, True
|
| 397 |
except Exception as e:
|
| 398 |
print(f" [WARNING] Compel not available: {e}")
|
|
|
|
| 385 |
return None, False
|
| 386 |
|
| 387 |
|
| 388 |
+
# --- START FIX: Use CompelForSDXL and ENABLE TRUNCATION ---
|
| 389 |
def setup_compel(pipe):
|
| 390 |
"""Setup CompelForSDXL for better SDXL prompt handling."""
|
| 391 |
print("Setting up Compel for enhanced prompt processing (using CompelForSDXL)...")
|
| 392 |
try:
|
| 393 |
+
# Pass the whole pipeline and enable truncation
|
| 394 |
+
compel = CompelForSDXL(pipe, truncate_long_prompts=True)
|
| 395 |
+
print(" [OK] CompelForSDXL loaded successfully (with truncation)")
|
| 396 |
return compel, True
|
| 397 |
except Exception as e:
|
| 398 |
print(f" [WARNING] Compel not available: {e}")
|