Astridkraft commited on
Commit
f5ca857
·
verified ·
1 Parent(s): e48453a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -1163,17 +1163,17 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
1163
  ui_strength = strength
1164
 
1165
  # 1. Basierend auf der UI-Stärke (strength) berechnen
1166
- adj_strength = ui_strength * 0.8
1167
- controlnet_strength = 0.6 - (ui_strength * 0.4)
1168
- pose_ratio = 0.75 - (ui_strength * 0.1)
1169
- canny_ratio = 0.25 + (ui_strength * 0.1)
1170
 
1171
 
1172
  # 2. Werte auf sinnvolle Bereiche begrenzen (Clipping)
1173
- adj_strength = max(0.6, min(adj_strength, 0.9))
1174
- controlnet_strength = max(0.15, min(controlnet_strength, 0.6))
1175
- pose_ratio = max(0.6, min(pose_ratio, 0.8))
1176
- canny_ratio = max(0.2, min(canny_ratio, 0.4))
1177
 
1178
  conditioning_scale = [
1179
  controlnet_strength * pose_ratio, # Depth-Gewichtung
@@ -1183,6 +1183,7 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
1183
  print(f"👤 Humanoid → Humanoid (UI-Stärke: {ui_strength})")
1184
  print(f" adj_strength: {adj_strength:.2f}, controlnet: {controlnet_strength:.2f}")
1185
  print(f" Verhältnis: Pose {pose_ratio*100:.0f}% : Canny {canny_ratio*100:.0f}%")
 
1186
 
1187
 
1188
 
 
1163
  ui_strength = strength
1164
 
1165
  # 1. Basierend auf der UI-Stärke (strength) berechnen
1166
+ adj_strength = 0.15 + (ui_strength * 0.75)
1167
+ controlnet_strength = 0.8 - (ui_strength * 0.4)
1168
+ pose_ratio = 0.8 - (ui_strength * 0.3)
1169
+ canny_ratio = 0.2 + (ui_strength * 0.3)
1170
 
1171
 
1172
  # 2. Werte auf sinnvolle Bereiche begrenzen (Clipping)
1173
+ adj_strength = max(0.15, min(adj_strength, 0.85))
1174
+ controlnet_strength = max(0.3, min(controlnet_strength, 0.8))
1175
+ pose_ratio = max(0.5, min(pose_ratio, 0.8))
1176
+ canny_ratio = max(0.2, min(canny_ratio, 0.5))
1177
 
1178
  conditioning_scale = [
1179
  controlnet_strength * pose_ratio, # Depth-Gewichtung
 
1183
  print(f"👤 Humanoid → Humanoid (UI-Stärke: {ui_strength})")
1184
  print(f" adj_strength: {adj_strength:.2f}, controlnet: {controlnet_strength:.2f}")
1185
  print(f" Verhältnis: Pose {pose_ratio*100:.0f}% : Canny {canny_ratio*100:.0f}%")
1186
+ print(f" Scale: [{conditioning_scale[0]:.3f}, {conditioning_scale[1]:.3f}]")
1187
 
1188
 
1189