From a43934371aa7fcbe41c27b9bb5ef94f4c01829fd Mon Sep 17 00:00:00 2001 From: Ernie Chu <51432514+ernestchu@users.noreply.github.com> Date: Wed, 12 Apr 2023 21:20:25 +0800 Subject: [PATCH] Fix a bug of pano when not doing CFG (#3030) * Fix a bug of pano when not doing CFG * enhance code quality * apply formatting. --------- Co-authored-by: Sayak Paul --- .../stable_diffusion/pipeline_stable_diffusion_panorama.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py index d2d7330554..392b2a72a7 100644 --- a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py +++ b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py @@ -625,7 +625,9 @@ class StableDiffusionPanoramaPipeline(DiffusionPipeline, TextualInversionLoaderM latents_for_view = latents[:, :, h_start:h_end, w_start:w_end] # expand the latents if we are doing classifier free guidance - latent_model_input = torch.cat([latents_for_view] * 2) if do_classifier_free_guidance else latents + latent_model_input = ( + torch.cat([latents_for_view] * 2) if do_classifier_free_guidance else latents_for_view + ) latent_model_input = self.scheduler.scale_model_input(latent_model_input, t) # predict the noise residual