Nodes/ComfyUI-MAINodes/H3 Trajectory Bank (checkpoint every step)
ComfyUI Node

H3 Trajectory Bank (checkpoint every step)

Checkpoint your sampling run every step, so branching isn't a re-run

By matlowai·Created 17 days ago·Updated about 17 hours ago· 112
H3 Trajectory Bank (checkpoint every step)
  • sampler
  • SAMPLER
dump_dir/tmp/h3_trajectory
every_n1

H3 Trajectory Bank is the "save state" node of the MAINodes pack, and it's aimed at a workflow pain anyone who's iterated on a long video render knows: you run 25 steps, decide the tail is wrong, and re-run the whole thing because there's no way to pick up mid-sampling. This node wraps your sampler and writes the trajectory latent - x_t, the noisy state the sampler actually carries - to disk after every step, along with the sigma schedule. Pair it with H3 Trajectory Load and you can branch from any saved step without recomputing the head: swap the model, the LoRA, the guider, or the remaining schedule, and continue from where the run stopped.

How it works

It's a sampler wrapper, so it sits around your existing sampler rather than replacing it:

  • sampler - your SAMPLER input, passed through unchanged.
  • dump_dir - where checkpoints land (default /tmp/h3_trajectory). Note the default: on most Linux installs /tmp is a RAM disk, so if you want the bank to survive a reboot, point it at real disk.
  • every_n - save every Nth step (default 1; the last step is always saved regardless).

Output is the wrapped SAMPLER, so wiring is transparent. The size math is friendly: about 7 MB per step for a 5 s 1024 clip, so a full 25-step run banks under 200 MB. That's cheap enough that every_n 1 is the sane default - the whole point is having every step available.

Why you'd actually use it

The canonical move: run a 25-step pass to a checkpoint you like at step 18, then swap the tail - a different scheduler, a LoRA on the second half, a guider with a tighter scale - and let it finish from 18 instead of re-doing 0-18. On a video model where each step costs seconds to tens of seconds, that's not a nicety, it's the difference between an afternoon of iteration and an hour. The bank is also the honest debugging tool: when a run dies at step 21, you don't lose the 21 steps you paid for; you reload at 21 and continue with the thing that changed.

Install

Ships with matlowai/ComfyUI-MAINodes:

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

Restart, under sampling/custom_sampling/samplers. No extra Python deps; you need MiniMax-H3 weights and ComfyUI's H3 support (check the licence's US/EU/UK/Korea carve-outs before committing to the stack).

The trap: a banked run and its load must agree on geometry. H3 Trajectory Load will happily read a checkpoint and hand you latents + sigmas, but if you changed the latent's shape between bank and load (different resolution, different frame count), the "resume" is a lie - it's a corrupt start. Keep the latent shape fixed across the branch and everything else is fair game.

Categorysampling/custom_sampling/samplers

Inputs (3)

NameTypeDefaultDescription
samplerSAMPLER
dump_dirSTRING/tmp/h3_trajectory
every_nINT11–25save every Nth step (last step always saved)

Outputs (1)

NameTypeDescription
SAMPLERSAMPLER