CLIPTextEncode - Smart Prompt
Keep your prompt structure, swap only the subject — a template node that actually works
- trigger
- clip
- POSITIVE +
You know the feeling: every image you make shares the same prompt skeleton - subject, then your go-to framing, then the style tags that never change. quadmoonSmartPrompt, the "CLIPTextEncode - Smart Prompt" node, is quadmoon's answer to that. You save the fixed structure once per model, then type only the variable part into this node each time. It's the positive-prompt mirror of the pack's Smart Negative, and the author flags it as WIP - so expect a rough edge or two, but the core idea is sound and genuinely saves copy-paste.
How it works
Like Smart Negative, it's scoped to a model via the SMART_TRIGGER output from the pack's Load Model - Smart node - a hash of the checkpoint filename that tells the node which model you're on. Your saved templates live in qmSmartNodesConfig.json in ComfyUI's working directory. The stored template keeps a placeholder where the variable goes; when you run this node it swaps your prompt_text into that spot with a regex, then encodes the result through the standard CLIP tokenize() / encode_from_tokens() path - the same mechanism as core CLIPTextEncode. If there's no saved template for your trigger, it just encodes whatever you typed, so the node never silently eats your prompt.
The inputs that matter
- prompt_text (STRING, multiline, required) - the variable part you actually type per image. This is the whole point: it's the only widget you touch each time.
- config_name (STRING, required) - again
forceInput, so you can't type a name in; wire it, usually fromLoad Config - Smart. - trigger (SMART_TRIGGER, required) - from
Load Model - Smart. - clip (CLIP, required) - your model's CLIP.
The single output is POSITIVE + (CONDITIONING), which goes into a KSampler's positive input or a Conditioning (Combine) node.
Setting it up
- Load the model with
Load Model - Smart, take the trigger output. Save Smart Prompt Configtakes three pieces - prompt start, the image content, prompt end - plus the trigger and a config name, and writes the template.- Wire this node's trigger, clip, and config_name (from
Load Config - Smart). - Type only the variable into
prompt_text. That's it.
Rough edges worth knowing
config_nameis forceInput - beginners always try to type into it. Wire it fromLoad Config - Smart.- Per-model keying bites twice. Templates are stored under the checkpoint filename hash, so renaming or moving the model orphans your saved templates.
- The leftover
|model.safetensorsquirk. Because the stored placeholder is the full trigger (hash|model.safetensors) and only the hash gets swapped, you can end up with something likea cat|v1-5-pruned.safetensorsstuck to your prompt after substitution. Harmless oddity, par for the WIP course - and you'll see it if you inspect the encoded text. - The config file lives in your ComfyUI launch directory, not the pack folder. Know where
qmSmartNodesConfig.jsonis before you assume it's gone.
Installing the pack
Install via ComfyUI Manager (search "quadmoon's ComfyUI nodes" or use Install via GIT URL with https://github.com/traugdor/ComfyUI-quadMoons-nodes.git), then restart ComfyUI:
cd ComfyUI/custom_nodes
git clone https://github.com/traugdor/ComfyUI-quadMoons-nodes.git
# then restart ComfyUI
No requirements.txt, no model files to fetch - the node needs nothing beyond ComfyUI's own CLIP machinery. One heads-up if you clone by hand: the repo pulls in jags111's efficiency-nodes as a git submodule for other nodes in the pack, so a plain clone can leave those siblings missing. Use git clone --recurse-submodules to be safe.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt_text | STRING | — | |
| config_name | STRING | — | |
| trigger | SMART_TRIGGER | — | |
| clip | CLIP | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| POSITIVE + | CONDITIONING | — |