From c96f1a2025555e30d4d94a70a775b4d010730252 Mon Sep 17 00:00:00 2001 From: Ernie Chu <51432514+ernestchu@users.noreply.github.com> Date: Sun, 9 Apr 2023 23:43:34 +0800 Subject: [PATCH 1/3] Fix a bug of pano when not doing CFG --- .../stable_diffusion/pipeline_stable_diffusion_panorama.py | 2 +- 1 file changed, 1 insertion(+), 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 c47423bdee5b..d76e2082437c 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,7 @@ def __call__( 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 From 52b34ae15e4309b82d551309c74032d775d9a6eb Mon Sep 17 00:00:00 2001 From: Ernie Chu <51432514+ernestchu@users.noreply.github.com> Date: Wed, 12 Apr 2023 13:58:25 +0800 Subject: [PATCH 2/3] enhance code quality --- .../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 444c33c85c53..782ca5b4ccc6 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 @@ def __call__( 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_for_view + 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 From 5997e5fe59db5c867b3bccfeb46926acb2a5606a Mon Sep 17 00:00:00 2001 From: Sayak Paul Date: Wed, 12 Apr 2023 16:39:31 +0530 Subject: [PATCH 3/3] apply formatting. --- .../stable_diffusion/pipeline_stable_diffusion_panorama.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 782ca5b4ccc6..392b2a72a76f 100644 --- a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py +++ b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py @@ -625,9 +625,9 @@ def __call__( 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_for_view) + 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