Update app.py
Browse files
app.py
CHANGED
|
@@ -1018,11 +1018,14 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
|
|
| 1018 |
if mode == "focus_change":
|
| 1019 |
keep_environment = False
|
| 1020 |
|
| 1021 |
-
# 1.
|
|
|
|
| 1022 |
adj_strength = min(0.6, strength)
|
| 1023 |
|
| 1024 |
-
# 2. CONTROLNET-STÄRKE
|
| 1025 |
-
|
|
|
|
|
|
|
| 1026 |
|
| 1027 |
# 3. DYNAMISCHE POSE:CANNY RATIO BASIEREND AUF PROMPT
|
| 1028 |
prompt_lower = prompt.lower()
|
|
@@ -1055,14 +1058,14 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
|
|
| 1055 |
|
| 1056 |
# Anpassung für Humanoid → Humanoid
|
| 1057 |
if any(keyword in prompt_lower for keyword in humanoid_keywords):
|
| 1058 |
-
pose_ratio = 0.95 #
|
| 1059 |
-
canny_ratio = 0.05
|
| 1060 |
print("👤 Humanoid → Humanoid → Ratio 85:15 (Pose:Canny)")
|
| 1061 |
|
| 1062 |
# Anpassung für Gegenstand → Gegenstand
|
| 1063 |
elif any(keyword in prompt_lower for keyword in object_keywords):
|
| 1064 |
-
pose_ratio = 0.10 #
|
| 1065 |
-
canny_ratio = 0.90
|
| 1066 |
adj_strength = min(0.7, strength * 1.15) # Stärkere Transformation
|
| 1067 |
print("📦 Gegenstand → Gegenstand → Ratio 25:75 (Pose:Canny)")
|
| 1068 |
|
|
|
|
| 1018 |
if mode == "focus_change":
|
| 1019 |
keep_environment = False
|
| 1020 |
|
| 1021 |
+
# 1. adj_strength ist die Denoising-Stärke.0.1-0.3: Leichte Veränderung (behält Original)
|
| 1022 |
+
# 0.4-0.6: Mittlere Veränderung, 0.7-0.9: Starke Veränderung
|
| 1023 |
adj_strength = min(0.6, strength)
|
| 1024 |
|
| 1025 |
+
# 2. CONTROLNET-STÄRKE=Anteil der Controlnet-Kontrolle die an Inpaint weitergegeben werden soll
|
| 1026 |
+
# 0.3-0.5: Wenig Kontrolle → Inpaint hat mehr Freiheit, 0.6-0.8: Mittlere Kontrolle → Balance
|
| 1027 |
+
# 0.9: Starke Kontrolle → Inpaint folgt streng ControlNet
|
| 1028 |
+
controlnet_strength = 0.5 # Stärkere ControlNet-Kontrolle für Inpaint
|
| 1029 |
|
| 1030 |
# 3. DYNAMISCHE POSE:CANNY RATIO BASIEREND AUF PROMPT
|
| 1031 |
prompt_lower = prompt.lower()
|
|
|
|
| 1058 |
|
| 1059 |
# Anpassung für Humanoid → Humanoid
|
| 1060 |
if any(keyword in prompt_lower for keyword in humanoid_keywords):
|
| 1061 |
+
pose_ratio = 0.95 # 95% Pose
|
| 1062 |
+
canny_ratio = 0.05 # 5% Canny
|
| 1063 |
print("👤 Humanoid → Humanoid → Ratio 85:15 (Pose:Canny)")
|
| 1064 |
|
| 1065 |
# Anpassung für Gegenstand → Gegenstand
|
| 1066 |
elif any(keyword in prompt_lower for keyword in object_keywords):
|
| 1067 |
+
pose_ratio = 0.10 # 10% Pose
|
| 1068 |
+
canny_ratio = 0.90 # 90% Canny
|
| 1069 |
adj_strength = min(0.7, strength * 1.15) # Stärkere Transformation
|
| 1070 |
print("📦 Gegenstand → Gegenstand → Ratio 25:75 (Pose:Canny)")
|
| 1071 |
|