Skip to content

Commit

Permalink
fix: set denoise to None if no source_image
Browse files Browse the repository at this point in the history
  • Loading branch information
tazlin committed Oct 1, 2023
1 parent be6053b commit e652c01
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions horde_worker_regen/process_management/process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,12 @@ async def api_job_pop(self) -> None:
new_response_dict["payload"]["seed"] = random.randint(0, (2**32) - 1)
job_pop_response = ImageGenerateJobPopResponse(**new_response_dict)

if job_pop_response.payload.denoising_strength is not None and job_pop_response.source_image is None:
logger.warning(f"Job {job_pop_response.id_} has denoising_strength but no source image!")
new_response_dict = job_pop_response.model_dump()
new_response_dict["payload"]["denoising_strength"] = None
job_pop_response = ImageGenerateJobPopResponse(**new_response_dict)

if job_pop_response.source_image is not None and "https://" in job_pop_response.source_image:
# Download and convert the source image to base64
fail_count = 0
Expand Down

0 comments on commit e652c01

Please sign in to comment.