Update app.py
Browse files
app.py
CHANGED
|
@@ -1047,32 +1047,32 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
|
|
| 1047 |
elif mode == "environment_change":
|
| 1048 |
keep_environment = True
|
| 1049 |
|
| 1050 |
-
# 1.
|
| 1051 |
-
adj_strength = 0.
|
| 1052 |
|
| 1053 |
# 2. CONTROLNET-STÄRKE ERHÖHT
|
| 1054 |
-
controlnet_strength = 0.
|
| 1055 |
|
| 1056 |
# 3. DYNAMISCHE DEPTH:CANNY RATIO BASIEREND AUF PROMPT
|
| 1057 |
prompt_lower = prompt.lower()
|
| 1058 |
|
| 1059 |
# Heuristik für Naturszenen vs. Innenräume
|
| 1060 |
-
nature_keywords = ["beach", "forest", "mountain", "ocean", "sky", "field", "landscape", "nature", "outdoor"]
|
| 1061 |
interior_keywords = ["office", "room", "interior", "kitchen", "bedroom", "living room", "indoor", "wall", "furniture"]
|
| 1062 |
|
| 1063 |
-
# Standard: Controlnet gesteuertes Inpainting wird genutzt wenn
|
| 1064 |
-
depth_ratio = 0.
|
| 1065 |
-
canny_ratio = 0.
|
| 1066 |
|
| 1067 |
# Anpassung für Innenräume (mehr Kantenerhalt)
|
| 1068 |
if any(keyword in prompt_lower for keyword in interior_keywords):
|
| 1069 |
-
depth_ratio = 0.
|
| 1070 |
-
canny_ratio = 0.
|
| 1071 |
print("🏠 Innenraum erkannt → Ratio 80:20 (Depth:Canny)")
|
| 1072 |
|
| 1073 |
# Anpassung für Naturszenen (maximale Flexibilität)
|
| 1074 |
elif any(keyword in prompt_lower for keyword in nature_keywords):
|
| 1075 |
-
depth_ratio = 0.
|
| 1076 |
canny_ratio = 0.05
|
| 1077 |
print("🌳 Naturszene erkannt → Ratio 95:5 (Depth:Canny)")
|
| 1078 |
else:
|
|
|
|
| 1047 |
elif mode == "environment_change":
|
| 1048 |
keep_environment = True
|
| 1049 |
|
| 1050 |
+
# 1. Denoising: starke Neugenerierung
|
| 1051 |
+
adj_strength = 0.8 # Festwert statt Multiplikation
|
| 1052 |
|
| 1053 |
# 2. CONTROLNET-STÄRKE ERHÖHT
|
| 1054 |
+
controlnet_strength = 0.45 # Inpaint kann bei Neugenerierung nicht so viel Kontrolle vertragen
|
| 1055 |
|
| 1056 |
# 3. DYNAMISCHE DEPTH:CANNY RATIO BASIEREND AUF PROMPT
|
| 1057 |
prompt_lower = prompt.lower()
|
| 1058 |
|
| 1059 |
# Heuristik für Naturszenen vs. Innenräume
|
| 1060 |
+
nature_keywords = ["beach", "forest", "mountain", "ocean", "sky", "field", "landscape", "nature", "outdoor", "desert", "snow", "arctic"]
|
| 1061 |
interior_keywords = ["office", "room", "interior", "kitchen", "bedroom", "living room", "indoor", "wall", "furniture"]
|
| 1062 |
|
| 1063 |
+
# Standard: Controlnet gesteuertes Inpainting wird genutzt wenn im Prompt nicht eines der obigen keywords
|
| 1064 |
+
depth_ratio = 0.35
|
| 1065 |
+
canny_ratio = 0.10
|
| 1066 |
|
| 1067 |
# Anpassung für Innenräume (mehr Kantenerhalt)
|
| 1068 |
if any(keyword in prompt_lower for keyword in interior_keywords):
|
| 1069 |
+
depth_ratio = 0.55
|
| 1070 |
+
canny_ratio = 0.20
|
| 1071 |
print("🏠 Innenraum erkannt → Ratio 80:20 (Depth:Canny)")
|
| 1072 |
|
| 1073 |
# Anpassung für Naturszenen (maximale Flexibilität)
|
| 1074 |
elif any(keyword in prompt_lower for keyword in nature_keywords):
|
| 1075 |
+
depth_ratio = 0.30
|
| 1076 |
canny_ratio = 0.05
|
| 1077 |
print("🌳 Naturszene erkannt → Ratio 95:5 (Depth:Canny)")
|
| 1078 |
else:
|