diff --git a/examples/community/lpw_stable_diffusion_xl.py b/examples/community/lpw_stable_diffusion_xl.py index 479c76bbdc56..4b63fa7019a7 100644 --- a/examples/community/lpw_stable_diffusion_xl.py +++ b/examples/community/lpw_stable_diffusion_xl.py @@ -1766,7 +1766,7 @@ def __call__( # 4. Prepare timesteps def denoising_value_valid(dnv): - return isinstance(self.denoising_end, float) and 0 < dnv < 1 + return isinstance(dnv, float) and 0 < dnv < 1 timesteps, num_inference_steps = retrieve_timesteps(self.scheduler, num_inference_steps, device, timesteps) if image is not None: @@ -1774,7 +1774,7 @@ def denoising_value_valid(dnv): num_inference_steps, strength, device, - denoising_start=self.denoising_start if denoising_value_valid else None, + denoising_start=self.denoising_start if denoising_value_valid(self.denoising_start) else None, ) # check that number of inference steps is not < 1 - as this doesn't make sense diff --git a/examples/community/pipeline_sdxl_style_aligned.py b/examples/community/pipeline_sdxl_style_aligned.py index fa54b542c5ca..a9509346dae6 100644 --- a/examples/community/pipeline_sdxl_style_aligned.py +++ b/examples/community/pipeline_sdxl_style_aligned.py @@ -1769,7 +1769,7 @@ def __call__( # 4. Prepare timesteps def denoising_value_valid(dnv): - return isinstance(self.denoising_end, float) and 0 < dnv < 1 + return isinstance(dnv, float) and 0 < dnv < 1 timesteps, num_inference_steps = retrieve_timesteps(self.scheduler, num_inference_steps, device, timesteps) @@ -1778,7 +1778,7 @@ def denoising_value_valid(dnv): num_inference_steps, strength, device, - denoising_start=self.denoising_start if denoising_value_valid else None, + denoising_start=self.denoising_start if denoising_value_valid(self.denoising_start) else None, ) # check that number of inference steps is not < 1 - as this doesn't make sense diff --git a/examples/community/pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py b/examples/community/pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py index e2a5fec29faf..c7967bbc12a2 100644 --- a/examples/community/pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py +++ b/examples/community/pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py @@ -1563,14 +1563,14 @@ def __call__( # 4. set timesteps def denoising_value_valid(dnv): - return isinstance(denoising_end, float) and 0 < dnv < 1 + return isinstance(dnv, float) and 0 < dnv < 1 self.scheduler.set_timesteps(num_inference_steps, device=device) timesteps, num_inference_steps = self.get_timesteps( num_inference_steps, strength, device, - denoising_start=denoising_start if denoising_value_valid else None, + denoising_start=denoising_start if denoising_value_valid(denoising_start) else None, ) # check that number of inference steps is not < 1 - as this doesn't make sense if num_inference_steps < 1: diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py index 763e95d624cc..c4787eed62be 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py @@ -1477,11 +1477,14 @@ def __call__( # 4. set timesteps def denoising_value_valid(dnv): - return isinstance(denoising_end, float) and 0 < dnv < 1 + return isinstance(dnv, float) and 0 < dnv < 1 self.scheduler.set_timesteps(num_inference_steps, device=device) timesteps, num_inference_steps = self.get_timesteps( - num_inference_steps, strength, device, denoising_start=denoising_start if denoising_value_valid else None + num_inference_steps, + strength, + device, + denoising_start=denoising_start if denoising_value_valid(denoising_start) else None, ) # check that number of inference steps is not < 1 - as this doesn't make sense if num_inference_steps < 1: diff --git a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py index a6ed0768eb1b..2f9e6eb28f21 100644 --- a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py +++ b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py @@ -1315,14 +1315,14 @@ def __call__( # 5. Prepare timesteps def denoising_value_valid(dnv): - return isinstance(self.denoising_end, float) and 0 < dnv < 1 + return isinstance(dnv, float) and 0 < dnv < 1 timesteps, num_inference_steps = retrieve_timesteps(self.scheduler, num_inference_steps, device, timesteps) timesteps, num_inference_steps = self.get_timesteps( num_inference_steps, strength, device, - denoising_start=self.denoising_start if denoising_value_valid else None, + denoising_start=self.denoising_start if denoising_value_valid(self.denoising_start) else None, ) latent_timestep = timesteps[:1].repeat(batch_size * num_images_per_prompt) diff --git a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py index f44d53fffaba..3a0c494accd7 100644 --- a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py +++ b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py @@ -1581,14 +1581,14 @@ def __call__( # 4. set timesteps def denoising_value_valid(dnv): - return isinstance(self.denoising_end, float) and 0 < dnv < 1 + return isinstance(dnv, float) and 0 < dnv < 1 timesteps, num_inference_steps = retrieve_timesteps(self.scheduler, num_inference_steps, device, timesteps) timesteps, num_inference_steps = self.get_timesteps( num_inference_steps, strength, device, - denoising_start=self.denoising_start if denoising_value_valid else None, + denoising_start=self.denoising_start if denoising_value_valid(self.denoising_start) else None, ) # check that number of inference steps is not < 1 - as this doesn't make sense if num_inference_steps < 1: