Astridkraft commited on
Commit
bdb8d88
·
verified ·
1 Parent(s): b93f5ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1422,9 +1422,13 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
1422
  if any(keyword in prompt_lower for keyword in anime_keywords):
1423
  # Anime: Mehr Denoising für Stiländerungen
1424
  adj_strength = 0.55 + (ui_strength * 0.3) # 0.2-1.0
 
 
 
 
 
 
1425
 
1426
- # Anime: Weniger ControlNet insgesamt
1427
- controlnet_strength = 0.65 - (ui_strength * 0.3) # 0.7 → 0.2
1428
 
1429
  # Anime: Weniger Depth, mehr Canny
1430
  depth_ratio = 0.7 - (ui_strength * 0.2) # 0.6 → 0.3
@@ -1434,7 +1438,7 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale,
1434
  adj_strength = max(0.3, min(adj_strength, 0.85))
1435
  controlnet_strength = max(0.2, min(controlnet_strength, 0.7))
1436
  depth_ratio = max(0.4, min(depth_ratio, 0.8))
1437
- canny_ratio = max(0.05, min(canny_ratio, 0.3))
1438
 
1439
 
1440
  conditioning_scale = [
 
1422
  if any(keyword in prompt_lower for keyword in anime_keywords):
1423
  # Anime: Mehr Denoising für Stiländerungen
1424
  adj_strength = 0.55 + (ui_strength * 0.3) # 0.2-1.0
1425
+
1426
+
1427
+ if ui_strength > 0.6: # Bei radikalen Änderungen
1428
+ controlnet_strength = 0.3 + (ui_strength * 0.4) # 0.3 → 0.66
1429
+ else: # Bei milden Änderungen
1430
+ controlnet_strength = 0.65 - (ui_strength * 0.3) # 0.65 → 0.35
1431
 
 
 
1432
 
1433
  # Anime: Weniger Depth, mehr Canny
1434
  depth_ratio = 0.7 - (ui_strength * 0.2) # 0.6 → 0.3
 
1438
  adj_strength = max(0.3, min(adj_strength, 0.85))
1439
  controlnet_strength = max(0.2, min(controlnet_strength, 0.7))
1440
  depth_ratio = max(0.4, min(depth_ratio, 0.8))
1441
+ canny_ratio = max(0.05, min(canny_ratio, 0.15))
1442
 
1443
 
1444
  conditioning_scale = [