Text Encode with Flux2 dev System Prompt
Text Encode That Lets You Drop a System Prompt Into Flux2 dev
- clip
- CONDITIONING
Flux 2 dev is the big one - a 32B transformer paired with a 24B Mistral-3 vision-language encoder, and that encoder reads your prompt as an instruction, not a bag of tags. UC_TextEncodeFlux2SystemPrompt is a text encode node that wraps your prompt in the exact Llama-style system/instruction template dev expects, with a system message of your choice. It's the difference between "here's my prompt" and "here's the role, now here's my prompt."
Why you'd use it
The stock Core text encode for Flux2 handles the template for you, but it doesn't give you a system prompt slot. That matters because dev's VLM encoder is a chat model: the system message sets the persona and constraints ("you are an image-editing expert, keep the composition identical"), and the user prompt carries the actual request. This node is the version that exposes both. Pair it with UC_SystemMessagePresets and you've got one dropdown supplying the role while your main prompt stays clean.
How it works
Give it a clip (the Flux2 dev text encoder - the Mistral-3 VLM, loaded as a CLIP), a prompt, and a system_prompt. When system_prompt is non-empty, it builds the Llama-style template:
[SYSTEM_PROMPT]<your system message>[/SYSTEM_PROMPT][INST]<your prompt>[/INST]
then tokenizes with that template and encodes from tokens - so the encoder sees a proper chat turn with role framing. Leave system_prompt empty and it falls back to a plain clip.tokenize(prompt) encode, matching what the basic encoder does. Either way the output is a single CONDITIONING tensor, wired to the positive input of a KSampler / SamplerCustomAdvanced the same way as any other text encode.
Both prompt and system_prompt support dynamic prompts ({wildcard}-style syntax), which is a genuinely nice touch - your system message can vary per run too.
Installing it
It ships in ComfyUI-UtilsCollection (author: silveroxides):
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection
Restart ComfyUI, or install "ComfyUI-UtilsCollection" via Manager. The pack's only requirements are opencv-python and typing-extensions - the encoding itself runs through ComfyUI core's CLIP machinery.
What to watch for
The usual LLM-encoder rules apply, and they're harsher here than on SDXL. Prompt weighting like (word:1.3) is silently discarded by this encoder path - that's a Mistral-3/VLM encoder thing, not a bug in this node. Write full sentences with explicit structure, don't spam quality tags, and remember dev is heavy: the 24B encoder alone is most of the 56B total footprint, so check your VRAM budget before you blame the node. If you're on Klein or a smaller model, this node isn't the right encode - the pack has dedicated system-prompt encodes for those too.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| prompt | STRING | — | |
| system_prompt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |