{"record":{"id":"775157f5f2425b1a","repo":"Comfy-Org/ComfyUI","slug":"error-clip-input-is-invalid-none-n-nif-the-clip-775157","errorCode":null,"errorMessage":"ERROR: clip input is invalid: None\\n\\nIf the clip is from a checkpoint loader node your checkpoint does not contain a valid clip or text encoder model.","messagePattern":"ERROR: clip input is invalid: None\\\\n\\\\nIf the clip is from a checkpoint loader node your checkpoint does not contain a valid clip or text encoder model\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"nodes.py","lineNumber":75,"sourceCode":"    @classmethod\n    def INPUT_TYPES(s) -> InputTypeDict:\n        return {\n            \"required\": {\n                \"text\": (IO.STRING, {\"multiline\": True, \"dynamicPrompts\": True, \"tooltip\": \"The text to be encoded.\"}),\n                \"clip\": (IO.CLIP, {\"tooltip\": \"The CLIP model used for encoding the text.\"})\n            }\n        }\n    RETURN_TYPES = (IO.CONDITIONING,)\n    OUTPUT_TOOLTIPS = (\"A conditioning containing the embedded text used to guide the diffusion model.\",)\n    FUNCTION = \"encode\"\n\n    CATEGORY = \"model/conditioning\"\n    DESCRIPTION = \"Encodes a text prompt using a CLIP model into an embedding that can be used to guide the diffusion model towards generating specific images.\"\n    SEARCH_ALIASES = [\"text\", \"prompt\", \"text prompt\", \"positive prompt\", \"negative prompt\", \"encode text\", \"text encoder\", \"encode prompt\"]\n\n    def encode(self, clip, text):\n        if clip is None:\n            raise RuntimeError(\"ERROR: clip input is invalid: None\\n\\nIf the clip is from a checkpoint loader node your checkpoint does not contain a valid clip or text encoder model.\")\n        tokens = clip.tokenize(text)\n        return (clip.encode_from_tokens_scheduled(tokens), )\n\n\nclass ConditioningCombine:\n    ESSENTIALS_CATEGORY = \"Image Generation\"\n    @classmethod\n    def INPUT_TYPES(s):\n        return {\"required\": {\"conditioning_1\": (\"CONDITIONING\", ), \"conditioning_2\": (\"CONDITIONING\", )}}\n    RETURN_TYPES = (\"CONDITIONING\",)\n    FUNCTION = \"combine\"\n\n    CATEGORY = \"model/conditioning/transform\"\n    SEARCH_ALIASES = [\"combine\", \"merge conditioning\", \"combine prompts\", \"merge prompts\", \"mix prompts\", \"add prompt\"]\n\n    def combine(self, conditioning_1, conditioning_2):\n        return (conditioning_1 + conditioning_2, )\n","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/nodes.py#L57-L93","documentation":"CLIPTextEncode.encode receives the CLIP/text-encoder object from a checkpoint loader; when the loaded checkpoint contains no valid CLIP weights the loader passes None downstream, and this node raises a RuntimeError explaining the checkpoint lacks a text encoder model rather than crashing on None.tokenize().","triggerScenarios":"Loading a diffusion-only or VAE-only checkpoint (e.g. a raw unet/diffusion-model safetensors renamed as a checkpoint) into CheckpointLoaderSimple, then wiring its CLIP output into CLIPTextEncode; also clip_weight_dtype or clip skip setups where the loader deliberately yields None.","commonSituations":"Using a DiT/flow model checkpoint without an embedded text encoder (needs a separate CLIPLoader); mixing up CheckpointLoaderSimple with models that require dual text encoders loaded separately; corrupted or partial checkpoint files missing the clip_weights tree.","solutions":["Use a full checkpoint that bundles a text encoder, or load CLIP separately with CLIPLoader (and VAE with VAELoader) for diffusion-only checkpoints","Wire the CLIP output of the correct loader node into the text encode node","Inspect the checkpoint's state dict keys for a 'clip'/'conditioner' text-encoder subtree if unsure"],"exampleFix":"# before: diffusion-only checkpoint via CheckpointLoaderSimple\nclip = CheckpointLoaderSimple(...).clip  # None\ncond = CLIPTextEncode().encode(clip, \"a cat\")\n\n# after: dedicated loaders for unet-style checkpoints\nclip = CLIPLoader().load(\"t5xxl_fp8.safetensors\", \"wan\")\ncond = CLIPTextEncode().encode(clip, \"a cat\")","handlingStrategy":"type-guard","validationCode":"if clip is None:\n    raise RuntimeError(\"checkpoint has no CLIP; use CLIPLoader for diffusion-only checkpoints\")","typeGuard":"def has_clip(ckpt_output) -> bool:\n    return getattr(ckpt_output, \"clip\", None) is not None","tryCatchPattern":"try:\n    cond = CLIPTextEncode().encode(clip, text)\nexcept RuntimeError as e:\n    if \"clip input is invalid\" in str(e):\n        # switch to CLIPLoader-based graph\n        raise","preventionTips":["For unet/diffusion-only checkpoints, build graphs with separate CLIPLoader and VAELoader","Check that checkpoint files contain a text-encoder subtree before wiring CLIP outputs"],"tags":["clip","text-encoding","checkpoint","none-input"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}