Astridkraft commited on
Commit
fe49660
·
verified ·
1 Parent(s): 08e885d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -1086,11 +1086,21 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
1086
 
1087
  else: # face_only_change
1088
  keep_environment = True
1089
- adj_strength = min(0.85, strength * 1.25) # Standard-Berechnung
1090
  controlnet_strength = adj_strength * 0.5
1091
- print(f"🎯 MODUS: Ausschließlich Gesicht → Depth+Canny (keep_environment=True)")
1092
-
1093
- print(f"⚙️ ControlNet Settings: Strength={controlnet_strength:.3f}")
 
 
 
 
 
 
 
 
 
 
1094
 
1095
  # ===== WICHTIG: VARIABLEN FÜR KOMPLETTEN WORKFLOW =====
1096
  original_mask = None
 
1086
 
1087
  else: # face_only_change
1088
  keep_environment = True
1089
+ adj_strength = min(0.85, strength * 1.25)
1090
  controlnet_strength = adj_strength * 0.5
1091
+
1092
+ # HIER FEHLEN DIE RATIOS - JETZT HINZUFÜGEN:
1093
+ depth_ratio = 0.7 # Für Gesicht: Depth stärker
1094
+ canny_ratio = 0.3 # Canny leichter
1095
+
1096
+ # KRITISCH: conditioning_scale HIER definieren (wie bei environment_change)!
1097
+ conditioning_scale = [
1098
+ controlnet_strength * depth_ratio,
1099
+ controlnet_strength * canny_ratio
1100
+ ]
1101
+
1102
+ print(f"👤 Gesichtsmodus: Depth {depth_ratio*100}%, Canny {canny_ratio*100}%")
1103
+
1104
 
1105
  # ===== WICHTIG: VARIABLEN FÜR KOMPLETTEN WORKFLOW =====
1106
  original_mask = None