From 723ff10187770ecbd4ed42712c07e21656bc4c73 Mon Sep 17 00:00:00 2001 From: tazlin Date: Sun, 1 Oct 2023 08:38:25 -0400 Subject: [PATCH] feat: detect no seed --- horde_worker_regen/process_management/process_manager.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/horde_worker_regen/process_management/process_manager.py b/horde_worker_regen/process_management/process_manager.py index 730b66a2..cb279de1 100644 --- a/horde_worker_regen/process_management/process_manager.py +++ b/horde_worker_regen/process_management/process_manager.py @@ -1,6 +1,7 @@ import asyncio import base64 import multiprocessing +import random import time from asyncio import Lock as Lock_Asyncio from collections import deque @@ -1100,6 +1101,12 @@ async def api_job_pop(self) -> None: logger.info(f"Popped job {job_pop_response.id_} (model: {job_pop_response.model})") + if job_pop_response.payload.seed is None: + logger.warning(f"Job {job_pop_response.id_} has no seed!") + new_response_dict = job_pop_response.model_dump() + new_response_dict["payload"]["seed"] = random.randint(0, (2**32) - 1) + job_pop_response = ImageGenerateJobPopResponse(**new_response_dict) + async with self._job_deque_lock: self.job_deque.append(job_pop_response) self._testing_jobs_added += 1