Added resizing of controlnet image based on noise latent. Fixes a tensor mismatch issue.

This commit is contained in:
user1 2023-05-06 13:10:56 -07:00 committed by Kent Keirsey
parent 18e6a2b410
commit a2a2cfa765
2 changed files with 1 additions and 1 deletions

View File

@ -328,7 +328,6 @@ class TextToLatentsInvocation(BaseInvocation):
latents_shape=noise.shape,
do_classifier_free_guidance=(self.cfg_scale >= 1.0))
# TODO: Verify the noise is the right size
result_latents, result_attention_map_saver = model.latents_from_embeddings(
latents=torch.zeros_like(noise, dtype=torch_dtype(model.device)),

View File

@ -1031,6 +1031,7 @@ class StableDiffusionGeneratorPipeline(StableDiffusionPipeline):
dtype=torch.float16,
do_classifier_free_guidance=True,
):
if not isinstance(image, torch.Tensor):
if isinstance(image, PIL.Image.Image):
image = [image]