Update app.py
Browse files
app.py
CHANGED
|
@@ -1048,10 +1048,10 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
|
|
| 1048 |
keep_environment = True
|
| 1049 |
|
| 1050 |
# 1. Denoising: starke Neugenerierung
|
| 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()
|
|
@@ -1061,8 +1061,8 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
|
|
| 1061 |
interior_keywords = ["office", "room", "interior", "kitchen", "bedroom", "living room", "indoor", "wall", "furniture"]
|
| 1062 |
|
| 1063 |
# Standard: Controlnet gesteuertes Inpainting wird genutzt wenn Prompt nicht eines der obigen keywords beinhaltet
|
| 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):
|
|
@@ -1072,8 +1072,8 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
|
|
| 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.
|
| 1077 |
print("🌳 Naturszene erkannt → Ratio 95:5 (Depth:Canny)")
|
| 1078 |
else:
|
| 1079 |
print("🎯 Standard-Ratio 90:10 (Depth:Canny)")
|
|
|
|
| 1048 |
keep_environment = True
|
| 1049 |
|
| 1050 |
# 1. Denoising: starke Neugenerierung
|
| 1051 |
+
adj_strength = 0.75 # Leicht runter auf Realismus
|
| 1052 |
|
| 1053 |
# 2. CONTROLNET-STÄRKE ERHÖHT
|
| 1054 |
+
controlnet_strength = 0.55 #Inpaint kann bei Neugenerierung nicht so viel Kontrolle vertragen
|
| 1055 |
|
| 1056 |
# 3. DYNAMISCHE DEPTH:CANNY RATIO BASIEREND AUF PROMPT
|
| 1057 |
prompt_lower = prompt.lower()
|
|
|
|
| 1061 |
interior_keywords = ["office", "room", "interior", "kitchen", "bedroom", "living room", "indoor", "wall", "furniture"]
|
| 1062 |
|
| 1063 |
# Standard: Controlnet gesteuertes Inpainting wird genutzt wenn Prompt nicht eines der obigen keywords beinhaltet
|
| 1064 |
+
depth_ratio = 0.50 # 35%
|
| 1065 |
+
canny_ratio = 0.12 # 10%
|
| 1066 |
|
| 1067 |
# Anpassung für Innenräume (mehr Kantenerhalt)
|
| 1068 |
if any(keyword in prompt_lower for keyword in interior_keywords):
|
|
|
|
| 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.50
|
| 1076 |
+
canny_ratio = 0.12
|
| 1077 |
print("🌳 Naturszene erkannt → Ratio 95:5 (Depth:Canny)")
|
| 1078 |
else:
|
| 1079 |
print("🎯 Standard-Ratio 90:10 (Depth:Canny)")
|