Nodes/ComfyUI-Hunyuan-Image-3/Hunyuan Image 3.0
ComfyUI Node

Hunyuan Image 3.0

Your GPU can't run Hunyuan Image 3.0 — this node lets it run anyway

By bgreene2·Created 11 months ago·Updated 11 months ago· 34
Hunyuan Image 3.0
    • Image
    prompt
    seed0
    use_dimensionsfalse
    width1024
    height1024
    steps0
    guidance_scale0.0
    attn_implementationsdpa
    moe_impleager
    weights_folder./HunyuanImage-3
    use_offloadtrue
    disk_offload_layers32
    keep_model_in_memoryfalse
    device_map_overrides
    moe_drop_tokenstrue

    Hunyuan Image 3.0 is the biggest open image model anyone has shipped: 80B parameters, 64 experts, 13B active per token. When Tencent dropped the weights in September 2025, the reaction on r/StableDiffusion was mostly people measuring it and weeping - the community pegged it at roughly 320GB of VRAM to run straight, and even GGUF quantization was off the table for consumers. So this single-node pack is a specific kind of project: a wrapper whose entire reason to exist is letting you run the thing anyway, on hardware that has no business running it.

    The trick isn't magic. The node doesn't compress 80B into your 12GB card; it moves the wall. Instead of loading the whole model into VRAM, it keeps the weights in system RAM and streams layers to the GPU as they're needed, which is what "CPU offload" means here. Flip disk_offload_layers above 0 and the top N of the model's 32 layers get pushed out to disk entirely. Under the hood it's just AutoModelForCausalLM.from_pretrained from transformers with trust_remote_code=True and a hand-built device_map that puts everything except the VAE on CPU, then calls generate_image() on the HuggingFace pipeline. That's the whole node: prompt in, image out, one class.

    The inputs that matter

    Most of these are set-and-forget, but a few you'll actually touch:

    • prompt - a multiline string. This model rewards detail; Tencent's own card pushes a prompting guide, and "detailed prompt" is the difference between good and slop here.
    • steps and guidance_scale - both default to 0, which means "use the model default" (50 steps, 7.5 CFG). Set them explicitly only when you're experimenting.
    • use_dimensions - off by default, meaning the model picks the resolution. Note the model only supports a few discrete sizes, so even with use_dimensions on, your width/height get snapped to the nearest supported ratio.
    • use_offload and disk_offload_layers - the two that actually define your experience. Offload on means the custom device map; disk_offload_layers decides how many of the 32 layers live on disk instead of RAM. The tooltip just says "IMPORTANT: Read the README," which should tell you how sharp this edge is.
    • keep_model_in_memory - keeps the loaded model resident between runs instead of freeing it, which matters when every reload costs you the same hour.
    • moe_drop_tokens and the device_map_overrides optional inputs are the advanced knob drawer: token-dropping stabilizes memory, overrides let you hand-place layers across GPUs.

    The output is a single Image, which you wire into Save Image like any other generation node.

    Installing it

    Easiest path is ComfyUI Manager - search for "ComfyUI-Hunyuan-Image-3" and hit install. Manual install works too:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bgreene2/ComfyUI-Hunyuan-Image-3
    cd ComfyUI-Hunyuan-Image-3
    pip install -r requirements.txt
    

    The requirements pull in a specific diffusers/transformers stack (diffusers ≥ 0.32, transformers ≥ 4.56 with accelerate and tiktoken), plus your own CUDA 12.8 PyTorch. Then the big one: download tencent/HunyuanImage-3.0 from HuggingFace and point weights_folder at it. There's no getting around that download - the model is huge.

    Where people get burned

    The default disk_offload_layers is 32, i.e. every layer on disk. That's the safe-but-glacial starting point, and the README is blunt about the alternative: on 128GB of system RAM, 10 disk layers is the sweet spot, and even then you're looking at 1–1.5 hours per image at 50 steps on a PCIe 4.0 NVMe setup. If you crash with OOM, moe_drop_tokens (already defaulted on) stabilizes memory dramatically at a small quality cost; the Windows-only Nvidia Sysmem Fallback and ComfyUI's --disable-cuda-malloc flag are the other levers.

    Also, two things nobody tells you upfront. First, 80B params is north of 150GB in fp16, so CPU offload isn't a free pass - you still need a workstation's worth of system RAM or you'll swap to death. Second, the model ships under Tencent's community license, which excludes the EU, UK, and South Korea from the grant entirely, reaching your outputs, not just the weights. Check your jurisdiction before you fall in love.

    Honest verdict: this is a "can I?" node, not a "should I?" one. If you just want great open-weights images on consumer hardware, Z-Image or Flux 2 Klein are the sane choice. But if you have the RAM, a spare afternoon, and a stubborn streak about running the biggest open image MoE that exists - this is the node that gets you there.

    CategoryImage Generation

    Inputs (15)

    NameTypeDefaultDescription
    promptSTRING
    seedINT00–4294967295
    use_dimensionsBOOLEANfalseIf false, the model will choose the image dimensions, and the user-provided width and height will be ignored.
    widthINT10240–4096
    heightINT10240–4096
    stepsINT00–200If 0, it will use the model's default of 50.
    guidance_scaleFLOAT0.00–100If 0, it will use the model's default of 7.5.
    attn_implementationSTRINGsdpaUse sdpa. If FlashAttention is installed, you may try flash_attention_2.
    moe_implSTRINGeagerUse eager. If FlashInfer is installed, you may try flashinfer.
    weights_folderSTRING./HunyuanImage-3The path to the Hunyuan Image 3.0 weights on disk.
    use_offloadBOOLEANtrueIf true, a custom device_map will be created. Otherwise, device_map will be auto.
    disk_offload_layersINT320–32The number of layers to offload from memory to disk. IMPORTANT: Read the README.
    keep_model_in_memoryBOOLEANfalseIf true, the model will be kept in memory between runs.
    device_map_overridesoptSTRINGADVANCED: Device map key=value overrides, comma-separated. e.g. "model.layers.0=0,model.layers.1=1".
    moe_drop_tokensoptBOOLEANtrueSets moe_drop_tokens=True on model loading.

    Outputs (1)

    NameTypeDescription
    ImageIMAGE