⭐ Star CLIP Prompt Refiner
A local LLM in your graph, no Ollama and no API key
- clip_override
- image1
- video
- audio
- result
- think_output
The name is wrong, in a good way
It says CLIP and it isn't CLIP - there's no contrastive text-image model in here. ⭐ Star CLIP Prompt Refiner loads a text encoder out of models/text_encoders as a language model and lets it write your prompt, using the same pipeline as ComfyUI's native Generate Text node (clip.tokenize → clip.generate → clip.decode), with the loader baked in and a stack of system-prompt presets on top.
Why you'd reach for it: on Z-Image, Klein, Krea 2 and most 2026 models the text encoder is a small Qwen3 instruct LLM. Reusing that same file as your prompt writer means no second model, no Ollama server process, no llama-cpp-python build to match your system, no API key, no refusal on the far end - and ComfyUI already handles loading and offloading it.
The trade-off: it isn't a chat window - one shot per run, no history. And the consensus on enhancers is well-earned cynicism: LLM-written prompts carry noise, and a prompt you wrote by hand usually beats one a model invented. It's best when the LLM polishes and structures rather than doing the thinking for you.
How it works
It loads your chosen checkpoint through comfy.sd.load_clip, then feeds the model a chat-formatted token stream with system_prompt replacing the system prompt in the model's chat template. Your sampling settings go to clip.generate, and the returned text is split on </think> - reasoning before it, answer after - hence two outputs.
IS_CHANGED is the quiet part worth knowing. With use_seed on it caches like any other node: queue twice with identical inputs, get the identical prompt back. Turn it off and it re-runs on a fresh random seed every queue.
The inputs that matter
- clip_name - dropdown of everything in
models/text_encoders. Defaults toqwen3-vl-4b-heretic_int8.safetensors; if that file isn't there it falls back to the first entry in your folder, so don't be surprised by what's pre-selected. - prompt - your rough idea.
- system_prompt_preset - the reason to use this over the native node. 29 choices:
Customplus 28 shared presets (Flux2(Klein) SysPrompt,Krea2 Image Prompt Refiner,Character Sheet Expert SFW/NSFW), read fromjson/startext.json- the same file Star Easy-Text-Storage and Star Ollama Prompt Helper write to. Add one there, refresh, it appears here. - system_prompt - used when the preset is
Custom. Leave it blank and you silently get theFlux2(Klein) SysPromptpreset: a long, opinionated style guide about subject hierarchy, lighting-as-geometry and hex codes, written specifically for Qwen3 encoders. Read it before trusting it. - temperature (0.7), plus top_k, top_p, min_p, repetition_penalty and max_length (512). Temperature is the one you'll actually touch: ~0.4 for template-shaped output, 0.9 when you want it to riff.
max_lengthis a hard ceiling, and 512 tokens isn't always enough with thinking on. - thinking - leave it on. The author's own note: disabling it injects an empty think block into the template for Qwen3-VL heretic models, which then echo your prompt instead of answering.
Optional inputs: clip_override reuses a CLIP already loaded in the graph (dropdown ignored, no second copy of a 4B model in VRAM). image1 grows a slot as you connect, up to four, for vision-language encoders; batches flatten into individual reference images. video (24 FPS assumed, subsampled to 1 FPS) and audio only matter for models that accept them.
Outputs are result - the prompt, into a CLIP Text Encode or any text widget - and think_output, the reasoning. Read the second one when the first looks off; it tells you whether the model understood you.
Installing it
ComfyUI Manager, search Starnodes, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Starnodes2024/ComfyUI_StarNodes
cd ComfyUI_StarNodes
pip install -r requirements.txt
That requirements list is for the rest of the pack; this node needs none of it. What it needs is a text-generation-capable model in models/text_encoders. The default expects the heretic build of Qwen3-VL 4B in int8 - heretic is an abliteration method, refusals surgically removed, which is the only reason presets like the NSFW character sheets work. Comfy-Org publishes stock encoders into the same folder (qwen3vl_4b_bf16.safetensors, ~8.5 GB). Point this at a plain CLIP or T5 and you get errors, not a smarter prompt.
Where it goes wrong
It just repeats your prompt. Empty-think-block symptom - turn thinking back on. Still repeating? Lower the temperature and check that a Custom preset didn't get left blank and then overridden.
Chatter leaking into the prompt. Preset problem, not a bug. Pick one that says polish rather than expand, or end your Custom system prompt with "output the prompt and nothing else". The common complaint about every local enhancer - hand it an already-decent prompt and let it finish the job.
Prim or refused output. You're on a stock instruct encoder. Swap to an abliterated build - Qwen3-VL's refusals are a fine-tuning artifact, and running locally is the whole point.
VRAM. Two models load per workflow now - diffusion plus a 4B encoder. ComfyUI manages the offload; on a tight card use the int8 file and clip_override when that encoder already exists upstream.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| clip_name | COMBO | qwen3-vl-4b-heretic_int8.safetensors | Text encoder from models/text_encoders used as the language model. Vision-language models like Qwen3-VL can also read the reference images. |
| prompt | STRING | Your prompt text to send to the model. | |
| system_prompt_preset | COMBO | Custom | Choose a preset system prompt or 'Custom' to write your own. Presets are loaded from the shared text storage (json/startext.json). |
| system_prompt | STRING | Custom system prompt (used when preset is 'Custom'). Replaces the system prompt in the model's chat template. If left empty, the 'Flux2(Klein) SysPrompt' preset is used as default. | |
| use_seed | BOOLEAN | true | On: the seed below is used and the node caches its result when nothing changes. Off: a random seed is used every run, so the node always executes again even if the inputs did not change. |
| seed | INT | 00–2147483647 | Seed for reproducible output sampling (only used when 'use_seed' is on). |
| temperature | FLOAT | 0.700–2 | Higher values produce more creative output, lower values more focused/deterministic. |
| top_k | INT | 640–1000 | Limits sampling to the top-K most likely tokens. 0 disables the limit. |
| top_p | FLOAT | 0.950–1 | Nucleus sampling: only tokens within this cumulative probability are considered. |
| min_p | FLOAT | 0.050–1 | Minimum token probability relative to the most likely token. 0 disables. |
| repetition_penalty | FLOAT | 1.050–5 | Penalizes repeated tokens. 1.0 disables the penalty. |
| max_length | INT | 5121–32768 | Maximum number of tokens to generate. |
| thinking | BOOLEAN | true | Operate in thinking mode if the model supports it. The reasoning is returned on think_output. Note: with some Qwen3-VL models (e.g. heretic) turning this off injects an empty think block that can confuse the model - keep it on if output looks wrong. |
| clip_overrideopt | CLIP | Optional: use an already loaded text encoder (CLIP) from the workflow instead of loading the model from the dropdown. The clip_name dropdown is ignored while this is connected. | |
| image1opt | IMAGE | Optional reference image for vision language models. Connecting an image adds another slot (up to 4). | |
| videoopt | IMAGE | Video frames as image batch. Assumed to be 24 FPS; subsampled to 1 FPS internally. Only used by models that support video (e.g. Gemma 4). | |
| audioopt | AUDIO | Audio input, e.g. from a Load Audio node. Only used by models that support audio (e.g. Gemma 4). |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| result | STRING | — |
| think_output | STRING | — |