Update app.py
Browse files
app.py
CHANGED
|
@@ -1155,32 +1155,27 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
|
|
| 1155 |
# print("👤 Humanoid → Humanoid → Ratio 85:15 (Pose:Canny)")
|
| 1156 |
|
| 1157 |
if any(keyword in prompt_lower for keyword in humanoid_keywords):
|
| 1158 |
-
# Der Parameter 'strength' ist die UI-
|
| 1159 |
-
|
|
|
|
| 1160 |
|
| 1161 |
# 1. Basierend auf der UI-Stärke (strength) berechnen
|
| 1162 |
-
|
| 1163 |
-
|
| 1164 |
-
|
| 1165 |
-
|
| 1166 |
-
|
| 1167 |
-
adj_strength = ui_strength
|
| 1168 |
-
controlnet_strength = 0.26
|
| 1169 |
-
pose_ratio = 0.665
|
| 1170 |
-
canny_ratio = 0.335
|
| 1171 |
-
|
| 1172 |
-
conditioning_scale = [0.173, 0.087]
|
| 1173 |
|
| 1174 |
# 2. Werte auf sinnvolle Bereiche begrenzen (Clipping)
|
| 1175 |
-
|
| 1176 |
-
|
| 1177 |
-
|
| 1178 |
-
|
| 1179 |
-
|
| 1180 |
-
|
| 1181 |
-
|
| 1182 |
-
|
| 1183 |
-
|
| 1184 |
|
| 1185 |
print(f"👤 Humanoid → Humanoid (UI-Stärke: {ui_strength})")
|
| 1186 |
print(f" adj_strength: {adj_strength:.2f}, controlnet: {controlnet_strength:.2f}")
|
|
|
|
| 1155 |
# print("👤 Humanoid → Humanoid → Ratio 85:15 (Pose:Canny)")
|
| 1156 |
|
| 1157 |
if any(keyword in prompt_lower for keyword in humanoid_keywords):
|
| 1158 |
+
# Der Parameter 'strength' ist die UI-Veränderungsstärke d.h. die Einstellungen
|
| 1159 |
+
# für Controlnet werden anhand von strength berechnet:
|
| 1160 |
+
ui_strength = strength
|
| 1161 |
|
| 1162 |
# 1. Basierend auf der UI-Stärke (strength) berechnen
|
| 1163 |
+
adj_strength = ui_strength * 0.8
|
| 1164 |
+
controlnet_strength = 0.6 - (ui_strength * 0.4)
|
| 1165 |
+
pose_ratio = 0.75 - (ui_strength * 0.1)
|
| 1166 |
+
canny_ratio = 0.25 + (ui_strength * 0.1)
|
| 1167 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1168 |
|
| 1169 |
# 2. Werte auf sinnvolle Bereiche begrenzen (Clipping)
|
| 1170 |
+
adj_strength = max(0.6, min(adj_strength, 0.9))
|
| 1171 |
+
controlnet_strength = max(0.15, min(controlnet_strength, 0.6))
|
| 1172 |
+
pose_ratio = max(0.6, min(pose_ratio, 0.8))
|
| 1173 |
+
canny_ratio = max(0.2, min(canny_ratio, 0.4))
|
| 1174 |
+
|
| 1175 |
+
conditioning_scale = [
|
| 1176 |
+
controlnet_strength * depth_ratio, # Depth-Gewichtung
|
| 1177 |
+
controlnet_strength * canny_ratio # Canny-Gewichtung
|
| 1178 |
+
]
|
| 1179 |
|
| 1180 |
print(f"👤 Humanoid → Humanoid (UI-Stärke: {ui_strength})")
|
| 1181 |
print(f" adj_strength: {adj_strength:.2f}, controlnet: {controlnet_strength:.2f}")
|