primerz commited on
Commit
81c50c6
·
verified ·
1 Parent(s): dd5747d

Update models.py

Browse files
Files changed (1) hide show
  1. models.py +4 -4
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 helper class ---
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 as per Compel docs
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}")