Nodes/ComfyUI-MAINodes/H3 Mid Insert (change the token grid MID-denoise) [experimental]
ComfyUI Node

H3 Mid Insert (change the token grid MID-denoise) [experimental]

Insert token-times mid-denoise, so the coarse pass and the dense pass share one trajectory

By matlowai·Created 17 days ago·Updated about 16 hours ago· 112
H3 Mid Insert (change the token grid MID-denoise) [experimental]
  • samples
  • samples
  • hold_map
  • report
hold_map
noise_topup1.00
seed0
expand_to_endfalse
length0
sigma_s0.000

Experimental proof of concept, flagged off-distribution by the author themselves. Where the rest of the Motion Lab pack inserts extra token-times between two passes (coarse pass, then a fresh dense pass), H3 MidInsert does the insert in the middle of a single denoise: run the coarse grid down to a handoff sigma, insert the in-between tokens, and finish the schedule on the dilated grid. The model then decides the motion with the in-betweens already in the sequence, and the coarse pass is partial rather than finished.

How it works

You split the schedule with SplitSigmas - pass A runs the high half down to sigma_s - and hand the still-noisy latent to this node. It inserts the held token-times using the same grid arithmetic as H3 Temporal Insert (shared code, so the two routes can never disagree about which token-times exist). The clever bit is the init: lerping two noisy neighbours is variance-deficient, so noise_topup (default 1) adds fresh gaussian noise sized from the measured per-token, per-channel residual of the neighbours. 0 is raw lerp, 1 is full top-up, and the report prints the measured correlation and deficit so you can see how much of it was real motion vs. noise. Wire sigma_s in and it also prints the noise-only bound the flow parameterisation predicts, which is how you judge that.

The wiring rules, and they matter

This node is not plug-and-play, and the description is explicit about the two traps:

  • Pass B must use DisableNoise. Pass A's output has already been divided by 1 - sigma_s (inverse noise scaling). RandomNoise on pass B would add a second full noise draw on top and destroy the handoff. Zero noise makes noise_scaling multiply by 1 - sigma_s again and hand the sampler back exactly the state pass A left.
  • No noise mask, deliberately. A repaint mask re-noises from a clean latent every step, and this latent is not clean - it's already at sigma_s. Any noise_mask on the incoming latent is dropped.
  • Audio is passed through unchanged. It stays on the base clip's clock while the video moves onto the dilated one, so pass B sees an audio stream covering only part of the video span. Take the delivered audio from elsewhere. Unlike H3 Temporal Insert, this node will not fabricate a zero audio track, because a clean zero mid-schedule is not a valid state.

Inputs: samples (the mid-schedule nested AV latent), hold_map, noise_topup, seed (for the top-up draw). Optional expand_to_end (default false - a mid-denoise arm wants the same grid its between-passes control used) and length / sigma_s (the latter is report-only).

Should you use it?

If you're running the settled pipeline, no - this is research surface, the author calls it a PoC. It exists to answer whether mid-schedule insertion holds choreography better than the between-passes route, and it needs a user comfortable debugging a split schedule. If you want to poke at it, start from a graph that already does the temporal-insert dance and swap the insert stage in; the shared grid code means the token-times stay consistent, so you're comparing inits, not grids.

Install

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

or ComfyUI Manager → ComfyUI-MAINodes, restart. Category latent/minimax/motion.

Categorylatent/minimax/motion

Inputs (7)

NameTypeDefaultDescription
samplesLATENTthe nested AV latent MID-SCHEDULE: SamplerCustomAdvanced's 'output' from a pass whose sigmas ended at sigma_s
hold_mapSTRINGthe same map H3 Time Smear / the oracles speak; hold h means h token-times where there was 1
noise_topupFLOAT1.000–1fraction of the MEASURED variance deficit to restore with fresh gaussian noise. 0 = raw lerp, 1 = the inserted tokens carry their neighbours' spread
seedINT00–18446744073709550000the top-up noise draw; fixed so the init is reproducible
expand_to_endoptBOOLEANfalseH3 Temporal Insert's end-jump rewrite. OFF by default here: a mid-denoise arm wants the same grid its between-passes control used
lengthoptINT00–36000 = derive the base length from the latent; nonzero asserts this exact base length
sigma_soptFLOAT0.0000–1REPORT ONLY, changes nothing: the handoff sigma pass A ended on. Given it, the report prints the noise-only variance deficit the flow parameterisation predicts, to compare against the measured one

Outputs (3)

NameTypeDescription
samplesLATENT
hold_mapSTRING
reportSTRING