{"record":{"id":"e7ed5c024d6d9826","repo":"Comfy-Org/ComfyUI","slug":"the-connected-model-patch-is-not-a-uni3c-controlne","errorCode":null,"errorMessage":"The connected model patch is not a Uni3C ControlNet.","messagePattern":"The connected model patch is not a Uni3C ControlNet\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_model_patch.py","lineNumber":727,"sourceCode":"    @classmethod\n    def INPUT_TYPES(s):\n        return {\"required\": { \"model\": (\"MODEL\",),\n                              \"model_patch\": (\"MODEL_PATCH\",),\n                              \"vae\": (\"VAE\",),\n                              \"render_video\": (\"IMAGE\", {\"tooltip\": \"The guidance video rendered from the camera trajectory, most commonly warped point cloud renders of the input image.\"}),\n                              \"strength\": (\"FLOAT\", {\"default\": 1.0, \"min\": -10.0, \"max\": 10.0, \"step\": 0.01}),\n                              \"start_percent\": (\"FLOAT\", {\"default\": 0.0, \"min\": 0.0, \"max\": 1.0, \"step\": 0.001}),\n                              \"end_percent\": (\"FLOAT\", {\"default\": 1.0, \"min\": 0.0, \"max\": 1.0, \"step\": 0.001}),\n                              }}\n    RETURN_TYPES = (\"MODEL\",)\n    FUNCTION = \"apply_patch\"\n    EXPERIMENTAL = True\n\n    CATEGORY = \"model/patch/wan\"\n\n    def apply_patch(self, model, model_patch, vae, render_video, strength, start_percent, end_percent):\n        if not isinstance(model_patch.model, comfy.ldm.wan.uni3c.WanUni3CControlnet):\n            raise ValueError(\"The connected model patch is not a Uni3C ControlNet.\")\n        cnet_dim = model_patch.model.controlnet_blocks[0].norm1.linear.in_features\n        model_dim = getattr(model.get_model_object(\"diffusion_model\"), \"dim\", None)\n        if model_dim is None:\n            raise ValueError(\"The Uni3C ControlNet only works with Wan models.\")\n        if model_dim != cnet_dim:\n            raise ValueError(\"This Uni3C ControlNet expects a Wan model with dim {}, the loaded model has dim {}.\".format(cnet_dim, model_dim))\n\n        model_patched = model.clone()\n        model_sampling = model.get_model_object(\"model_sampling\")\n        sigma_start = model_sampling.percent_to_sigma(start_percent)\n        sigma_end = model_sampling.percent_to_sigma(end_percent)\n        latent_format = model.get_model_object(\"latent_format\")\n        patch = WanUni3CCnetPatch(model_patch, render_video[:, :, :, :3], vae, latent_format, strength, sigma_start, sigma_end)\n        model_patched.set_model_double_block_patch(patch)\n        return (model_patched,)\n\n\nclass UsoStyleProjectorPatch:","sourceCodeStart":709,"sourceCodeEnd":745,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_model_patch.py#L709-L745","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"import comfy.ldm.wan.uni3c as uni3c\nif not isinstance(model_patch.model, uni3c.WanUni3CControlnet):\n    raise UserFacingError('load the Uni3C controlnet with its dedicated loader')","typeGuard":"def is_uni3c_patch(model_patch) -> bool:\n    import comfy.ldm.wan.uni3c as uni3c\n    return isinstance(model_patch.model, uni3c.WanUni3CControlnet)","tryCatchPattern":null,"preventionTips":["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."],"tags":["uni3c","controlnet","type-mismatch","wan"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}