HiDream Sampler (Advanced)
Drive all four text encoders, if you dare
- image
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, andllama_prompt. Leave the per-encoder fields empty and the primary prompt goes everywhere. - The
*_weightsliders -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.
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| model_type | COMBO | fast | 3 options: full, dev, fast |
| primary_prompt | STRING | ... | — |
| negative_prompt | STRING | — | |
| resolution | COMBO | 1024 × 1024 (Square) | 7 options: 1024 × 1024 (Square), 768 × 1360 (Portrait), 1360 × 768 (Landscape), 880 × 1168 (Portrait), 1168 × 880 (Landscape), 1248 × 832 (Landscape), +1 |
| num_images | INT | 10–8 | — |
| seed | INT | 00–18446744073709550000 | — |
| scheduler | COMBO | Default for model | 5 options: Default for model, UniPC, Euler, Karras Euler, Karras Exponential |
| override_steps | INT | -1-1–100 | — |
| override_cfg | FLOAT | -1.0-1–20 | — |
| override_shift | FLOAT | -1.0-1–20 | — |
| override_width | INT | 00–4096 | — |
| override_height | INT | 00–4096 | — |
| use_uncensored_llm | BOOLEAN | false | — |
| clip_l_promptopt | STRING | — | |
| openclip_promptopt | STRING | — | |
| t5_promptopt | STRING | — | |
| llama_promptopt | STRING | — | |
| llm_system_promptopt | STRING | You are a creative AI assistant that helps create detailed, vivid images based on user descriptions. | — |
| clip_l_weightopt | FLOAT | 1.00–5 | — |
| openclip_weightopt | FLOAT | 1.00–5 | — |
| t5_weightopt | FLOAT | 1.00–5 | — |
| llama_weightopt | FLOAT | 1.00–5 | — |
| max_length_clip_lopt | INT | 7764–218 | — |
| max_length_openclipopt | INT | 7764–218 | — |
| max_length_t5opt | INT | 12864–512 | — |
| max_length_llamaopt | INT | 12864–2048 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |