Nodes/ComfyUI_DW_Chat/Gemini Flux Prompt
ComfyUI Node

Gemini Flux Prompt

Clip-L and clip-T5, pre-separated

By yiwangsimple·Created 2 years ago·Updated about a year ago· 89
Gemini Flux Prompt
  • image_input
  • clip_L
  • clip_T5
text_input

Here's the thing most Flux newcomers miss: a Flux prompt isn't one string. It goes through two text encoders - CLIP-L for keyword-style tags and T5 for long natural-language sentences - and the node that builds the conditioning typically takes them as separate inputs. This node is the pack's answer to that. It asks Gemini 1.5 Flash to write you a prompt in a strict two-part format, then splits the reply on the clip-L: and clip-T5: markers and hands you back two clean STRING outputs that map directly onto Flux's dual encoder inputs.

The mechanism is a big, opinionated system prompt in the source. It tells Gemini it's an "artistic Stable Diffusion prompt assistant," demands both sections, requires English, forces face-detail tags like "extremely detailed eyes and face," asks for at least five scene details, and mandates material, art style, color and lighting coverage. That's a lot of guardrails, and it does what it's meant to: consistent, structured Flux prompts instead of a wall of prose. There's a retry wrapper (3 attempts) and the proxy-stripping behavior shared with the other Gemini nodes, so transient failures usually just retry.

Inputs are minimal: text_input (your theme, multiline) and an optional image_input - feed it an IMAGE and it'll analyze the picture and merge that with your text instead of working from text alone. Outputs: clip_L and clip_T5, both STRING, which is exactly what Flux's dual CLIP loader and text-encode nodes want.

Installing and keys

cd ComfyUI/custom_nodes
git clone https://github.com/yiwangsimple/ComfyUI_GroqChat

restart, copy api_key.ini.exampleapi_key.ini, set GEMINI_API_KEY. And the pack's recurring gotcha - google-generativeai is missing from requirements.txt:

pip install google-generativeai

What to watch for

The parse is fragile in one way: it only splits on lines that start with clip-L: / clip-T5:. If Gemini ignores the format and writes a headerless paragraph, the node raises "API 未能生成有效的 clip-L 和 clip-T5 内容" and returns the error as text in both outputs - so a bad run is loud, not silent, which is the good kind of failure. And because this leans hard on a cloud model, your prompt quality is only as good as Gemini's mood that day; if you need something fully deterministic and local, Gemma2PromptNode in this pack does a similar split with a local model. For most Flux users though, this is the nicer tool: free-tier Gemini, no local GPU footprint, and outputs that drop straight into the standard Flux prompt path.

Category🌙DW/Gemini1.5

Inputs (2)

NameTypeDefaultDescription
text_inputSTRING
image_inputoptIMAGE

Outputs (2)

NameTypeDescription
clip_LSTRING
clip_T5STRING