Update app.py
Browse files
app.py
CHANGED
|
@@ -1292,21 +1292,21 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
|
|
| 1292 |
elif any(keyword in prompt_lower for keyword in nature_keywords):
|
| 1293 |
|
| 1294 |
# DENOISING: Radikaler bei Naturszenen (Wald→Wüste)
|
| 1295 |
-
adj_strength = 0.
|
| 1296 |
|
| 1297 |
# CONTROLNET: WENIGER bei Naturszenen (mehr Freiheit)
|
| 1298 |
-
controlnet_strength = 0.
|
| 1299 |
|
| 1300 |
# RATIOS: WENIG Canny (Kanten stören bei Naturveränderung)
|
| 1301 |
# MEHR Depth (Maßstab/Tiefe erhalten)
|
| 1302 |
-
depth_ratio = 0.
|
| 1303 |
canny_ratio = 1.0 - depth_ratio # erzwingt Kanten - hält dadurch an alter Umgebung fest - schlecht bei Umgebungswechsel
|
| 1304 |
|
| 1305 |
# Clipping verhindert extreme Werte, Controlnet hat immer etwas Einfluß sonst ist Pipline instabil
|
| 1306 |
-
adj_strength = max(0.
|
| 1307 |
-
controlnet_strength = max(0.
|
| 1308 |
-
depth_ratio = max(0.
|
| 1309 |
-
canny_ratio = max(0.
|
| 1310 |
|
| 1311 |
conditioning_scale = [
|
| 1312 |
controlnet_strength * depth_ratio,
|
|
|
|
| 1292 |
elif any(keyword in prompt_lower for keyword in nature_keywords):
|
| 1293 |
|
| 1294 |
# DENOISING: Radikaler bei Naturszenen (Wald→Wüste)
|
| 1295 |
+
adj_strength = 0.15 + (ui_strength * 0.75) # (0.15-0.9 linear) wie stark das bestehende Bild überschrieben wird im kompletten Denoising-Prozess-also Strukturveränderung
|
| 1296 |
|
| 1297 |
# CONTROLNET: WENIGER bei Naturszenen (mehr Freiheit)
|
| 1298 |
+
controlnet_strength = 0.5 + (ui_strength * 0.25) # 0.3-0.6
|
| 1299 |
|
| 1300 |
# RATIOS: WENIG Canny (Kanten stören bei Naturveränderung)
|
| 1301 |
# MEHR Depth (Maßstab/Tiefe erhalten)
|
| 1302 |
+
depth_ratio = 0.9 - (ui_strength * 0.3) # Depth-Wert hält Maßstab und Boden (Emi groß, Liege klein - Emi im Meer)
|
| 1303 |
canny_ratio = 1.0 - depth_ratio # erzwingt Kanten - hält dadurch an alter Umgebung fest - schlecht bei Umgebungswechsel
|
| 1304 |
|
| 1305 |
# Clipping verhindert extreme Werte, Controlnet hat immer etwas Einfluß sonst ist Pipline instabil
|
| 1306 |
+
adj_strength = max(0.15, min(adj_strength, 0.95))
|
| 1307 |
+
controlnet_strength = max(0.2, min(controlnet_strength, 0.6))
|
| 1308 |
+
depth_ratio = max(0.5, min(depth_ratio, 0.95)) # Depth nicht unter 30%
|
| 1309 |
+
canny_ratio = max(0.05, min(canny_ratio, 0.5)) # Canny nicht über 70%
|
| 1310 |
|
| 1311 |
conditioning_scale = [
|
| 1312 |
controlnet_strength * depth_ratio,
|