primerz commited on
Commit
4120ce0
·
verified ·
1 Parent(s): 7ee5826

Update generator.py

Browse files
Files changed (1) hide show
  1. generator.py +9 -9
generator.py CHANGED
@@ -56,13 +56,13 @@ class Generator:
56
  # ControlNet order: [InstantID, Zoe, LineArt]
57
  if face_emb is not None:
58
  print("Face detected: Applying InstantID.")
59
- controlnet_conditioning_scale = [0.8, 0.4, 0.4]
60
- control_guidance_end = [0.4, 0.8, 0.8] # Stop InstantID early
61
- self.mh.pipeline.set_ip_adapter_scale(0.8) # Set IP-Adapter (likeness) strength
62
  else:
63
  print("No face detected: Disabling InstantID.")
64
- controlnet_conditioning_scale = [0.0, 0.4, 0.4] # Disable InstantID weight
65
- control_guidance_end = [0.4, 0.8, 0.8]
66
  self.mh.pipeline.set_ip_adapter_scale(0.0)
67
 
68
  # --- START FIX for NoneType Error ---
@@ -79,15 +79,15 @@ class Generator:
79
  control_image=[processed_image, depth_map, lineart_map], # ControlNet inputs
80
  image_embeds=face_emb, # Face embedding (or dummy)
81
 
82
- strength=0.5, # <-- Img2Img strength
83
  controlnet_conditioning_scale=controlnet_conditioning_scale,
84
  control_guidance_end=control_guidance_end,
85
 
86
  # LCM settings
87
- num_inference_steps=9,
88
- guidance_scale=2.75, # <-- CFG Scale
89
 
90
- clip_skip=3,
91
 
92
  # --- LoRA Strength ---
93
  cross_attention_kwargs={"scale": 1.25}
 
56
  # ControlNet order: [InstantID, Zoe, LineArt]
57
  if face_emb is not None:
58
  print("Face detected: Applying InstantID.")
59
+ controlnet_conditioning_scale = [0.6, 0.3, 0.3]
60
+ control_guidance_end = [0.3, 0.6, 0.6] # Stop InstantID early
61
+ self.mh.pipeline.set_ip_adapter_scale(0.6) # Set IP-Adapter (likeness) strength
62
  else:
63
  print("No face detected: Disabling InstantID.")
64
+ controlnet_conditioning_scale = [0.0, 0.3, 0.3] # Disable InstantID weight
65
+ control_guidance_end = [0.3, 0.6, 0.6]
66
  self.mh.pipeline.set_ip_adapter_scale(0.0)
67
 
68
  # --- START FIX for NoneType Error ---
 
79
  control_image=[processed_image, depth_map, lineart_map], # ControlNet inputs
80
  image_embeds=face_emb, # Face embedding (or dummy)
81
 
82
+ strength=0.3, # <-- Img2Img strength
83
  controlnet_conditioning_scale=controlnet_conditioning_scale,
84
  control_guidance_end=control_guidance_end,
85
 
86
  # LCM settings
87
+ num_inference_steps=6,
88
+ guidance_scale=1.5, # <-- CFG Scale
89
 
90
+ clip_skip=2,
91
 
92
  # --- LoRA Strength ---
93
  cross_attention_kwargs={"scale": 1.25}