Astridkraft commited on
Commit
1395dc0
·
verified ·
1 Parent(s): 49c9c3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -1478,7 +1478,14 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
1478
  controlnet_strength = 0.45 - (t_cn * 0.35) # 20% → 5%
1479
 
1480
  depth_ratio = 0.85 - (ui_strength * 0.15)
1481
- canny_ratio = 1.0 - depth_ratio
 
 
 
 
 
 
 
1482
 
1483
  print(f" 👤 LATE-START GESICHT:")
1484
  print(f" UI={ui_strength:.2f}, t={t:.3f}")
@@ -1496,6 +1503,12 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
1496
  else:
1497
  boost_factor = (ui_strength - 0.7) / 0.2
1498
  controlnet_strength = 0.5 + (0.35 * boost_factor) # 50% → 85%
 
 
 
 
 
 
1499
 
1500
  print(f" 💇 NORMAL-START HINTERKOPF:")
1501
  print(f" UI={ui_strength:.2f}, t={t:.3f}")
 
1478
  controlnet_strength = 0.45 - (t_cn * 0.35) # 20% → 5%
1479
 
1480
  depth_ratio = 0.85 - (ui_strength * 0.15)
1481
+ canny_ratio = 1.0 - depth_ratio
1482
+
1483
+
1484
+ #Clipping:
1485
+ adj_strength = max(0.25, min(adj_strength, 0.95)) # 25-95%
1486
+ controlnet_strength = max(0.15, min(controlnet_strength, 0.85)) # 15-85%
1487
+ depth_ratio = max(0.5, min(depth_ratio, 0.95)) # 50-95%
1488
+ canny_ratio = max(0.05, min(canny_ratio, 0.40)) # 5-40%
1489
 
1490
  print(f" 👤 LATE-START GESICHT:")
1491
  print(f" UI={ui_strength:.2f}, t={t:.3f}")
 
1503
  else:
1504
  boost_factor = (ui_strength - 0.7) / 0.2
1505
  controlnet_strength = 0.5 + (0.35 * boost_factor) # 50% → 85%
1506
+
1507
+ #Clipping:
1508
+ adj_strength = max(0.20, min(adj_strength, 0.90)) # 20-90%
1509
+ controlnet_strength = max(0.30, min(controlnet_strength, 0.90)) # 30-90%
1510
+ depth_ratio = max(0.4, min(depth_ratio, 0.85)) # 40-85%
1511
+ canny_ratio = max(0.15, min(canny_ratio, 0.60)) # 15-60%
1512
 
1513
  print(f" 💇 NORMAL-START HINTERKOPF:")
1514
  print(f" UI={ui_strength:.2f}, t={t:.3f}")