Update app.py
Browse files
app.py
CHANGED
|
@@ -1248,7 +1248,14 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
|
|
| 1248 |
controlnet_strength = 0.55
|
| 1249 |
depth_ratio = 0.55
|
| 1250 |
canny_ratio = 0.20
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1251 |
print("🏠 Innenraum erkannt → Ratio 80:20 (Depth:Canny)")
|
|
|
|
| 1252 |
|
| 1253 |
# Anpassung für Naturszenen (maximale Flexibilität) - die optimalen UI-Werte: strength:0,72 , steps: 35 , guidance: 9-9,5
|
| 1254 |
elif any(keyword in prompt_lower for keyword in nature_keywords):
|
|
@@ -1256,15 +1263,21 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
|
|
| 1256 |
controlnet_strength = 0.3
|
| 1257 |
depth_ratio = 0.15 #Depth-Wert hält Maßstab und Boden (Emi groß, Liege klein - Emi im Meer)
|
| 1258 |
canny_ratio = 0.00 #erzwingt Kanten - hält dadurch an alter Umgebung fest - schlecht bei Umgebungswechsel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1259 |
print("🌳 Naturszene erkannt → Ratio 95:5 (Depth:Canny)")
|
| 1260 |
else:
|
| 1261 |
print("🎯 Standard-Ratio 90:10 (Depth:Canny)")
|
| 1262 |
|
| 1263 |
-
|
| 1264 |
-
|
| 1265 |
-
|
| 1266 |
-
|
| 1267 |
-
|
| 1268 |
|
| 1269 |
print(f"🎯 OPTIMIERTER MODUS: Umgebung ändern")
|
| 1270 |
print(f" Strength: {adj_strength}, ControlNet: {controlnet_strength}")
|
|
|
|
| 1248 |
controlnet_strength = 0.55
|
| 1249 |
depth_ratio = 0.55
|
| 1250 |
canny_ratio = 0.20
|
| 1251 |
+
|
| 1252 |
+
conditioning_scale = [
|
| 1253 |
+
controlnet_strength * depth_ratio, # Depth-Gewichtung
|
| 1254 |
+
controlnet_strength * canny_ratio # Canny-Gewichtung
|
| 1255 |
+
]
|
| 1256 |
+
|
| 1257 |
print("🏠 Innenraum erkannt → Ratio 80:20 (Depth:Canny)")
|
| 1258 |
+
|
| 1259 |
|
| 1260 |
# Anpassung für Naturszenen (maximale Flexibilität) - die optimalen UI-Werte: strength:0,72 , steps: 35 , guidance: 9-9,5
|
| 1261 |
elif any(keyword in prompt_lower for keyword in nature_keywords):
|
|
|
|
| 1263 |
controlnet_strength = 0.3
|
| 1264 |
depth_ratio = 0.15 #Depth-Wert hält Maßstab und Boden (Emi groß, Liege klein - Emi im Meer)
|
| 1265 |
canny_ratio = 0.00 #erzwingt Kanten - hält dadurch an alter Umgebung fest - schlecht bei Umgebungswechsel
|
| 1266 |
+
|
| 1267 |
+
conditioning_scale = [
|
| 1268 |
+
controlnet_strength * depth_ratio, # Depth-Gewichtung
|
| 1269 |
+
controlnet_strength * canny_ratio # Canny-Gewichtung
|
| 1270 |
+
]
|
| 1271 |
+
|
| 1272 |
print("🌳 Naturszene erkannt → Ratio 95:5 (Depth:Canny)")
|
| 1273 |
else:
|
| 1274 |
print("🎯 Standard-Ratio 90:10 (Depth:Canny)")
|
| 1275 |
|
| 1276 |
+
# 4. CONDITIONING SCALE BERECHNEN
|
| 1277 |
+
conditioning_scale = [
|
| 1278 |
+
controlnet_strength * depth_ratio, # Depth-Gewichtung
|
| 1279 |
+
controlnet_strength * canny_ratio # Canny-Gewichtung
|
| 1280 |
+
]
|
| 1281 |
|
| 1282 |
print(f"🎯 OPTIMIERTER MODUS: Umgebung ändern")
|
| 1283 |
print(f" Strength: {adj_strength}, ControlNet: {controlnet_strength}")
|