Skip to content

Commit 0173657

Browse files
Fix/Enable all schedulers for in-painting (huggingface#1331)
* inpaint fix k lms * onnox as well * up
1 parent f105878 commit 0173657

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,8 @@ def __call__(
408408
# expand the latents if we are doing classifier free guidance
409409
latent_model_input = np.concatenate([latents] * 2) if do_classifier_free_guidance else latents
410410
# concat latents, mask, masked_image_latnets in the channel dimension
411-
latent_model_input = np.concatenate([latent_model_input, mask, masked_image_latents], axis=1)
412411
latent_model_input = self.scheduler.scale_model_input(torch.from_numpy(latent_model_input), t)
412+
latent_model_input = np.concatenate([latent_model_input, mask, masked_image_latents], axis=1)
413413
latent_model_input = latent_model_input.cpu().numpy()
414414

415415
# predict the noise residual

pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,8 @@ def __call__(
586586
latent_model_input = torch.cat([latents] * 2) if do_classifier_free_guidance else latents
587587

588588
# concat latents, mask, masked_image_latents in the channel dimension
589-
latent_model_input = torch.cat([latent_model_input, mask, masked_image_latents], dim=1)
590-
591589
latent_model_input = self.scheduler.scale_model_input(latent_model_input, t)
590+
latent_model_input = torch.cat([latent_model_input, mask, masked_image_latents], dim=1)
592591

593592
# predict the noise residual
594593
noise_pred = self.unet(latent_model_input, t, encoder_hidden_states=text_embeddings).sample

0 commit comments

Comments
 (0)