Nodes/comfyui_Niutonian_GLM_4_6V/Niutonian GLM-4.6V Model Loader
ComfyUI Node

Niutonian GLM-4.6V Model Loader

One node to actually fit a 9B vision model on your card

By Niutonian·Created 8 months ago·Updated 8 months ago· 0
Niutonian GLM-4.6V Model Loader
    • GLM_MODEL
    deviceauto
    torch_dtypebfloat16
    low_cpu_mem_usagetrue
    load_in_8bitfalse
    load_in_4bittrue

    This is the door to the whole pack. NiutonianGLM46VLoader pulls Z.ai's GLM-4.6V-Flash - a ~9 billion parameter vision-language model - into ComfyUI, and every other node in the pack expects its GLM_MODEL output. No API key, no cloud account: on first run it downloads about 9GB of weights from HuggingFace and runs everything locally. If that download or the VRAM bill sounds scary, the loader is built to make it survivable, which is really its whole reason to exist.

    The name might make you reach for your wallet, but the model family is as open as it gets. GLM comes from Z.ai (formerly Zhipu, the Tsinghua spin-off that also made CogVideoX), and the GLM line has been MIT-licensed since mid-2025. The weights cost you nothing but disk.

    How it works

    Under the hood it's a transformers load with the memory settings turned up. The loader instantiates Glm4vForConditionalGeneration.from_pretrained("zai-org/GLM-4.6V-Flash") with trust_remote_code=True, a sequential device map, 4-bit NF4 double-quantization when load_in_4bit is on, and it deliberately caps each GPU at 85% of VRAM so the rest of your ComfyUI graph has room to breathe. It hands back a single GLM_MODEL output - a bundle containing the model and its processor - that the Describer, Agentic Sampler, and Prompt Generator all consume. Think of it as the shared brain for the pack, loaded once and reused.

    The inputs that matter

    You really only touch two of them on a normal day:

    • load_in_4bit (default True) - the 4-bit quant is what makes a 9B vision model workable on 8-12GB cards. Leave it on until you have VRAM to burn.
    • load_in_8bit (default False) - 8-bit if you have a mid-range card and want slightly better fidelity. Don't set both; the code honors 4-bit first.
    • torch_dtype (default bfloat16) - keep it. float32 is the "I have 32GB+ and want correctness over speed" option.
    • device (default auto) - picks CUDA if present, falls back to CPU (slow, but it's a lifeline when the GPU OOMs).

    Installing it

    Same story as the rest of the pack. Easiest is ComfyUI Manager → Install Custom Nodes → search "comfyui_Niutonian_GLM_4_6V" → install → restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Niutonian/comfyui_Niutonian_GLM_4_6V
    cd comfyui_Niutonian_GLM_4_6V
    pip install -r requirements.txt
    

    Restart ComfyUI after. The requirements include transformers>=5.0.0rc0 - a prerelease - and the pack will happily force-install it on import if you don't. That's the one real dependency gotcha: a global transformers 5.0 upgrade can break other custom nodes that pinned 4.x. If your ComfyUI starts throwing unrelated errors after installing this pack, that upgrade is the first suspect.

    Common issues

    • CUDA out of memory - the loader catches it and prints a suggestions block. Enable 4-bit, drop max_tokens in the downstream nodes, close other GPU apps. If you're on a 12GB card with 4-bit and it still OOMs, it's likely the 15% VRAM reserve plus a busy graph; restart ComfyUI to clear the cache.
    • Model load fails - almost always the first-run HuggingFace download. Check internet, check ~9GB of free disk, and verify transformers actually came up as 5.0.0rc0+ (the README calls this out as a hard requirement).
    • Grey or missing images downstream - the pack's own README says to drop image size to 1024×1024 or below; large generations sometimes decode oddly around the VLM. Smaller images fix it.

    Start with the defaults, let it chew through the download, and only touch the quant settings when your card complains. The rest of the pack is downstream of this node, so once it loads cleanly you're most of the way home.

    CategoryNiutonian GLM-4.6V

    Inputs (5)

    NameTypeDefaultDescription
    deviceCOMBOauto3 options: auto, cuda, cpu
    torch_dtypeCOMBObfloat164 options: auto, bfloat16, float16, float32
    low_cpu_mem_usageBOOLEANtrue
    load_in_8bitBOOLEANfalse
    load_in_4bitBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    GLM_MODELGLM_MODEL