primerz commited on
Commit
66cd9e8
·
verified ·
1 Parent(s): e61ad65

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +9 -6
model.py CHANGED
@@ -116,15 +116,18 @@ class ModelHandler:
116
  except Exception as e:
117
  print(f" [WARNING] Failed to enable xFormers: {e}")
118
 
119
- # 4. Set Scheduler
120
- # --- MODIFIED: Disable clipping to prevent NaN artifacts ---
121
  print("Configuring LCMScheduler...")
122
  scheduler_config = self.pipeline.scheduler.config
123
  scheduler_config['clip_sample'] = False
124
- self.pipeline.scheduler = LCMScheduler.from_config(scheduler_config)
125
- print(" [OK] LCMScheduler loaded (clip_sample=False).")
126
- # --- END MODIFIED ---
127
-
 
 
 
 
 
128
  # 5. Load Adapters (IP-Adapter & LoRA)
129
  print("Loading Adapters (IP-Adapter & LoRA)...")
130
 
 
116
  except Exception as e:
117
  print(f" [WARNING] Failed to enable xFormers: {e}")
118
 
 
 
119
  print("Configuring LCMScheduler...")
120
  scheduler_config = self.pipeline.scheduler.config
121
  scheduler_config['clip_sample'] = False
122
+
123
+ # --- MODIFIED: optimize for sharp pixel art style ---
124
+ self.pipeline.scheduler = LCMScheduler.from_config(
125
+ scheduler_config,
126
+ timestep_spacing="trailing", # "trailing" is generally sharper for LCM
127
+ rescale_betas_zero_snr=True # Helps prevent washed out colors in style transfer
128
+ )
129
+ print(" [OK] LCMScheduler loaded (clip_sample=False, trailing spacing).")
130
+
131
  # 5. Load Adapters (IP-Adapter & LoRA)
132
  print("Loading Adapters (IP-Adapter & LoRA)...")
133