Nodes/ComfyUI-Lightning/Load Sana CLIP
ComfyUI Node

Load Sana CLIP

It's Gemma, not CLIP

By shenduldh·Created 2 years ago·Updated about a year ago· 225
Load Sana CLIP
    • GEMMA
    model_name
    max_length300
    devicecuda
    dtypeauto

    The name is a little misleading, and the node's own output tells you why: this loads Sana's text encoder, and what comes out is typed GEMMA, not CLIP. Sana doesn't use a CLIP-family text encoder at all - it uses Google's Gemma, a proper instruction-tuned language model, to turn your prompt into conditioning. "Load Sana CLIP" is really "load Sana's text encoder," and the naming is a holdover from how every other model family in ComfyUI names this kind of node, not a description of what's actually inside.

    What it is and why you'd reach for it

    Using a real language model instead of CLIP for text conditioning is part of what lets Sana punch above its weight for its size - Gemma understands full sentences and instructions the way a CLIP-family encoder never really does. It's the same broader shift you've seen elsewhere: newer image and video models increasingly reach for LLM-class encoders (T5, Gemma, Qwen) instead of CLIP, because natural-language understanding maps better onto how people actually write prompts. This node is where that swap happens for Sana specifically - load it, plug your prompt through it, and you get conditioning the diffusion model understands.

    How it works

    Loads a Gemma checkpoint from models/text_encoders, sets it to run on the device and precision you choose, and truncates or accepts prompts up to a maximum token length. The output is a GEMMA object - a distinct type from ComfyUI's core CLIP, so it only connects to nodes built to accept it, which in practice means this pack's own Sana-specific conditioning path.

    The inputs and outputs that matter

    • model_name - the dropdown of files found in models/text_encoders. If you haven't put anything there yet, this shows the placeholder put_text_encoder_files_here - that's ComfyUI telling you the folder's empty, not an actual model option to select.
    • max_length (int, default 300) - how many tokens of your prompt Gemma will process. Sana's design leans on Gemma's ability to handle longer, more natural prompts than CLIP ever could, so 300 gives you real room - don't assume you need to keep prompts CLIP-short here.
    • device - cuda or cpu. Running the text encoder on CPU is a legitimate move if you're VRAM-tight and can spare the extra latency, since it only runs once per prompt rather than once per sampling step.
    • dtype - auto, fp32, fp16, or bf16. auto is the reasonable default; drop precision manually only if you're chasing VRAM headroom and know what you're trading away.

    Output is a GEMMA object - wire it into whatever this pack's Sana conditioning path expects it, not into a slot built for ComfyUI's standard CLIP type.

    How to install it

    • ComfyUI Manager - search "ComfyUI-Lightning", install, restart.
    • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/shenduldh/ComfyUI-Lightning, then restart.

    Then get the actual encoder: download Gemma from google/gemma-2-2b-it, or one of the smaller/quantized alternatives the README lists - unsloth/gemma-2b-it-bnb-4bit or Efficient-Large-Model/gemma-2-2b-it - and put the whole folder (not just a single file) into models/text_encoders.

    Common issues & troubleshooting

    Dropdown only shows put_text_encoder_files_here. You haven't added a Gemma folder to models/text_encoders yet - that placeholder text is the tell, not an actual model to pick.

    I connected this node's output where CLIP normally goes and it errors. Expected - the output type is GEMMA, deliberately distinct from ComfyUI's core CLIP type, so it won't plug into a generic CLIP Text Encode node built for SD/Flux-style conditioning. It needs a Sana-specific conditioning path downstream.

    Gemma requires accepting a license on HuggingFace. Gemma models are gated behind Google's license acceptance - log into HuggingFace, accept the terms on the model page, and make sure your download tool is authenticated, or the download will fail silently or with a permissions error.

    Downloaded the model but only got one file, not the folder. Gemma ships as multiple files (config, tokenizer, weight shards). Grab the whole repository folder rather than a single .safetensors - a partial download is a common reason loading fails.

    CategoryLightning/Sana

    Inputs (4)

    NameTypeDefaultDescription
    model_nameCOMBO1 options: put_text_encoder_files_here
    max_lengthINT3001–9999
    deviceCOMBOcuda2 options: cuda, cpu
    dtypeCOMBOauto4 options: auto, fp32, fp16, bf16

    Outputs (1)

    NameTypeDescription
    GEMMAGEMMA