Skip to content

Commit

Permalink
fix: None check for job.payload.loras
Browse files Browse the repository at this point in the history
  • Loading branch information
tazlin committed Jul 1, 2024
1 parent c3f8cc7 commit a230970
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions horde_worker_regen/process_management/process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,7 @@ def preload_models(self) -> bool:
if job.model is None:
raise ValueError(f"job.model is None ({job})")

if len(job.payload.loras) > 0:
if job.payload.loras is not None and len(job.payload.loras) > 0:
for p in self._process_map.values():
if (
p.loaded_horde_model_name == job.model
Expand Down Expand Up @@ -2833,7 +2833,9 @@ def get_single_job_effective_megapixelsteps(self, job: ImageGenerateJobPopRespon
# Each extra batched image increases our difficulty by 20%
batching_multiplier = 1 + ((job.payload.n_iter - 1) * 0.2)

lora_adjustment = 4 * 1_000_000 if len(job.payload.loras) > 0 else 0
lora_adjustment = 0
if job.payload.loras is not None:
lora_adjustment = 4 * 1_000_000 if len(job.payload.loras) > 0 else 0

hires_fix_adjustment = 0

Expand Down Expand Up @@ -3021,6 +3023,7 @@ async def _get_source_images(self, job_pop_response: ImageGenerateJobPopResponse

_last_pop_no_jobs_available: bool = False

@logger.catch(reraise=True)
async def api_job_pop(self) -> None:
"""If the job deque is not full, add any jobs that are available to the job deque."""
if self._shutting_down:
Expand Down

0 comments on commit a230970

Please sign in to comment.