Check noise and latents shapes, more informative error

This commit is contained in:
Sergey Borisov 2023-08-31 04:07:17 +03:00 committed by Kent Keirsey
parent 8e470f9b6f
commit e085eb63bd

View File

@ -445,8 +445,14 @@ class DenoiseLatentsInvocation(BaseInvocation):
latents = context.services.latents.get(self.latents.latents_name)
if seed is None:
seed = self.latents.seed
else:
if noise is not None and noise.shape[1:] != latents.shape[1:]:
raise Exception(f"Incompatable 'noise' and 'latents' shapes: {latents.shape=} {noise.shape=}")
elif noise is not None:
latents = torch.zeros_like(noise)
else:
raise Exception("'latents' or 'noise' must be provided!")
if seed is None:
seed = 0