From c09bb588d39bfdfe6614a43698297418dbf46d77 Mon Sep 17 00:00:00 2001 From: caiyueliang <393900414@qq.com> Date: Sat, 24 Feb 2024 08:59:02 +0800 Subject: [PATCH] fix: TensorRTStableDiffusionPipeline cannot set guidance_scale (#7065) --- examples/community/stable_diffusion_tensorrt_inpaint.py | 2 +- examples/community/stable_diffusion_tensorrt_txt2img.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/community/stable_diffusion_tensorrt_inpaint.py b/examples/community/stable_diffusion_tensorrt_inpaint.py index 0c97b23fc5fd..9ace697cc7a6 100755 --- a/examples/community/stable_diffusion_tensorrt_inpaint.py +++ b/examples/community/stable_diffusion_tensorrt_inpaint.py @@ -1011,7 +1011,7 @@ def __call__( """ self.generator = generator self.denoising_steps = num_inference_steps - self.guidance_scale = guidance_scale + self._guidance_scale = guidance_scale # Pre-compute latent input scales and linear multistep coefficients self.scheduler.set_timesteps(self.denoising_steps, device=self.torch_device) diff --git a/examples/community/stable_diffusion_tensorrt_txt2img.py b/examples/community/stable_diffusion_tensorrt_txt2img.py index 548dad984b6d..54661d66a2eb 100755 --- a/examples/community/stable_diffusion_tensorrt_txt2img.py +++ b/examples/community/stable_diffusion_tensorrt_txt2img.py @@ -882,7 +882,7 @@ def __call__( """ self.generator = generator self.denoising_steps = num_inference_steps - self.guidance_scale = guidance_scale + self._guidance_scale = guidance_scale # Pre-compute latent input scales and linear multistep coefficients self.scheduler.set_timesteps(self.denoising_steps, device=self.torch_device)