Nodes/ComfyUI-ARZUMATA/CachingCLIPTextEncodeFlux|ARZUMATA
ComfyUI Node

CachingCLIPTextEncodeFlux|ARZUMATA

The Flux CLIP encoder that caches — your T5 encode runs once, not every render

By ARZUMATA·Created 2 years ago·Updated 3 months ago· 5
CachingCLIPTextEncodeFlux|ARZUMATA
  • clip
  • CONDITIONING
clip_l
t5xxl
cache_limit10
guidance3.5

Here's a Flux annoyance nobody warns you about: the text encode isn't free. Flux conditions on two encoders - CLIP-L for your tag-style prompt and T5-XXL for the natural language - and T5 is a several-billion-parameter language model. Encoding it takes real seconds, every single render, even when your prompt hasn't changed by a character. CachingCLIPTextEncodeFlux|ARZUMATA is the node that remembers what it encoded so the T5 pass happens once instead of every time.

This is the flagship of the ARZUMATA pack - it's the first thing in the README, and it's the one with an actual reason to exist. The idea: cache the CLIP-to-CONDITIONING conversion keyed on your two text inputs and the CLIP model, and on a cache hit skip the encode entirely. The author credits discus0434's comfyui-caching-embeddings as the inspiration, and the mechanism is basically the same hash-and-store approach, tuned for Flux's dual-encoder setup.

The inputs

  • clip - your Flux CLIP (the dual CLIP-L + T5-XXL loader output).
  • clip_l - the short, tag-style prompt (the one people use commas in, per the standard advice: tags for CLIP-L, full sentences for T5).
  • t5xxl - the natural-language prompt.
  • guidance - the Flux guidance value, default 3.5. That matches the Flux Dev convention (it's a real "guidance", not CFG - the KB's advice is to keep it around 3.5 and understand it isn't CFG).
  • cache_limit - how many prompt+model combos to keep, 1–100, default 10. Oldest evicted first.

One output: CONDITIONING, wired straight into the Flux sampler's conditioning input like the stock node.

What the caching actually covers

The hash covers clip_l + t5xxl + the CLIP object's identity. Change either text field and it re-encodes; keep them the same and it serves the cached result. Two details make this smarter than a naive cache:

  • Guidance is NOT part of the cache key. You can scrub the guidance slider freely and it won't invalidate anything - the node just re-applies the current value to the cached conditioning. That's the right call, because guidance is a per-render taste knob, not a per-prompt property.
  • Switching CLIP models doesn't destroy old entries. Per the README, the cache keeps entries per model - switch back to a previous CLIP and its encoding is still warm. Handy if you A/B two CLIP variants on the same prompt.

The practical win: batch queues, seed hunting, or any workflow where the prompt is fixed and you're re-rendering dozens of times. In those, the T5 encode - the single slowest non-sampling step in a Flux run - happens once and is then free. If you change the prompt every render, this node does nothing for you, which is fine; it's just not aimed at you.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/ARZUMATA/ComfyUI-ARZUMATA

Restart, or install via ComfyUI Manager by searching ComfyUI-ARZUMATA. No extra Python deps, no model downloads - the cache is in-memory per node instance and doesn't survive a restart.

Gotchas

  • The cache is per-node and in-RAM. Copy the node and each copy caches separately; restart ComfyUI and it starts cold. If you wanted a disk-persistent cache across sessions, this isn't it.
  • Dynamic prompts are enabled, so wildcard-heavy prompts each spawn their own cache entry and will churn the limit. Raise cache_limit if you see constant re-encoding.
  • It's a small personal pack with zero community test coverage. The mechanism is straightforward enough to trust, but don't expect anyone to fix it if your ComfyUI version changes something.
  • One subtle thing: the cached conditioning is pinned to the CLIP it was encoded with. If you swap in a radically different CLIP with the same text, you get a new entry - correct behavior, but it's why cache memory grows with experimentation.

If you run Flux with a fixed prompt and long queues, this is the node in the pack worth installing the whole thing for. Everything else in ComfyUI-ARZUMATA is a grab-bag; this one pays rent.

Categoryadvanced/conditioning/flux

Inputs (5)

NameTypeDefaultDescription
clipCLIP
clip_lSTRING
t5xxlSTRING
cache_limitINT101–100
guidanceFLOAT3.50–100

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING