Skip to content

Commit

Permalink
fix: Handle transparent heavy in parallelization
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 committed Jul 25, 2024
1 parent 8b2baf0 commit fe71fbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion horde/classes/stable/waiting_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions horde/classes/stable/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fe71fbf

Please sign in to comment.