Skip to content

Commit

Permalink
fix(api): make pix2pix work with scheduler with float sigma
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Apr 13, 2023
1 parent eb428e9 commit 982dc10
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/onnx_web/diffusers/pipelines/pix2pix.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,12 @@ def __call__(
raise ValueError(
f"Unexpected latents shape, got {latents.shape}, expected {latents_shape}"
)
latents = latents * self.scheduler.init_noise_sigma.numpy()

init_noise_sigma = self.scheduler.init_noise_sigma
if torch.is_tensor(init_noise_sigma):
init_noise_sigma = init_noise_sigma.numpy()

latents = latents * init_noise_sigma

# 7. Check that shapes of latents and image match the UNet channels
num_channels_image = image_latents.shape[1]
Expand Down

0 comments on commit 982dc10

Please sign in to comment.