1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-29 07:22:12 +03:00

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 <spsayakpaul@gmail.com>
This commit is contained in:
Ernie Chu
2023-04-12 21:20:25 +08:00
committed by GitHub
parent caa5884e8a
commit a43934371a

View File

@@ -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