primerz commited on
Commit
5c4da2e
·
verified ·
1 Parent(s): beb501c

Update generator.py

Browse files
Files changed (1) hide show
  1. generator.py +5 -7
generator.py CHANGED
@@ -346,16 +346,14 @@ class RetroArtConverter:
346
  print(f"[FACE] Face detection failed: {str(e)[:100]}")
347
  raise ValueError(f"No face found in image. Only face images work. Error: {str(e)}")
348
 
349
- # Set LORA scale using diffusers adapter system (like working code without face)
350
  if self.models_loaded['lora']:
351
  try:
352
- if hasattr(self.pipe, 'set_adapters'):
353
- self.pipe.set_adapters(["retroart"], adapter_weights=[lora_scale])
354
- print(f"[LORA] Set adapter 'retroart' with scale: {lora_scale}")
355
- else:
356
- print(f"[LORA] Warning: set_adapters not available")
357
  except Exception as e:
358
- print(f"[LORA] Could not set adapter: {e}")
359
 
360
  # ═══════════════════════════════════════════════════════════
361
  # PIPELINE CONFIGURATION
 
346
  print(f"[FACE] Face detection failed: {str(e)[:100]}")
347
  raise ValueError(f"No face found in image. Only face images work. Error: {str(e)}")
348
 
349
+ # Fuse LORA with scale (following working example approach)
350
  if self.models_loaded['lora']:
351
  try:
352
+ from models import fuse_lora_with_scale
353
+ fuse_lora_with_scale(self.pipe, lora_scale)
354
+ print(f"[LORA] Fused with scale: {lora_scale}")
 
 
355
  except Exception as e:
356
+ print(f"[LORA] Could not fuse: {e}")
357
 
358
  # ═══════════════════════════════════════════════════════════
359
  # PIPELINE CONFIGURATION