Save Conditioning
Re-Encode That Prompt Every Run? Not Anymore.
- conditioning
Every time you hit Queue, ComfyUI runs your prompt through the text encoder all over again. On a plain SD 1.5 or SDXL setup that's cheap enough that nobody notices - but the moment your checkpoint leans on a big LLM-style text encoder (Gemma or Qwen on LTXV, Flux's T5, any of the GGUF quantized encoders people run to fit them on smaller cards), that encoding pass is real work. And on low-VRAM rigs the encoder is often the bottleneck rather than the diffusion model. If you're batching a hundred images with the same prompt - a colorization job, a consistent style test, an upscale pass - you're paying for that encode a hundred times.
SaveConditioning, from the nicehero/comfyui-conditioning-saver pack, is the small dumb fix for exactly that. It takes a CONDITIONING input and writes it to a .cond file on disk. LoadConditioning (the other half of this pair) reads it back later and hands you the same tensors, so you skip the encoder entirely.
How it works is delightfully simple. The node calls torch.save() on whatever conditioning it's handed - that list of (embeds, pooled) pairs CLIPTextEncode produces - and drops the result into output/conditioning/. The filename gets a counter suffix (ComfyUI_00001_.cond, then _00002_, and so on), so it never overwrites a previous save. It's flagged as an output node, which just means it's a terminal: it takes a CONDITIONING wire, saves the file, and sends nothing onward.
Only two inputs, and a beginner really only sets one:
- conditioning - whatever CONDITIONING you'd normally feed into KSampler's positive or negative. Wire it from CLIPTextEncode, a prompt scheduler, anywhere.
- filename_prefix - defaults to
conditioning/ComfyUI. Note that prefix already contains a subfolder, so files land inoutput/conditioning/with zero effort on your part.
Install is as painless as this pack is. In ComfyUI Manager, search "ComfyUI Conditioning Saver" and hit install. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/nicehero/comfyui-conditioning-saver
Then restart ComfyUI. There are no model downloads and no real dependencies beyond torch, which ComfyUI already ships - the whole pack is two node classes and a README, MIT-licensed.
The one trap that will bite you: save writes to output/conditioning/, but the loader reads from input/conditioning/. The README's flow is save, run, move the file across, then load. Forgetting the move is the classic "I saved it, why can't I load it" moment, because nothing in the UI tells you the two directories are different. Also worth knowing: a .cond is a raw pickle of the conditioning tensors, so it's architecture-bound - a conditioning saved from an SDXL prompt is not going to make sense in a Flux workflow. Keep these files paired with the model that encoded them, treat them as cache, and don't load .cond files from strangers. Save your own prompts, reuse them, and let the encoder idle.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | — | |
| filename_prefix | STRING | conditioning/ComfyUI | — |
Outputs (0)
No outputs