Update app.py
Browse files
app.py
CHANGED
|
@@ -1264,17 +1264,35 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
|
|
| 1264 |
|
| 1265 |
# Anpassung für Naturszenen (maximale Flexibilität) - die optimalen UI-Werte: strength:0,72 , steps: 35 , guidance: 9-9,5
|
| 1266 |
elif any(keyword in prompt_lower for keyword in nature_keywords):
|
| 1267 |
-
adj_strength = 0.75 #wie stark das bestehende Bild überschrieben wird im kompletten Denoising-Prozess-also Strukturveränderung
|
| 1268 |
-
controlnet_strength = 0.3
|
| 1269 |
-
depth_ratio = 0.15 #Depth-Wert hält Maßstab und Boden (Emi groß, Liege klein - Emi im Meer)
|
| 1270 |
-
canny_ratio = 0.00 #erzwingt Kanten - hält dadurch an alter Umgebung fest - schlecht bei Umgebungswechsel
|
| 1271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1272 |
conditioning_scale = [
|
| 1273 |
-
controlnet_strength * depth_ratio,
|
| 1274 |
-
controlnet_strength * canny_ratio
|
| 1275 |
]
|
| 1276 |
-
|
| 1277 |
-
print("🌳
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1278 |
else:
|
| 1279 |
print("🎯 Standard-Ratio 90:10 (Depth:Canny)")
|
| 1280 |
|
|
|
|
| 1264 |
|
| 1265 |
# Anpassung für Naturszenen (maximale Flexibilität) - die optimalen UI-Werte: strength:0,72 , steps: 35 , guidance: 9-9,5
|
| 1266 |
elif any(keyword in prompt_lower for keyword in nature_keywords):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1267 |
|
| 1268 |
+
# 1. DENOISING: Radikaler bei Naturszenen (Wald→Wüste)
|
| 1269 |
+
adj_strength = 0.3 + (ui_strength * 0.5) # 0.3-0.8
|
| 1270 |
+
|
| 1271 |
+
# 2. CONTROLNET: WENIGER bei Naturszenen (mehr Freiheit)
|
| 1272 |
+
controlnet_strength = 0.3 + (ui_strength * 0.3) # 0.3-0.6
|
| 1273 |
+
|
| 1274 |
+
# 3. RATIOS: WENIG Canny (Kanten stören bei Naturveränderung)
|
| 1275 |
+
# MEHR Depth (Maßstab/Tiefe erhalten)
|
| 1276 |
+
depth_ratio = 0.8 - (ui_strength * 0.3) # 0.8-0.5
|
| 1277 |
+
canny_ratio = 1.0 - depth_ratio # 0.2-0.5
|
| 1278 |
+
|
| 1279 |
conditioning_scale = [
|
| 1280 |
+
controlnet_strength * depth_ratio,
|
| 1281 |
+
controlnet_strength * canny_ratio
|
| 1282 |
]
|
| 1283 |
+
|
| 1284 |
+
print(f"🌳 NATURSZENE: UI={ui_strength:.2f}")
|
| 1285 |
+
print(f" Radikaler Hintergrundwechsel möglich")
|
| 1286 |
+
print(f" Depth: {depth_ratio*100:.0f}% (Maßstab), Canny: {canny_ratio*100:.0f}%")
|
| 1287 |
+
|
| 1288 |
+
|
| 1289 |
+
#bisherige
|
| 1290 |
+
#adj_strength = 0.75 #wie stark das bestehende Bild überschrieben wird im kompletten Denoising-Prozess-also Strukturveränderung
|
| 1291 |
+
#controlnet_strength = 0.3
|
| 1292 |
+
#depth_ratio = 0.15 #Depth-Wert hält Maßstab und Boden (Emi groß, Liege klein - Emi im Meer)
|
| 1293 |
+
#canny_ratio = 0.00 #erzwingt Kanten - hält dadurch an alter Umgebung fest - schlecht bei Umgebungswechsel
|
| 1294 |
+
|
| 1295 |
+
|
| 1296 |
else:
|
| 1297 |
print("🎯 Standard-Ratio 90:10 (Depth:Canny)")
|
| 1298 |
|