Training Captions To Conditioning
Turn a folder of captions into training conditioning, no copy-paste
- clip
- conditioning
Most ComfyUI users will never touch a training node, and this one is squarely aimed at the ones who do. Training Captions To Conditioning is the glue step in Sage Utils' training pipeline: it takes a list of captions and a CLIP model and turns them into actual CONDITIONING vectors. If you're encoding a dataset's captions once before a training run - the modern "cache your text embeddings" move that any serious LoRA trainer will tell you is the biggest speed lever available - this is how you do it inside ComfyUI instead of bolting together five nodes.
The mechanics are straightforward and worth knowing. You give it a clip (a text encoder) and captions (a string, one caption per line), and it walks each caption through the CLIP model: tokenize, encode, collect the conditioning. Two details make it friendlier than rolling this yourself. First, it normalizes a plain string into a list for you, so you can paste a block of captions directly instead of fighting over list types. Second - the nice one - blank lines don't error out; they get encoded as an empty conditioning instead, which is exactly the behavior you want when some images in a dataset legitimately have no caption text. At the end you get a single conditioning output carrying every encoded caption, ready to feed whatever consumes it.
Two real-world caveats. The clip input must actually contain a text encoder, and the node's error message when it doesn't is refreshingly blunt: it tells you "your checkpoint does not contain a valid clip or text encoder model." So if you're pulling CLIP from a model that ships without one (some newer architectures only bundle the diffusion weights and expect a separate text encoder), grab a proper CLIP loader first. And be aware this is one piece of a pipeline: it pairs with Sage Utils' own Load Dataset From Folder node (which hands it batch captions and filenames) and sits under the Sage Utils/train menu. If you're training with an external tool like ai-toolkit or OneTrainer, you don't need this at all - this is for people building training workflows inside ComfyUI itself.
If you're new to training, a warning before you over-invest here: the conditioning this produces is only as good as your captions, and the KB's training lore is unambiguous that dataset curation beats every knob. Encoding a badly captioned set faster just means you get bad results faster.
Install is the pack standard - ComfyUI Manager (search "Sage Utils") or:
cd ComfyUI/custom_nodes
git clone https://github.com/arcum42/ComfyUI_SageUtils.git
cd ComfyUI_SageUtils && pip install -r requirements.txt
Then restart ComfyUI. No model downloads for the node itself; the only real dependency in that requirements file is dynamicprompts, used by the pack's prompt builder. If you've installed the pack for the LLM sidebar, you may also notice startup log lines about LM Studio/Ollama connections when those local providers aren't running - harmless noise, unrelated to this node.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | CLIP model conditioning input used to encode training captions. | |
| captions | STRING | List of captions to encode into conditioning vectors. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |