Don't fail if the prompt strength is too low

This commit is contained in:
cmdr2 2023-08-22 15:41:21 +05:30
parent 061380742c
commit 1fd011b1be

View File

@ -232,6 +232,9 @@ def generate_images_internal(
req.control_image = resize_img(req.control_image.convert("RGB"), req.width, req.height, clamp_to_8=True)
req.control_image = filter_images(context, req.control_image, task_data.control_filter_to_apply)[0]
if req.init_image is not None and int(req.num_inference_steps * req.prompt_strength) == 0:
req.prompt_strength = 1 / req.num_inference_steps if req.num_inference_steps > 0 else 1
if context.test_diffusers:
pipe = context.models["stable-diffusion"]["default"]
if hasattr(pipe.unet, "_allocate_trt_buffers_backup"):