1
0
Fork 0

fix(api): make pix2pix work with scheduler with float sigma

This commit is contained in:
Sean Sube 2023-04-12 23:44:08 -05:00
parent eb428e9541
commit 982dc10e64
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 6 additions and 1 deletions

View File

@ -323,7 +323,12 @@ class OnnxStableDiffusionInstructPix2PixPipeline(DiffusionPipeline):
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]