Image Cache Miss Gate
A gate that skips the expensive branch when the cache is already good
- signal
- depends_on_cache
- signal
This is the silent half of the Image Batch Cacher pair. The cacher decides whether the expensive branch actually runs; Image Cache Miss Gate decides whether the thing that feeds it fires at all.
Think of it as a firewall on a single wire. It checks the same cache_dir and cache_name as a matching Image Batch Cacher and only passes signal through when that cache file is missing or stale. When the cache exists and its dependency still matches, it returns an ExecutionBlocker - a silent stop, not an error - so anything downstream never runs. It has no image input and no image output; it moves a signal, nothing else.
Why you'd bother, when the cacher already short-circuits
The cacher only protects the branch directly feeding its images input. If some other part of the graph connects into that expensive branch behind the cacher's back - say a seed wired straight into a sampler that then feeds the branch - ComfyUI sees that wire and runs the branch whether the cache hits or not. That's the failure mode this node exists for, and the README's example is exactly it:
seed -> Image Cache Miss Gate signal -> sampler noise_seed
Image Cache Miss Gate cache_name/cache_dir match Image Batch Cacher cache_name/cache_dir
sampler frames -> Image Batch Cacher images -> downstream
Use the gate before an expensive branch when you want extra protection against accidental direct links into it. Notably, the gate intentionally uses its own cache settings instead of a cache_ref wire: a visual link from the cacher back into a gate upstream of the same branch can be treated as a real dependency by ComfyUI's graph validation and create a cycle. Same cache_name and cache_dir on both nodes is the contract.
Inputs and output
signal(any): passed through only on a cache miss; blocked on a hit.cache_name(defaultstage_1) andcache_dir(defaultimage_cache): must match the cacher.depends_on_cache(optionalIMAGE_CACHE_REF): for derived caches.
Output: signal, nothing else.
For derived caches - interpolated frames built from sampler frames, say - connect the upstream cacher's cache_ref output into this node's depends_on_cache (and into the downstream cacher's). That makes the derived cache go stale whenever the sampler-frame cache is deleted or regenerated, instead of quietly serving frames from the wrong source.
Installing it
Same pack as the cacher, so one install gets you both. ComfyUI Manager (search "Image Cache Miss Gate"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/boobkake22/ComfyUI-ImageBatchCacher
Restart ComfyUI. No extra dependencies beyond ComfyUI's own torch and safetensors, and no model files to fetch - it's a tiny pack under Flow/Execution.
The honest take: on its own the gate does literally nothing; it's a valve, not a pipeline. You reach for it when a workflow keeps surprising you by re-running an expensive branch because of a wire you forgot about, or when you want the signal into a sampler blocked on a hit so nothing downstream side-effect fires twice. If your graph is clean and you always feed the cacher directly, you can probably skip it. If you've ever burned ten minutes re-running an 81-frame video branch over one loose connection, you'll be glad it exists.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| signal | * | — | |
| cache_name | STRING | stage_1 | — |
| cache_dir | STRING | image_cache | — |
| depends_on_cacheopt | IMAGE_CACHE_REF | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| signal | * | — |