Astridkraft commited on
Commit
9aab865
·
verified ·
1 Parent(s): f0a1f51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -1471,16 +1471,20 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
1471
  adj_strength = 0.30 + 0.60 * t
1472
 
1473
  # DEPTH/CANNY: Später Anstieg, starke Anime-Stilisierung
1474
- if ui_strength <= 0.75:
1475
  controlnet_strength = 0.45
 
 
1476
  elif ui_strength <= 0.85:
1477
  controlnet_strength = 0.37
 
 
1478
  else:
1479
- controlnet_strength = 0.32
 
1480
 
1481
- depth_ratio = 0.85 - (ui_strength * 0.12)
1482
- canny_ratio = 1.0 - depth_ratio
1483
-
1484
 
1485
  #Clipping:
1486
  adj_strength = max(0.30, min(adj_strength, 0.95)) # 25-95%
@@ -1506,7 +1510,7 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
1506
  controlnet_strength = 0.5 + (0.35 * boost_factor) # 50% → 85%
1507
 
1508
  #Clipping:
1509
- adj_strength = max(0.20, min(adj_strength, 0.90)) # 20-90%
1510
  controlnet_strength = max(0.30, min(controlnet_strength, 0.90)) # 30-90%
1511
  depth_ratio = max(0.4, min(depth_ratio, 0.85)) # 40-85%
1512
  canny_ratio = max(0.15, min(canny_ratio, 0.60)) # 15-60%
 
1471
  adj_strength = 0.30 + 0.60 * t
1472
 
1473
  # DEPTH/CANNY: Später Anstieg, starke Anime-Stilisierung
1474
+ if ui_strength <= 0.65:
1475
  controlnet_strength = 0.45
1476
+ canny_ratio = 0.35
1477
+
1478
  elif ui_strength <= 0.85:
1479
  controlnet_strength = 0.37
1480
+ canny_ratio = 0.20
1481
+
1482
  else:
1483
+ controlnet_strength = 0.30
1484
+ canny_ratio = 0.10
1485
 
1486
+ depth_ratio = 1.0 - canny_ratio
1487
+
 
1488
 
1489
  #Clipping:
1490
  adj_strength = max(0.30, min(adj_strength, 0.95)) # 25-95%
 
1510
  controlnet_strength = 0.5 + (0.35 * boost_factor) # 50% → 85%
1511
 
1512
  #Clipping:
1513
+ adj_strength = max(0.35, min(adj_strength, 0.95)) # 20-90%
1514
  controlnet_strength = max(0.30, min(controlnet_strength, 0.90)) # 30-90%
1515
  depth_ratio = max(0.4, min(depth_ratio, 0.85)) # 40-85%
1516
  canny_ratio = max(0.15, min(canny_ratio, 0.60)) # 15-60%