Skip to content

Commit 0c71189

Browse files
authored
Allow SD pipeline to use newer schedulers, eg: FlowMatch (#12015)
Allow SD pipeline to use newer schedulers, eg: FlowMatch, by skipping attribute that doesnt exist there (scale_model_input) Lines starting
1 parent 58d2b10 commit 0c71189

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,8 @@ def __call__(
10341034

10351035
# expand the latents if we are doing classifier free guidance
10361036
latent_model_input = torch.cat([latents] * 2) if self.do_classifier_free_guidance else latents
1037-
latent_model_input = self.scheduler.scale_model_input(latent_model_input, t)
1037+
if hasattr(self.scheduler, "scale_model_input"):
1038+
latent_model_input = self.scheduler.scale_model_input(latent_model_input, t)
10381039

10391040
# predict the noise residual
10401041
noise_pred = self.unet(

0 commit comments

Comments
 (0)