Nodes/ComfyUI-LongCatPlugin/Load LongCat Model
ComfyUI Node

Load LongCat Model

The model half of LongCat's three-piece brain

By ARM64-EC·Created 9 months ago·Updated 9 months ago· 0
Load LongCat Model
    • model
    model_path
    dtypebf16
    device
    gpu_onlyfalse

    If you're here, you've found a ComfyUI port of LongCat - Meituan's open-source image generation and editing family that got a lot of attention for how well it renders text and follows instructions. There's no native ComfyUI support for it, so this plugin is one of the community ports, and LoadLongCatModel is the part that actually loads the model. Call it the transformer half of the pack's three-piece brain: model, CLIP, VAE, each with its own loader.

    It takes a model_path - a raw string, not a dropdown, so type the actual path to your checkpoint - and returns a MODEL you feed into LongCatSampler. Under the hood it builds a LongCatImageTransformer2DModel, which is a Flux-style flow-matching DiT: patch_size: 1, 64 input channels, 10 full attention layers plus 20 single ones, and positional ids for a 16-channel packed latent. It wraps that in a ComfyUI ModelPatcher with the LongCat scheduler attached, so the sampler can run its own denoise loop instead of going through ComfyUI's normal KSampler machinery.

    The inputs you actually set:

    • model_path - a diffusers-format directory containing a transformer/ subfolder, or a single .safetensors file. Leave it empty and you get a ValueError telling you to provide one.
    • dtype - defaults to bf16. That's the right call on Ampere-or-newer cards. If you're on an older GPU without bf16 support, switch to fp16; fp32 is there if you have the VRAM to burn and want the safest precision.
    • device - auto or cpu. Leave it on auto.
    • gpu_only - defaults to false, and the name is a little backwards. Unchecked, ComfyUI is allowed to offload the transformer to CPU to fit in VRAM. Check it to pin everything to the GPU. If you're hitting OOM, leave this off.

    Installing it is the standard custom-node dance:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ARM64-EC/ComfyUI-LongCatPlugin
    cd ComfyUI-LongCatPlugin
    pip install -r requirements.txt
    

    Restart ComfyUI and the nodes appear under the LongCat category. One stale-README warning: the repo's README tells you to "copy the comfyui_longcat folder" - ignore that, the repo is a normal custom_nodes layout with nodes.py at the root. And the README's mention of a LongCatPipelineLoader is also outdated; what actually ships is this three-loader split. The bigger install reality: the pack only bundles configs and a tokenizer. The actual LongCat weights (several GB for the 7B-class transformer) come from the LongCat Hugging Face org and you place them wherever your model_path points.

    Expect a warning about missing/unexpected keys when loading a single-file checkpoint - usually harmless. The pack is early days: one commit, a README with a long roadmap, and no quantization yet, so budget VRAM generously.

    CategoryLongCat

    Inputs (4)

    NameTypeDefaultDescription
    model_pathSTRING
    dtypeCOMBObf163 options: bf16, fp16, fp32
    deviceCOMBO2 options: auto, cpu
    gpu_onlyBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    modelMODEL