{"record":{"id":"a09979df353b6db9","repo":"Comfy-Org/ComfyUI","slug":"error-clip-input-is-invalid-none-n-nif-the-clip","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":"comfy_extras/nodes_lumina2.py","lineNumber":111,"sourceCode":"                io.String.Input(\n                    \"user_prompt\",\n                    multiline=True,\n                    dynamic_prompts=True,\n                    tooltip=\"The text to be encoded.\",\n                ),\n                io.Clip.Input(\"clip\", tooltip=\"The CLIP model used for encoding the text.\"),\n            ],\n            outputs=[\n                io.Conditioning.Output(\n                    tooltip=\"A conditioning containing the embedded text used to guide the diffusion model.\",\n                ),\n            ],\n        )\n\n    @classmethod\n    def execute(cls, clip, user_prompt, system_prompt) -> io.NodeOutput:\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        system_prompt = cls.SYSTEM_PROMPT[system_prompt]\n        prompt = f'{system_prompt} <Prompt Start> {user_prompt}'\n        tokens = clip.tokenize(prompt)\n        return io.NodeOutput(clip.encode_from_tokens_scheduled(tokens))\n\n\nclass Lumina2Extension(ComfyExtension):\n    @override\n    async def get_node_list(self) -> list[type[io.ComfyNode]]:\n        return [\n            CLIPTextEncodeLumina2,\n            RenormCFG,\n        ]\n\n\nasync def comfy_entrypoint() -> Lumina2Extension:\n    return Lumina2Extension()\n","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_lumina2.py#L93-L129","documentation":"Raised by the Lumina2 text-encode node when the clip input is None. In ComfyUI, a CheckpointLoader that finds no CLIP/text-encoder weights in the checkpoint yields clip=None, and optional typing lets None reach the node. The long message explicitly points at checkpoint loaders whose file lacks a valid text encoder.","triggerScenarios":"Loading a checkpoint that is diffusion-model-only (e.g. a raw Lumina2 or flow-matching DiT .safetensors without an embedded text encoder) through CheckpointLoader and wiring its CLIP output here; a corrupted or mis-packaged checkpoint where the text_encoder keys are absent.","commonSituations":"Using diffusers-format or single-tensor model files renamed to look like checkpoints; new Lumina2 releases that ship the text encoder separately.","solutions":["Load the text encoder separately with a CLIPLoader (DualCLIPLoader/Gemma-style loader appropriate for Lumina2) and connect it to the clip input.","If the checkpoint is supposed to contain a CLIP, verify the file integrity and that it was exported with text encoder weights included.","Do not wire the CLIP output of a diffusion-only checkpoint loader into this node."],"exampleFix":"# before\nckpt = CheckpointLoaderSimple('lumina2_diffusion_only.safetensors')\ncond = CLIPTextEncodeLumina2(ckpt.CLIP, ...)   # clip is None -> raises\n\n# after\nclip = CLIPLoader('umt5_xxl.safetensors', type='lumina2')\ncond = CLIPTextEncodeLumina2(clip, ...)","handlingStrategy":"type-guard","validationCode":"if clip is None:\n    raise RuntimeError(\n        \"clip is None: this checkpoint has no text encoder. \"\n        \"Load the text encoder with a CLIPLoader and connect that instead.\")","typeGuard":"def has_valid_clip(clip) -> bool:\n    return clip is not None and hasattr(clip, \"tokenize\") and hasattr(clip, \"encode_from_tokens_scheduled\")","tryCatchPattern":"try:\n    cond = CLIPTextEncodeLumina2.execute(clip, prompt, system)\nexcept RuntimeError as e:\n    if \"clip input is invalid\" in str(e):\n        clip = load_separate_text_encoder(\"lumina2\")\n        cond = CLIPTextEncodeLumina2.execute(clip, prompt, system)\n    else:\n        raise","preventionTips":["Use a dedicated CLIPLoader for diffusion-only checkpoints.","Inspect checkpoint contents (safetensors key prefixes) before assuming a CLIP is embedded.","Treat None from checkpoint CLIP outputs as 'not present', never forward it."],"tags":["clip","lumina2","checkpoint","text-encoder","none-check"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}