Nodes/Nynxz H3/H3 Block Cache
ComfyUI Node

H3 Block Cache

Skip the stack when nothing changed

By Nynxz·Created about a month ago·Updated 25 days ago· 4
H3 Block Cache
  • model
  • MODEL
threshold0.08
max_consecutive3
start_percent0.15
end_percent0.95
verbosefalse

H3 is compute-bound - a 5-second clip costs real minutes, and the transformer stack is where almost all of it goes. H3 Block Cache is the pack's biggest single answer to that: on sampling steps where the model's output barely changes, it reuses the stack's own output from the last computed step. At aggressive settings that's skipping 49 of 50 blocks on those steps, and the README's own measurement is 80 seconds down to 30 on a 5s clip. That's the difference between iterating and waiting.

How it works

The cache watches block 0's residual - the earliest signal of how much the network's answer is moving. If the drift since the last computed step stays under threshold, the whole stack result is reused. threshold is an accumulated relative-L1 budget, which is the design detail that makes it portable: because it's relative and accumulated, the same number means the same thing at any resolution or duration.

The inputs that matter:

  • threshold (default 0.08) - 0 disables the cache entirely (exact no-op). 0.05–0.1 is usually free; past 0.2 motion smears. Start at 0.08, A/B it against 0.15.
  • max_consecutive (default 3) - never skip more than this many steps in a row, whatever the threshold says. The accumulator can drift for a long stretch of slow denoise; this is the floor under how often the model gets a real say.
  • start_percent / end_percent (0.15 / 0.95) - when caching switches on and off. Deliberately not 0 and 1: the first steps decide composition and motion and are the ones you least want reused, and leaving the last steps uncached keeps fine detail from inheriting a stale delta.
  • verbose - log a line per stack pass saying whether it skipped and why. The one-line summary prints either way.

The output is a MODEL you chain to your sampler, and the summary is worth reading - it tells you how much it actually skipped and what that saved.

Where it fits

It composes with the rest of the pack's sampling stack - the author suggests wiring it with H3 Sliding Window and friends, and H3 Scheduled Sampler can even tell the cache where it's allowed to skip rather than leaving it to guess from a denoise percentage. Note that with H3 Scheduled Sampler's split schedules, the cache's start_percent/end_percent get resolved against the unsplit curve, which is why that node carries its own cache_floor knob.

Install

Pack install: ComfyUI Manager → "Nynxz H3", or:

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

Restart. Pure Python, no dependencies, ComfyUI 0.30.0+.

The one-liner

This is the one sampling node to reach for first on H3 - the measured win dwarfs the others. Set threshold 0.08, leave the window where it is, and only push past 0.15 when you've confirmed your content survives it. And if a scene starts smearing, lower the threshold before you blame the sampler.

CategoryNynxz/H3/Sampling

Inputs (6)

NameTypeDefaultDescription
modelMODELA MiniMax H3 model. Passed through, patched.
thresholdFLOAT0.080–1How much block 0's residual may drift, accumulated since the last computed step, before the stack must run again. 0 disables the cache entirely (exact no-op). 0.05-0.1 is usually free; past 0.2 motion smears.
max_consecutiveINT31–20Never skip more than this many steps in a row, whatever the threshold says. The accumulator can drift for a long stretch of a slow denoise; this is the floor under how often the model gets a real say.
start_percentFLOAT0.150–1Denoise fraction caching switches on at. Not 0 by default on purpose: the first steps decide composition and motion, and they are the ones you least want reused.
end_percentFLOAT0.950–1Denoise fraction it switches off at. Leaving the last steps uncached keeps fine detail from being inherited from a stale delta.
verboseBOOLEANfalseLog a line per stack pass saying whether it was skipped and why, plus the drift distribution the threshold is being compared against. The one-line summary at the end of each run is printed either way.

Outputs (1)

NameTypeDescription
MODELMODEL