Nodes/ComfyUI-UtilsCollection/Text Encode with Flux2 dev System Prompt (Legacy)
ComfyUI Node

Text Encode with Flux2 dev System Prompt (Legacy)

The system prompt slot Flux 2 dev actually wants

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
Text Encode with Flux2 dev System Prompt (Legacy)
  • clip
  • CONDITIONING
prompt
system_prompt

Flux 2 dev is the quality ceiling for local image editing - if you have the VRAM for a ~56B stack, nothing open locally beats it for multi-reference edits and complex-prompt following. But its text encoder is a Mistral-class LLM, and it's trained with a chat template: the model expects your prompt wrapped in [SYSTEM_PROMPT]…[/SYSTEM_PROMPT][INST]…[/INST] brackets. Type a plain sentence into a stock CLIP Text Encode and you're feeding it untemplated text - workable, but you're leaving the system-prompt channel unused. This node exists to give Flux 2 dev its proper wrapper, system prompt and all.

How it works

Feed it three things: clip (your Flux 2 dev CLIP), prompt (the actual edit request or description), and system_prompt (the instructions that set how the model should behave). The node wraps your prompt in the Mistral-style template - [SYSTEM_PROMPT][/SYSTEM_PROMPT][INST][/INST] - tokenizes through your clip, and encodes to CONDITIONING, ready for a KSampler.

Leave system_prompt empty and it simply encodes the bare prompt with no template wrapper, so the node degrades gracefully to a plain encode. Fill it in and you're speaking the model's native format - the same bracket structure BFL's own workflows use. If you don't want to hand-write that system message, the pack's SystemMessagePresets node produces ready-made strings to drop into this input.

The one output is CONDITIONING, which feeds your sampler like any other text encode.

What you get out of it

On Flux 2 dev specifically, the system prompt does real work - the model is trained to take editing instructions in a specific voice ("convert editing requests into one concise instruction… preserve composition, keep identity"). Supplying that voice as a system message, in the template the model was trained on, is how you get the behavior the model is capable of. This node is the smallest possible way to get that right: the wrapper is exactly the model's format, no guessing.

One honest note: this is the plain version. The pack also ships ScaledBiasTextEncodeFlux2SystemPrompt, which does the same templating plus parses <tag=strength> per-token bias syntax in your prompt. If you never use that syntax, this node is the one you want - same output, simpler.

Where people get burned

  • The CLIP must be Flux 2 dev's encoder. Feed it a random checkpoint's clip and the template won't match what it was trained on.
  • system_prompt is a STRING input, so the pack's preset nodes (or a text node) wire right in.
  • It's a conditioning encoder - it can't run without a sampler downstream.

Installing it

Ships in silveroxides/ComfyUI-UtilsCollection. ComfyUI Manager: search ComfyUI-UtilsCollection, install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection
cd ComfyUI-UtilsCollection
pip install -r requirements.txt   # opencv-python, typing-extensions

Restart. No model downloads for the node itself - Flux 2 dev's weights are their own thing. This is the legacy alias of UC_TextEncodeFlux2SystemPrompt; the "(Legacy)" tag just preserves old workflow references.

Categoryadvanced/conditioning

Inputs (3)

NameTypeDefaultDescription
clipCLIP
promptSTRING
system_promptSTRING

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING