Nodes/comfyui-conduit-optimizer/Conduit Embedding Cache
ComfyUI Node

Conduit Embedding Cache

Stop re-encoding the same prompt

By JosephOIbrahim·Created 8 months ago·Updated 8 months ago· 1
Conduit Embedding Cache
  • clip
  • positive
  • negative
  • cache_status
positive_prompt
negative_prompt
force_recomputefalse

If you've ever farmed 40 seeds with the same prompt and watched the CLIP text encoder run its whole pass 40 times, Conduit Embedding Cache is for you. It wraps the standard CLIP encode so that the conditioning for a given prompt is computed once and served from memory on every repeat. In the seed-farming loop - same prompt, new seed, 100 runs - it's the single most practical node in the Conduit pack, because it removes a chunk of work that is genuinely identical every single time.

How it works

The node has three required inputs: clip, positive_prompt, and negative_prompt. It hashes each prompt string and checks an in-memory LRU cache (100 entries) before encoding. On a hit, it returns the stored conditioning with zero CLIP work; on a miss, it runs clip.tokenize + clip.encode_from_tokens and stores the result. Each prompt is cached independently, so you can change the negative or the positive alone and only the changed one re-encodes. The third output, cache_status, is a STRING reporting which side hit or missed plus the current hit rate:

positive: HIT | negative: HIT | Hit rate: 92.0%

The node returns positive and negative as standard CONDITIONING outputs, so it drops straight into your KSampler's positive/negative slots, replacing the CLIPTextEncode nodes.

There's one optional input worth knowing: force_recompute (default false, tooltip "Force recompute even if cached"). Tick it and the cache is bypassed for that run - the escape hatch when you suspect staleness.

Where the wins are

Realistic expectation check: CLIP encoding is fast relative to sampling, so this shines in specific patterns - high-volume seed farming, batch grids that share a prompt, or workflows with a huge or LLM-driven text encoder (the KB notes the encoder is often the VRAM/quality bottleneck on modern setups, not the diffusion model). If a single generation is 20 steps of diffusion, the saved encode is a rounding error; if you're doing 50 runs, it adds up.

Common issues

The one to actually remember: the cache key is the prompt string, not the CLIP. Swap checkpoints mid-session and the cached conditioning from the old CLIP can be served to the new model, quietly. After any model change, either hit force_recompute once or clear the cache with ConduitCacheClear. Also, the cache is in-memory - restart ComfyUI and it's gone (that's fine, not a bug). And if you're the deterministic type, note the conditioning itself is a float tensor; it's cached exactly, which is what makes the reproduction so clean.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/joe002/comfyui-conduit-optimizer

Or ComfyUI Manager → search "comfyui-conduit-optimizer" → restart. No model downloads; PyTorch 2.0+ is the only dependency, and startup should log [CONDUIT] v1.1.0 loaded: 13 optimization nodes.

How to use it

Replace your two CLIPTextEncode nodes with one Conduit Embedding Cache: feed it the same CLIP, the same positive and negative prompt text, and wire its positive/negative outputs into your sampler. Keep the cache warm by not changing prompts between runs - which is exactly what seed farming wants anyway.

CategoryConduit/Cache

Inputs (4)

NameTypeDefaultDescription
clipCLIP
positive_promptSTRING
negative_promptSTRING
force_recomputeoptBOOLEANfalseForce recompute even if cached

Outputs (3)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING
cache_statusSTRING