Skip to content

Commit ea7f344

Browse files
committed
make
1 parent c76d50c commit ea7f344

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,8 +908,16 @@ def __call__(
908908

909909
# 0. Default height and width to unet
910910
if not height or not width:
911-
height = self.unet.config.sample_size if self._is_unet_config_sample_size_int else self.unet.config.sample_size[0]
912-
width = self.unet.config.sample_size if self._is_unet_config_sample_size_int else self.unet.config.sample_size[1]
911+
height = (
912+
self.unet.config.sample_size
913+
if self._is_unet_config_sample_size_int
914+
else self.unet.config.sample_size[0]
915+
)
916+
width = (
917+
self.unet.config.sample_size
918+
if self._is_unet_config_sample_size_int
919+
else self.unet.config.sample_size[1]
920+
)
913921
height, width = height * self.vae_scale_factor, width * self.vae_scale_factor
914922
# to deal with lora scaling and other possible forward hooks
915923

tests/pipelines/stable_diffusion/test_stable_diffusion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ def callback_on_step_end(pipe, i, t, callback_kwargs):
839839
# compare the intermediate latent to the output of the interrupted process
840840
# they should be the same
841841
assert torch.allclose(intermediate_latent, output_interrupted, atol=1e-4)
842-
842+
843843
def test_pipeline_accept_tuple_type_unet_sample_size(self):
844844
# the purpose of this test is to see whether the pipeline would accept a unet with the tuple-typed sample size
845845
sd_repo_id = "stable-diffusion-v1-5/stable-diffusion-v1-5"

0 commit comments

Comments
 (0)