ComfyUI Node

IF Load Encoder

A ComfyUI node in Zuellni/IF with 2 inputs and 1 output.

By Zuellni·Created 3 years ago·Updated 3 years ago· 43
IF Load Encoder
    • MODEL
    model4-bit
    device

    The DeepFloyd IF pipeline has three model stages, but before any of them does anything you have to load the thing that reads your prompt: the T5-XXL text encoder. This node is the encoder loader, and its default setting is the reason the pipeline is even runnable on a normal GPU - it loads the encoder quantized to 4-bit.

    What it is

    IF Load Encoder pulls the text_encoder subfolder from DeepFloyd/IF-I-M-v1.0 - that's T5-XXL, a ~10GB model in fp16 - and hands it to the rest of the IF family as an S0_MODEL. The output feeds IF Encode, which turns your prompts into embeddings. You can't skip this node; nothing else in the pack produces an S0_MODEL.

    The quantization choice

    The model dropdown gives you three sizes of the same encoder:

    • 4-bit (default) - bitsandbytes 4-bit with double quantization. Roughly 2.5–3GB of VRAM for the encoder. This is the sane default and what the author intended you to use.
    • 8-bit - the middle ground; ~5GB.
    • 16-bit - full fp16, ~10GB. If your card has the headroom, quality is marginally better and you dodge bitsandbytes entirely.

    There's a real tradeoff being hidden behind that dropdown. T5-XXL is the memory bottleneck of DeepFloyd - it's bigger than the diffusion UNets in Stage I and II. The 4-bit default exists precisely so the whole three-stage pipeline fits alongside a working image generation model. If you're chasing the last bit of prompt fidelity, 16-bit helps a little; if you're fighting OOMs, 4-bit is your friend.

    The device field

    A plain string, default empty. Leave it empty and the loader uses offloading: components get shuffled between CPU and VRAM via accelerate's cpu_offload_with_hook, which keeps peak VRAM low at the cost of speed. Or pin it to something explicit like cpu, cuda, cuda:0, cuda:1 to force placement. Multi-GPU people will want the explicit form; everyone else can leave it alone.

    Install and the gotchas that will actually bite you

    This node is part of Zuellni/ComfyUI-Custom-Nodes. Via Manager (search "Zuellni") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Zuellni/ComfyUI-Custom-Nodes
    

    Then three things, in order of how often they end the party:

    1. HuggingFace access. The model is gated - you need an account that accepted the terms, plus a token: huggingface-cli login. Without it, 401 errors on first load.
    2. bitsandbytes. The 4-bit and 8-bit options need a working bitsandbytes build for your GPU. On Windows the pack's requirements install a specific wheel; on Linux you need a version that matches your CUDA. If bitsandbytes fails, the loader errors immediately - fall back to 16-bit rather than debugging bnb for an afternoon.
    3. The pack is archived. The author's README says IF "has a lot of issues" and the repo is unmaintained. It still works - it's how people actually ran DeepFloyd in ComfyUI - but against a moving diffusers/transformers target, expect the occasional version-drift break and be ready to pin dependencies.

    Output: a single MODEL socket of type S0_MODEL, wired into IF Encode. That's the whole node - it loads, and everything downstream hangs off it.

    CategoryZuellni/IF

    Inputs (2)

    NameTypeDefaultDescription
    modelCOMBO4-bit3 options: 4-bit, 8-bit, 16-bit
    deviceSTRING

    Outputs (1)

    NameTypeDescription
    MODELS0_MODEL