Nodes/Comfy_HunyuanImage3/Hunyuan Unified Generate V2
ComfyUI Node

Hunyuan Unified Generate V2

One node to rule all the base-model loaders

By EricRollei·Created 10 months ago·Updated 4 months ago· 65
Hunyuan Unified Generate V2
    • images
    • final_prompt
    model_nameHunyuanImage-3-NF4
    prompta beautiful sunset over mountains
    resolution1024x1024 (1:1 Square)
    num_inference_steps40
    guidance_scale5.0
    seed-1
    blocks_to_swap20
    vae_placementauto
    post_actionfull_unload
    enable_vae_tilingfalse
    flow_shift2.8
    reserve_vram_gb0.0
    moe_drop_tokenstrue
    vae_dtypebfloat16
    force_reloadfalse

    "Hunyuan Unified Generate V2" is the pack's attempt to collapse the whole loader-plus-generator dance into a single node. It has a built-in loader, auto-detects your model's quant type from the folder name (NF4/INT8/BF16), handles block swap, memory budgets, and VRAM management, and outputs an image. No separate loader node, no HUNYUAN_MODEL wiring, no decisions about which generate variant matches which loader. You pick a model folder and a prompt, and it figures the rest out.

    It's a genuinely good idea, and it's also the node the README positions as the base-model replacement: "Single node replaces all base-model generate variants." The catch is the same one every all-in-one node has - you trade the explicit control of the split loaders for convenience, and when something goes wrong, the one node is a black box.

    What you set

    The required inputs are the essentials: model_name (dropdown of detected model folders), prompt, resolution (40 presets at common photo ratios), num_inference_steps (default 40; the tooltip notes 50–80 reduces flow-matching artifacts at 2K+), guidance_scale (default 5.0), and seed (-1 for random).

    The optional inputs are where the unified node shows off:

    • blocks_to_swap - default 20, with -1 meaning auto-calculate. 0 = no swapping (NF4 needs ~50GB; BF16 falls back to device_map).
    • vae_placement - auto (decide from VRAM), always_gpu, or managed (VAE moves to CPU when not decoding).
    • post_action - full_unload by default here, unlike the split generators' keep_loaded. Worth knowing if you expected the model to stay warm.
    • enable_vae_tiling - tile the VAE decode for large images (slower, less VRAM).
    • flow_shift - default 2.8; lower for portraits, higher for landscapes.
    • reserve_vram_gb - set aside VRAM for downstream nodes (upscalers, other models).
    • moe_drop_tokens - default true; false for best quality on ≥48GB cards.
    • vae_dtype - bfloat16 default, float32 to cut banding.
    • force_reload - for orphaned VRAM after a failed load.

    Outputs are images (an IMAGE) and final_prompt (a STRING - handy, since there's no rewritten-prompt/status trio here).

    When to use it

    For a clean text-to-image graph that you don't want to maintain, this is the node. It's also the base that Hunyuan Generate with Latent inherits from - the experimental latent-control node is literally a subclass of this one, so anything you learn here transfers.

    Installing

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

    Restart ComfyUI, or install via ComfyUI Manager (search "Comfy_HunyuanImage3"), then drop a model in ComfyUI/models/ - e.g. huggingface-cli download EricRollei/HunyuanImage-3-NF4-v2 --local-dir HunyuanImage-3-NF4.

    When not to

    If you're on a 24GB card, the split NF4 Low VRAM+ loader → Low VRAM Budget generator pair is still the recommended road - that pairing's device_map strategy was specifically rebuilt to avoid the bitsandbytes validation errors that plagued early NF4 attempts, and the unified node's auto-magic can't replicate the fine-grained budget control. And for 3MP+ BF16 renders on 96GB, the HighRes Efficient generator is the specialist that this node doesn't try to be. Unified V2 is the great default; the split nodes are the specialists.

    CategoryHunyuan/V2

    Inputs (15)

    NameTypeDefaultDescription
    model_nameCOMBOHunyuanImage-3-NF4Model folder. Quant type is auto-detected from name (NF4/INT8/BF16).
    promptSTRINGa beautiful sunset over mountainsText prompt for image generation.
    resolutionCOMBO1024x1024 (1:1 Square)Image resolution at common photo ratios (~1MP base, ~1.5MP HD, ~2.4MP large). All divisible by 16.
    num_inference_stepsINT4010–100Number of diffusion steps. 40 is balanced for ~1MP. Higher (50–80) reduces flow-matching artifacts at 2K+ resolutions but generation time scales linearly — expect a much longer wait.
    guidance_scaleFLOAT5.01–20CFG scale. Higher = more prompt adherence. 5.0-7.0 typical.
    seedINT-1-1–2147483647-1 = random seed.
    blocks_to_swapoptINT20-1–31-1 = auto calculate. 0 = no swapping (NF4 needs ~50GB; BF16 uses device_map). 1-31 = manual swap count. BF16 with block swap loads to CPU and is much faster than device_map.
    vae_placementoptCOMBOautoauto: decide based on VRAM. always_gpu: VAE stays on GPU. managed: VAE moves to CPU when not decoding.
    post_actionoptCOMBOfull_unloadkeep_loaded: Keep model on GPU. soft_unload: Move to CPU, keep cached. full_unload: Remove from memory.
    enable_vae_tilingoptBOOLEANfalseEnable VAE tiling for large images. Reduces VRAM but slower.
    flow_shiftoptFLOAT2.80–10Flow-matching shift. Default 2.8 is balanced. Presets: portraits/faces 2.0–2.5 (sharper detail), landscapes/illustrations 3.5–5.0 (cleaner gradients, less high-frequency noise).
    reserve_vram_gboptFLOAT0.00–48Reserve VRAM for downstream nodes (upscalers, other models).
    moe_drop_tokensoptBOOLEANtrueTrue (default): MoE drops tokens that exceed expert capacity (lower VRAM, ~1–3% quality cost on dense regions). False: route every token through its top-K experts (best quality, higher VRAM peak — recommended only on ≥48GB cards).
    vae_dtypeoptCOMBObfloat16VAE decode precision. bfloat16 (default) is fast and matches model dtype. float32 reduces banding/chroma noise on smooth gradients with negligible cost on big cards. (Some users may already force this via ComfyUI launch flag.)
    force_reloadoptBOOLEANfalseForce full reload: clears cache, empties VRAM, reloads model fresh. Use if orphaned VRAM from failed loads.

    Outputs (2)

    NameTypeDescription
    imagesIMAGE
    final_promptSTRING