fix(api): make pix2pix work with scheduler with float sigma
This commit is contained in:
parent
eb428e9541
commit
982dc10e64
|
@ -323,7 +323,12 @@ class OnnxStableDiffusionInstructPix2PixPipeline(DiffusionPipeline):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Unexpected latents shape, got {latents.shape}, expected {latents_shape}"
|
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
|
# 7. Check that shapes of latents and image match the UNet channels
|
||||||
num_channels_image = image_latents.shape[1]
|
num_channels_image = image_latents.shape[1]
|
||||||
|
|
Loading…
Reference in New Issue