LongCat CLIP Loader
This 'CLIP loader' actually loads a vision-language LLM
- clip
The name undersells it. When you load "CLIP" for LongCat, you're not getting the compact contrastive encoder SD 1.5 used - you're loading a Qwen2.5-VL–based causal language model, the thing that makes LongCat good at text and at following instructions. LongCatCLIPLoader is how you get that into your graph, and it pairs with the two text-encode nodes in this pack.
It reads model_name from a dropdown that lists files in ComfyUI's models/text_encoders folder. Point it at the LongCat text encoder you've downloaded (a diffusers-format directory with a text_encoder/ subfolder) and it builds a wrapper that carries the tokenizer, the chat-templated processor, and - if the checkpoint includes one - a CLIPVisionModelWithProjection image encoder. That optional image encoder is the whole reason LongCat can edit images: the text model literally sees the reference, then reads your edit instruction.
Output is a single clip that wires into TextEncodeLongCatImage (text-to-image) or TextEncodeLongCatImageEdit (editing). The other two inputs are quick: dtype defaults to bf16 (drop to fp16 on pre-Ampere GPUs), and device is auto or cpu - leave it on auto.
The part people trip on: this loader uses trust_remote_code=True and needs a reasonably fresh transformers. The pack's requirements.txt pins transformers>=4.41.0, and if you're on an old install the load will fail in confusing ways. Update it:
pip install -r ComfyUI/custom_nodes/ComfyUI-LongCatPlugin/requirements.txt
Also, the tokenizer and processor are bundled inside the plugin (longcat_image/resources/), so you don't need to hunt those down separately - but the actual text encoder weights are not bundled. You download those from the LongCat org on Hugging Face and drop them into models/text_encoders.
One more thing worth knowing before you build a workflow around it: because the text encoder is a real LLM, encoding isn't a cheap matrix multiply like old CLIP. Combined with the prompt-rewrite pass that TextEncodeLongCatImage runs by default, every encode is effectively a small text generation. It's the cost of LongCat's prompt adherence - just don't expect the instant turnarounds you get with a 4-channel SD setup.
The pack is early-stage and this loader is the foundation of everything else in it. Get this one loading cleanly and the rest of the graph falls into place.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | 0 options: | |
| dtype | COMBO | bf16 | 3 options: bf16, fp16, fp32 |
| device | COMBO | 2 options: auto, cpu |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| clip | CLIP | — |