Comfy-Org/ComfyUI · error · ValueError
The connected model patch is not a Uni3C ControlNet.
Error message
The connected model patch is not a Uni3C ControlNet.
What it means
The Uni3C ControlNet apply node requires the model_patch input to actually contain a comfy.ldm.wan.uni3c.WanUni3CControlnet instance. Any other loaded ControlNet/patch model type is rejected with isinstance before its controlnet_blocks are dereferenced.
Source
Thrown at comfy_extras/nodes_model_patch.py:727
@classmethod
def INPUT_TYPES(s):
return {"required": { "model": ("MODEL",),
"model_patch": ("MODEL_PATCH",),
"vae": ("VAE",),
"render_video": ("IMAGE", {"tooltip": "The guidance video rendered from the camera trajectory, most commonly warped point cloud renders of the input image."}),
"strength": ("FLOAT", {"default": 1.0, "min": -10.0, "max": 10.0, "step": 0.01}),
"start_percent": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1.0, "step": 0.001}),
"end_percent": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.001}),
}}
RETURN_TYPES = ("MODEL",)
FUNCTION = "apply_patch"
EXPERIMENTAL = True
CATEGORY = "model/patch/wan"
def apply_patch(self, model, model_patch, vae, render_video, strength, start_percent, end_percent):
if not isinstance(model_patch.model, comfy.ldm.wan.uni3c.WanUni3CControlnet):
raise ValueError("The connected model patch is not a Uni3C ControlNet.")
cnet_dim = model_patch.model.controlnet_blocks[0].norm1.linear.in_features
model_dim = getattr(model.get_model_object("diffusion_model"), "dim", None)
if model_dim is None:
raise ValueError("The Uni3C ControlNet only works with Wan models.")
if model_dim != cnet_dim:
raise ValueError("This Uni3C ControlNet expects a Wan model with dim {}, the loaded model has dim {}.".format(cnet_dim, model_dim))
model_patched = model.clone()
model_sampling = model.get_model_object("model_sampling")
sigma_start = model_sampling.percent_to_sigma(start_percent)
sigma_end = model_sampling.percent_to_sigma(end_percent)
latent_format = model.get_model_object("latent_format")
patch = WanUni3CCnetPatch(model_patch, render_video[:, :, :, :3], vae, latent_format, strength, sigma_start, sigma_end)
model_patched.set_model_double_block_patch(patch)
return (model_patched,)
class UsoStyleProjectorPatch:View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Load the Uni3C ControlNet with the loader node intended for it so model_patch.model is a WanUni3CControlnet.
- Verify in Python: isinstance(model_patch.model, comfy.ldm.wan.uni3c.WanUni3CControlnet).
- If you meant to use a different controlnet, use the generic 'Apply ControlNet' node instead of this Uni3C-specific one.
Defensive patterns
Strategy: type-guard
Validate before calling
import comfy.ldm.wan.uni3c as uni3c
if not isinstance(model_patch.model, uni3c.WanUni3CControlnet):
raise UserFacingError('load the Uni3C controlnet with its dedicated loader') Type guard
def is_uni3c_patch(model_patch) -> bool:
import comfy.ldm.wan.uni3c as uni3c
return isinstance(model_patch.model, uni3c.WanUni3CControlnet) Prevention
- Load Uni3C controlnets only through the matching loader node.
- Keep controlnet files separated by type in model folders.
- Use the generic Apply ControlNet node for non-Uni3C patches.
When it happens
Trigger: Loading a non-Uni3C ControlNet (standard Wan controlnet, T2I adapter, IP-adapter, etc.) through the patch loader and connecting it to this node's model_patch input.
Common situations: Reusing an existing controlnet-loading workflow where the loader is generic; selecting the wrong checkpoint from a folder of mixed control nets; a loader node that returns a wrapped/different patch class.
Related errors
- The Uni3C ControlNet only works with Wan models.
- This Uni3C ControlNet expects a Wan model with dim {}, the l
- Control type {max_type_name}({max_type}) is out of range for
- y is None, did you try using a controlnet for SDXL on SD1?
- This Controlnet needs a VAE but none was provided, please us
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/e7ed5c024d6d9826.
Report an issue: GitHub.