Nodes/ComfyUI_InternVL2/InternVL Model Loader
ComfyUI Node

InternVL Model Loader

The node that quietly downloads a 5–80 GB vision model for you

By leeguandong·Created 2 years ago·Updated 2 years ago· 13
InternVL Model Loader
    • intervl_model
    modelOpenGVLab/InternVL2-2B

    The boring, necessary node at the front of every InternVL graph

    Every InternVL workflow in this pack starts here. This is the node that grabs a vision-language model from Hugging Face, loads it into your GPU, and hands it to the inference node as one tidy "InternVLModel" bundle. It's not glamorous - it's a dropdown and a wire - but it's where the actual heavy lifting (multi-gigabyte downloads, the VRAM question, the trust_remote_code decision) all happens.

    How it works

    Read the source and it's refreshingly honest about what it does:

    1. On the first run it calls Hugging Face's snapshot_download to pull the whole model repo into ComfyUI/models/LLM/<model-name> - so OpenGVLab/InternVL2-2B lands in models/LLM/InternVL2-2B.
    2. It loads the tokenizer and model with transformers (AutoTokenizer / AutoModel), in float16, with trust_remote_code=True.
    3. The model is moved straight onto your GPU (comfy.model_management's torch device) in eval mode, and the model-plus-tokenizer pair is returned as the single intervl_model output.

    That trust_remote_code=True deserves a beat of attention, because InternVL2's HF repo ships its own custom modeling code that executes on load. This is standard practice for InternVL and it's how the official repo intends to be used - but you are, in effect, running OpenGVLab's code on your machine. Given this ecosystem's history with malicious custom nodes, it's worth knowing that's what's happening under the hood.

    The one input that matters

    The loader has exactly one input, model - a dropdown with six choices, defaulting to OpenGVLab/InternVL2-2B:

    • 1B / 2B - small and fast, fine on 8 GB cards, decent captioning.
    • 4B - the sweet spot for most people.
    • 8B - where quality gets noticeably better, but the fp16 weights alone are ~16 GB, so you're in 24 GB card territory.
    • 26B / 40B - server hardware. Not a consumer-card conversation.

    The 2B default is genuinely a fine place to start; you can caption a batch, judge the output, and climb the ladder only if you need better detail recognition. Note the list is hardcoded to the InternVL2 generation - this pack hasn't been updated since August 2024, so you won't see InternVL 2.5/3.x here no matter how new your GPU is.

    The single output, intervl_model (type InternVLModel), wires straight into the InternVL HF Inference node's model input. Nothing else consumes it - this is a self-contained mini-pipeline, not something you can bolt onto an existing graph.

    Install

    Same pack for all three nodes. Via ComfyUI Manager (search "InternVL"), or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/leeguandong/ComfyUI_InternVL2
    

    Restart, and accept that the first run of the loader is a download first and a load second. There's no progress bar in the ComfyUI UI - watch the console window for the Hugging Face progress lines, and don't panic when it sits there.

    Where people get burned

    • Missing transformers. The pack has no requirements.txt; it assumes your environment already has transformers and huggingface_hub. If ComfyUI fails to start the pack with a ModuleNotFoundError, that's it: pip install transformers huggingface_hub.
    • The big first download. 2B is ~5 GB, 8B ~16 GB. If the snapshot_download call throws a TypeError on a fresh setup, the culprit is often that the pack still passes local_dir_use_symlinks, an argument Hugging Face removed in huggingface_hub 1.0.
    • VRAM math. The model stays loaded on the GPU until the inference node decides to offload it. Picking 8B+ without checking your card is how you get an out-of-memory death on first queue.
    Categoryinternvl

    Inputs (1)

    NameTypeDefaultDescription
    modelCOMBOOpenGVLab/InternVL2-2B6 options: OpenGVLab/InternVL2-1B, OpenGVLab/InternVL2-2B, OpenGVLab/InternVL2-4B, OpenGVLab/InternVL2-8B, OpenGVLab/InternVL2-26B, OpenGVLab/InternVL2-40B

    Outputs (1)

    NameTypeDescription
    intervl_modelInternVLModel