From fe71fbfb86379360c2b7c66bb1f9f85d9dbf04c5 Mon Sep 17 00:00:00 2001 From: db0 Date: Thu, 25 Jul 2024 12:04:51 +0200 Subject: [PATCH] fix: Handle transparent heavy in parallelization --- horde/classes/stable/waiting_prompt.py | 4 +++- horde/classes/stable/worker.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/horde/classes/stable/waiting_prompt.py b/horde/classes/stable/waiting_prompt.py index b44563d0..d55ebb95 100644 --- a/horde/classes/stable/waiting_prompt.py +++ b/horde/classes/stable/waiting_prompt.py @@ -501,10 +501,12 @@ def extrapolate_dry_run_kudos(self): def get_amount_calculation_things(self): return self.width * self.height - def has_heavy_pp(self): + def has_heavy_operations(self): for pp in self.params.get("post_processing", []): if pp in HEAVY_POST_PROCESSORS: return True + if self.params.get("transparent", False): + return True return False def count_pp(self): diff --git a/horde/classes/stable/worker.py b/horde/classes/stable/worker.py index 41e50285..be68fce4 100644 --- a/horde/classes/stable/worker.py +++ b/horde/classes/stable/worker.py @@ -213,12 +213,12 @@ def get_bridge_kudos_multiplier(self): return 1 def get_safe_amount(self, amount, wp): - safe_generations = (self.max_pixels / 3) * amount + safe_generations = (self.max_pixels / 3.5) * amount mps = wp.get_amount_calculation_things() # If the job has upscalers, we increase the amount of MPS in our calculations # As currently the upscaling happens serially on the worker pp_multiplier = 1 + (wp.count_pp() * 0.4) - if wp.has_heavy_pp(): + if wp.has_heavy_operations(): pp_multiplier *= 1.8 mps *= pp_multiplier safe_amount = round(safe_generations / mps)