Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/diffusers/pipelines/controlnet/pipeline_controlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ def check_image(self, image, prompt, prompt_embeds):
and not image_is_np_list
):
raise TypeError(
"image must be passed and be one of PIL image, numpy array, torch tensor, list of PIL images, list of numpy arrays or list of torch tensors"
f"image must be passed and be one of PIL image, numpy array, torch tensor, list of PIL images, list of numpy arrays or list of torch tensors, but is {type(image)}"
)

if image_is_pil:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def check_image(self, image, prompt, prompt_embeds):
and not image_is_np_list
):
raise TypeError(
"image must be passed and be one of PIL image, numpy array, torch tensor, list of PIL images, list of numpy arrays or list of torch tensors"
f"image must be passed and be one of PIL image, numpy array, torch tensor, list of PIL images, list of numpy arrays or list of torch tensors, but is {type(image)}"
)

if image_is_pil:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ def check_image(self, image, prompt, prompt_embeds):
and not image_is_np_list
):
raise TypeError(
"image must be passed and be one of PIL image, numpy array, torch tensor, list of PIL images, list of numpy arrays or list of torch tensors"
f"image must be passed and be one of PIL image, numpy array, torch tensor, list of PIL images, list of numpy arrays or list of torch tensors, but is {type(image)}"
)

if image_is_pil:
Expand Down Expand Up @@ -1306,7 +1306,10 @@ def __call__(
init_mask = mask[:1]

if i < len(timesteps) - 1:
init_latents_proper = self.scheduler.add_noise(init_latents_proper, noise, torch.tensor([t]))
noise_timestep = timesteps[i + 1]
init_latents_proper = self.scheduler.add_noise(
init_latents_proper, noise, torch.tensor([noise_timestep])
)

latents = (1 - init_mask) * init_latents_proper + init_mask * latents

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,10 @@ def __call__(
init_mask = mask[:1]

if i < len(timesteps) - 1:
init_latents_proper = self.scheduler.add_noise(init_latents_proper, noise, torch.tensor([t]))
noise_timestep = timesteps[i + 1]
init_latents_proper = self.scheduler.add_noise(
init_latents_proper, noise, torch.tensor([noise_timestep])
)

latents = (1 - init_mask) * init_latents_proper + init_mask * latents

Expand Down