Skip to content

Commit d8c6683

Browse files
committed
1 parent 10bc3bf commit d8c6683

File tree

3 files changed

+3
-32
lines changed

3 files changed

+3
-32
lines changed

src/diffusers/models/controlnets/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
SparseControlNetModel,
1616
SparseControlNetOutput,
1717
)
18-
from .controlnet_union import ControlNetUnionInput, ControlNetUnionInputProMax, ControlNetUnionModel
18+
from .controlnet_union import ControlNetUnionModel
1919
from .controlnet_xs import ControlNetXSAdapter, ControlNetXSOutput, UNetControlNetXSModel
2020
from .multicontrolnet import MultiControlNetModel
2121

src/diffusers/pipelines/controlnet/pipeline_controlnet_union_sd_xl.py

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
AttnProcessor2_0,
4444
XFormersAttnProcessor,
4545
)
46-
from ...models.controlnets import ControlNetUnionInput, ControlNetUnionInputProMax
4746
from ...models.lora import adjust_lora_scale_text_encoder
4847
from ...schedulers import KarrasDiffusionSchedulers
4948
from ...utils import (
@@ -786,26 +785,6 @@ def check_inputs(
786785
f"`ip_adapter_image_embeds` has to be a list of 3D or 4D tensors but is {ip_adapter_image_embeds[0].ndim}D"
787786
)
788787

789-
def check_input(
790-
self,
791-
image: Union[ControlNetUnionInput, ControlNetUnionInputProMax],
792-
):
793-
controlnet = self.controlnet._orig_mod if is_compiled_module(self.controlnet) else self.controlnet
794-
795-
if not isinstance(image, (ControlNetUnionInput, ControlNetUnionInputProMax)):
796-
raise ValueError(
797-
"Expected type of `image` to be one of `ControlNetUnionInput` or `ControlNetUnionInputProMax`"
798-
)
799-
if len(image) != controlnet.config.num_control_type:
800-
if isinstance(image, ControlNetUnionInput):
801-
raise ValueError(
802-
f"Expected num_control_type {controlnet.config.num_control_type}, got {len(image)}. Try `ControlNetUnionInputProMax`."
803-
)
804-
elif isinstance(image, ControlNetUnionInputProMax):
805-
raise ValueError(
806-
f"Expected num_control_type {controlnet.config.num_control_type}, got {len(image)}. Try `ControlNetUnionInput`."
807-
)
808-
809788
# Copied from diffusers.pipelines.controlnet.pipeline_controlnet.StableDiffusionControlNetPipeline.prepare_image
810789
def prepare_image(
811790
self,
@@ -1014,10 +993,7 @@ def __call__(
1014993
prompt_2 (`str` or `List[str]`, *optional*):
1015994
The prompt or prompts to be sent to `tokenizer_2` and `text_encoder_2`. If not defined, `prompt` is
1016995
used in both text-encoders.
1017-
image (`Union[ControlNetUnionInput, ControlNetUnionInputProMax]`):
1018-
In turn this supports (`torch.FloatTensor`, `PIL.Image.Image`, `np.ndarray`, `List[torch.FloatTensor]`,
1019-
`List[PIL.Image.Image]`, `List[np.ndarray]`, `List[List[torch.FloatTensor]]`,
1020-
`List[List[np.ndarray]]` or `List[List[PIL.Image.Image]]`):
996+
control_image (`PipelineImageInput`):
1021997
The ControlNet input condition to provide guidance to the `unet` for generation. If the type is
1022998
specified as `torch.Tensor`, it is passed to ControlNet as is. `PIL.Image.Image` can also be accepted
1023999
as an image. The dimensions of the output image defaults to `image`'s dimensions. If height and/or
@@ -1164,8 +1140,6 @@ def __call__(
11641140

11651141
controlnet = self.controlnet._orig_mod if is_compiled_module(self.controlnet) else self.controlnet
11661142

1167-
self.check_input(control_image)
1168-
11691143
# align format for control guidance
11701144
if not isinstance(control_guidance_start, list) and isinstance(control_guidance_end, list):
11711145
control_guidance_start = len(control_guidance_end) * [control_guidance_start]

src/diffusers/pipelines/controlnet/pipeline_controlnet_union_sd_xl_img2img.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,10 +1116,7 @@ def __call__(
11161116
`List[List[torch.Tensor]]`, `List[List[np.ndarray]]` or `List[List[PIL.Image.Image]]`):
11171117
The initial image will be used as the starting point for the image generation process. Can also accept
11181118
image latents as `image`, if passing latents directly, it will not be encoded again.
1119-
control_image_list (`Union[ControlNetUnionInput, ControlNetUnionInputProMax]`):
1120-
In turn this supports (`torch.FloatTensor`, `PIL.Image.Image`, `np.ndarray`, `List[torch.FloatTensor]`,
1121-
`List[PIL.Image.Image]`, `List[np.ndarray]`, `List[List[torch.FloatTensor]]`,
1122-
`List[List[np.ndarray]]` or `List[List[PIL.Image.Image]]`)::
1119+
control_image (`PipelineImageInput`):
11231120
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
11241121
the type is specified as `torch.Tensor`, it is passed to ControlNet as is. `PIL.Image.Image` can also
11251122
be accepted as an image. The dimensions of the output image defaults to `image`'s dimensions. If height

0 commit comments

Comments
 (0)