Nodes/HiDream Sampler/HiDream Sampler (Advanced)
ComfyUI Node

HiDream Sampler (Advanced)

Drive all four text encoders, if you dare

By lum3on·Created about a year ago·Updated about a year ago· 478
HiDream Sampler (Advanced)
    • image
    model_typefast
    primary_prompt...
    negative_prompt
    resolution1024 × 1024 (Square)
    num_images1
    seed0
    schedulerDefault for model
    override_steps-1
    override_cfg-1.0
    override_shift-1.0
    override_width0
    override_height0
    use_uncensored_llmfalse
    clip_l_prompt
    openclip_prompt
    t5_prompt
    llama_prompt
    llm_system_promptYou are a creative AI assistant that helps create detailed, vivid images based on user descriptions.
    clip_l_weight1.0
    openclip_weight1.0
    t5_weight1.0
    llama_weight1.0
    max_length_clip_l77
    max_length_openclip77
    max_length_t5128
    max_length_llama128

    The reason this pack still exists

    HiDreamSampler is the easy node. HiDreamSamplerAdvanced is the one the author kept the whole pack alive for - and it's where the model's biggest quirk lives. HiDream-I1 conditions on not one or two but four text encoders: CLIP-L, OpenCLIP, T5, and Llama-3.1-8B-Instruct. The base sampler feeds all four the same prompt and calls it a day. This node lets you give each encoder its own prompt, its own weight, and its own token budget, then mix them however you like.

    In practice that's both the power and the trap. The default behavior - everything at weight 1.0, the primary_prompt going to all encoders - is honestly fine and produces the prompt-adherence the model is known for. The four per-encoder *_prompt fields are for when you discover that T5 and Llama read a complex prompt differently and you want to split the labor: a terse structural prompt for the CLIP-class encoders, a long descriptive one for T5 and Llama.

    What you actually set

    Everything from the base HiDreamSampler is here - model_type, resolution, num_images, seed, scheduler, and the override_steps/override_cfg/override_shift trio (all -1 = model defaults, and remember dev/fast run guidance-free). What's new:

    • primary_prompt and negative_prompt - the main prompt, plus the optional per-encoder overrides in clip_l_prompt, openclip_prompt, t5_prompt, and llama_prompt. Leave the per-encoder fields empty and the primary prompt goes everywhere.
    • The *_weight sliders - clip_l_weight, openclip_weight, t5_weight, llama_weight, each 0–5. Muting a weak encoder (usually by dropping CLIP-L or OpenCLIP toward 0) is a real, testable lever for changing output character.
    • The max_length_* fields - cap each encoder's context. Defaults are 77 for CLIP-L and OpenCLIP, 128 for T5, 128 for Llama; the node lets you push T5 to 512 and Llama to 2048. Long prompts that get truncated in the base node can actually breathe here.
    • llm_system_prompt - the prompt template handed to the Llama encoder. Defaults to a "creative AI assistant" line; this is where you'd steer how the LLM interprets and elaborates your prompt.
    • use_uncensored_llm - swaps in an uncensored Llama build. The README's warning is blunt: it is not quantized, so on most cards it OOMs. It exists because people asked; it is not a safe default.

    Output is the same single image tensor - PreviewImage or SaveImage as usual.

    The honest recommendation

    Unless you're chasing a specific failure - a prompt the base node mangles, or an aesthetic you can't get from weight 1.0 everywhere - start with HiDreamSampler and come here only when you have a hypothesis. When you do come, change one encoder at a time; changing four sliders and three prompts at once will teach you nothing about which one mattered. The *_weight sliders are the most predictable lever and the max-length fields the most useful for long prompts. The uncensored toggle, as noted, is a memory bomb with a purpose.

    Install and gotchas

    Same pack, same installation as its sibling: ComfyUI Manager search "HiDream Sampler", or clone https://github.com/lum3on/comfyui_HiDream-Sampler into custom_nodes, pip install -r requirements.txt, restart. Weights (NF4 builds from azaneko, plus a 4-bit Llama encoder) download on first generation. Watch out for the pack's known sharp edges: installs on Python 3.12 historically broke over auto-gptq until the pack moved to gptqmodel (make sure yours is >=2.0.0), the stop button can't cancel a running generation, and full-precision model tiers need ~27GB VRAM while the NF4 builds run in ~15GB. And keep the model-family straight: this runs HiDream-I1, the 17B latent model from 2025 - not the newer, unrelated HiDream-O1.

    CategoryHiDream

    Inputs (26)

    NameTypeDefaultDescription
    model_typeCOMBOfast3 options: full, dev, fast
    primary_promptSTRING...
    negative_promptSTRING
    resolutionCOMBO1024 × 1024 (Square)7 options: 1024 × 1024 (Square), 768 × 1360 (Portrait), 1360 × 768 (Landscape), 880 × 1168 (Portrait), 1168 × 880 (Landscape), 1248 × 832 (Landscape), +1
    num_imagesINT10–8
    seedINT00–18446744073709550000
    schedulerCOMBODefault for model5 options: Default for model, UniPC, Euler, Karras Euler, Karras Exponential
    override_stepsINT-1-1–100
    override_cfgFLOAT-1.0-1–20
    override_shiftFLOAT-1.0-1–20
    override_widthINT00–4096
    override_heightINT00–4096
    use_uncensored_llmBOOLEANfalse
    clip_l_promptoptSTRING
    openclip_promptoptSTRING
    t5_promptoptSTRING
    llama_promptoptSTRING
    llm_system_promptoptSTRINGYou are a creative AI assistant that helps create detailed, vivid images based on user descriptions.
    clip_l_weightoptFLOAT1.00–5
    openclip_weightoptFLOAT1.00–5
    t5_weightoptFLOAT1.00–5
    llama_weightoptFLOAT1.00–5
    max_length_clip_loptINT7764–218
    max_length_openclipoptINT7764–218
    max_length_t5optINT12864–512
    max_length_llamaoptINT12864–2048

    Outputs (1)

    NameTypeDescription
    imageIMAGE