Update app.py
Browse files
app.py
CHANGED
|
@@ -1455,51 +1455,30 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
|
|
| 1455 |
adj_strength = 0.30 + 0.55 * smoothstep(0.35, 0.9, ui_strength)
|
| 1456 |
adj_strength = max(0.3, min(adj_strength, 0.85))
|
| 1457 |
|
| 1458 |
-
|
| 1459 |
-
|
| 1460 |
-
|
| 1461 |
-
|
| 1462 |
-
|
| 1463 |
-
|
| 1464 |
-
|
| 1465 |
-
|
| 1466 |
-
|
| 1467 |
|
| 1468 |
-
|
| 1469 |
-
|
| 1470 |
-
|
| 1471 |
-
|
| 1472 |
-
|
| 1473 |
-
|
| 1474 |
-
|
| 1475 |
-
|
| 1476 |
-
|
| 1477 |
|
| 1478 |
-
|
| 1479 |
-
|
| 1480 |
-
|
| 1481 |
-
|
| 1482 |
-
|
| 1483 |
-
|
| 1484 |
-
|
| 1485 |
-
|
| 1486 |
-
|
| 1487 |
-
|
| 1488 |
-
|
| 1489 |
-
|
| 1490 |
-
|
| 1491 |
-
|
| 1492 |
-
|
| 1493 |
-
|
| 1494 |
-
|
| 1495 |
-
|
| 1496 |
-
|
| 1497 |
-
|
| 1498 |
-
|
| 1499 |
-
|
| 1500 |
-
|
| 1501 |
-
|
| 1502 |
-
|
| 1503 |
|
| 1504 |
print(f"UI Strength: {ui_strength}")
|
| 1505 |
print(f"adj_strength: {adj_strength:.3f}")
|
|
|
|
| 1455 |
adj_strength = 0.30 + 0.55 * smoothstep(0.35, 0.9, ui_strength)
|
| 1456 |
adj_strength = max(0.3, min(adj_strength, 0.85))
|
| 1457 |
|
| 1458 |
+
controlnet_strength = 0.30 + 0.52 * smoothstep(0.65, 0.9, ui_strength)
|
| 1459 |
+
controlnet_strength = max(0.25, min(controlnet_strength, 0.85))
|
| 1460 |
+
|
| 1461 |
+
# ANPASSUNG BASIEREND AUF GESICHT/HINTERKOPF
|
| 1462 |
+
if is_front_face:
|
| 1463 |
+
# Anime-GESICHT vorne
|
| 1464 |
+
depth_ratio = 0.65 + 0.15 * smoothstep(0.5, 0.9, ui_strength) # Höher für Gesichtsstruktur
|
| 1465 |
+
canny_ratio = 1.0 - depth_ratio
|
| 1466 |
+
print(" 👤 Anime-Gesicht (vorne): Mehr Depth für 3D-Struktur")
|
| 1467 |
|
| 1468 |
+
elif is_back_head:
|
| 1469 |
+
# Anime-HINTERKOPF
|
| 1470 |
+
depth_ratio = 0.35 + 0.15 * smoothstep(0.5, 0.9, ui_strength) # Niedriger
|
| 1471 |
+
canny_ratio = 1.0 - depth_ratio
|
| 1472 |
+
print(" 💇 Anime-Hinterkopf: Mehr Canny für Haarkontur")
|
| 1473 |
+
else:
|
| 1474 |
+
# Standard-Anime (Fallback)
|
| 1475 |
+
depth_ratio = 0.55 + 0.15 * smoothstep(0.5, 0.9, ui_strength)
|
| 1476 |
+
canny_ratio = 1.0 - depth_ratio
|
| 1477 |
|
| 1478 |
+
conditioning_scale = [
|
| 1479 |
+
controlnet_strength * depth_ratio,
|
| 1480 |
+
controlnet_strength * canny_ratio
|
| 1481 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1482 |
|
| 1483 |
print(f"UI Strength: {ui_strength}")
|
| 1484 |
print(f"adj_strength: {adj_strength:.3f}")
|