Nodes/Diffusion_pipe_in_ComfyUI/混元Image 2.1模型配置
ComfyUI Node

混元Image 2.1模型配置

Tencent's HunyuanImage 2.1 — four model files and a qwen-VL encoder

By TianDongL·Created 11 months ago·Updated 7 months ago· 69
混元Image 2.1模型配置
    • model_path
    transformer_path
    vae_path
    text_encoder_path
    byt5_path

    混元Image 2.1 - HunyuanImage 2.1 - is Tencent's image model, part of the Hunyuan family that shipped frontier-sized open weights early and never quite adopted a real open license. It's one of the more component-heavy models in this pack to set up, because its text encoder is a full vision-language model (Qwen2.5-VL 7B) plus a ByT5 spellout model for text rendering. HunyuanImage21ModelNode is how you point a training run at all four pieces.

    What it does

    Four required path inputs, no optional knobs - the simplest possible "give me the model" contract:

    • transformer_path - the main model, e.g. hunyuanimage2.1.safetensors.
    • vae_path - the VAE, e.g. hunyuan_image_2.1_vae_fp16.safetensors.
    • text_encoder_path - the text encoder, and notice the tooltip's example: qwen_2.5_vl_7b.safetensors. This model encodes prompts with a Qwen-VL-class LLM, which is also exactly what HunyuanVideo 1.5 uses - if you train both, that file does double duty.
    • byt5_path - the ByT5 file, e.g. byt5_small_glyphxl_fp16.safetensors. ByT5 is the byte-level spellout model that handles text and glyph rendering in this family - it's why HunyuanImage is good at putting readable words in images.

    All four are enforced: the source returns an error dict if any is empty, and each goes through WSL2 path normalization. The output is the standard model_path config (type: "hunyuan_image"), wired into GeneralConfig.model_config.

    The README table is generous here: HunyuanImage-2.1 gets LoRA ✅, full fine-tune ✅, and fp8 ✅ - one of the most flexible entries in the pack.

    Fitting it in

    Same skeleton as every run: model node → GeneralConfigTrain, with adapter, dataset, and optimizer. Because the encoder is a real 7B VL model, watch your VRAM at load - this is a run where llama3_4bit-style tricks don't apply, but the pack's blocks_to_swap on GeneralConfig is your off-ramp if you're tight.

    Installing the pack

    Shared install, Linux/WSL2 only, submodules mandatory:

    cd ComfyUI/custom_nodes/
    git clone --recurse-submodules https://github.com/TianDongL/Diffusion_pipe_in_ComfyUI.git
    git submodule update
    pip install -r Diffusion_pipe_in_ComfyUI/requirements.txt
    

    Also pip install git+https://github.com/huggingface/diffusers (dev) per the README for the newest model support, then restart and load the example workflow.

    Common issues

    Missing a path is the top failure - all four are required and the node will error if any is empty, so read the console. The subtle one: the Qwen2.5-VL encoder file is big and easy to confuse with a different Qwen variant; the trainer will complain loudly at load if you've grabbed the wrong one. And the usual pack conventions: full absolute paths and WSL2 drive-letter format (Z:/..., not /mnt/z/...).

    CategoryDiffusion-Pipe/Model

    Inputs (4)

    NameTypeDefaultDescription
    transformer_pathSTRINGTransformer模型文件的完整路径(如:/data/imagegen_models/comfyui-models/hunyuanimage2.1.safetensors)
    vae_pathSTRINGVAE文件的完整路径(如:/data/imagegen_models/comfyui-models/hunyuan_image_2.1_vae_fp16.safetensors)
    text_encoder_pathSTRINGText Encoder文件的完整路径(如:/data/imagegen_models/comfyui-models/qwen_2.5_vl_7b.safetensors)
    byt5_pathSTRINGByT5文件的完整路径(如:/data/imagegen_models/comfyui-models/byt5_small_glyphxl_fp16.safetensors)

    Outputs (1)

    NameTypeDescription
    model_pathmodel_path