Flux Video Cleanup Temporal Advanced
Clean up a video without turning it into a strobe light
- images
- vae
- noise
- guider
- sampler
- sigmas
- warped_previous_images
- flow_confidence
- images
- latents
- denoised_latents
- reset_mask
Here's the classic video cleanup trap: you take a video, re-sample each frame through an img2img pipeline to denoise it or scrub artifacts, and the output looks like someone hit the strobe light. Every frame looks fine on its own; played back, they shimmer and crawl because each one was generated in isolation. This node exists to break that isolation - it re-samples a video one frame at a time, but feeds each frame's previous cleaned output back in, so the cleanup stays temporally coherent.
You hand it an IMAGE batch of frames plus the standard custom-sampling pieces (noise, guider, sampler, sigmas) and a vae. In any mode other than off, it stops treating the batch as a batch and runs a per-frame loop where frame t can depend on frame t-1.
How it works
The trick is a "temporal prior" built in pixel space before the VAE encode. The node blends the current input frame with something that remembers the past, encodes that, samples, decodes, and moves on. temporal_mode picks what "something" is:
prev_output_blend- blend the current frame with the previous cleaned output. Simple, zero extra dependencies, and the sensible starting point.external_warped_prev- blend with a warped previous image you provide via the optionalwarped_previous_imagesinput, so motion compensation can come from your own optical-flow or warp nodes.internal_flow_warp- computes optical flow internally (OpenCV Farneback) and warps the previous cleaned output before blending. Convenient, but it requirescv2in your ComfyUI Python environment - without it, this mode raises an error. ComfyUI often has OpenCV around via other packs, but don't assume.off- pure batch path, no recurrence; the node behaves like the chunked batch chain.
temporal_strength (default 0.2) sets how much of the prior bleeds into the current frame. reset_every_n and scene_cut_threshold (default 0.18) are the escape hatches: they force a hard reset on the recurrence - the latter whenever a frame differs enough from the previous one that it's clearly a scene cut. That matters, because a scene cut is exactly where you don't want last frame's output smeared into the new shot. The reset_mask output marks which frames got reset, which is genuinely useful for debugging why a transition looks off.
Seeding is worth a sentence: with lock_seed on (default), every frame gets a seed derived from your NOISE input's seed - seed_stride_mode fixed gives the same seed per frame, sequential adds the frame index. With lock_seed off, the node lets frame-indexed noise variation do its thing.
The inputs that matter
temporal_mode- the only choice that changes behavior fundamentally. Start withprev_output_blend.temporal_strength- keep it modest (~0.2). Too high ghosts and smears; too low, the flicker creeps back. This is the knob you'll tune all day.scene_cut_threshold- leave at 0.18 unless you see wrong resets.
Note the tooltips on sample_chunk_size, auto_reduce_on_oom, min_chunk_size, and clear_cache_on_retry: they only do anything when temporal_mode is off. Temporal recurrence always samples one frame at a time, so those knobs are dead weight outside the batch path.
Outputs: images (the cleaned frame stack, ready for a Save/Preview), latents and denoised_latents (per-frame latents if you want to chain something on), and reset_mask.
Installing it
Ships in the xmarre/ComfyUI-ChunkedSampling pack. ComfyUI Manager: search "ComfyUI-ChunkedSampling". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-ChunkedSampling
Restart ComfyUI. No requirements.txt and no model downloads - the pack is genuinely dependency-light. The only optional piece is cv2 for internal_flow_warp.
Gotchas
The big one is speed: temporal modes run the full sampler once per frame, so a 100-frame clip is 100 denoising runs, plus a VAE encode and decode per frame. Budget accordingly. Also remember this is a pixel-space temporal prior, not per-frame conditioning rewrite - it keeps results coherent but it isn't magic, and heavy motion is where it strains. The pack is small and new with little community footprint, so treat settings like defaults to tune, not gospel. Start at prev_output_blend at strength 0.2, check a short clip, then decide if you need the flow-warp machinery at all.
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| vae | VAE | — | |
| noise | NOISE | — | |
| guider | GUIDER | — | |
| sampler | SAMPLER | — | |
| sigmas | SIGMAS | — | |
| temporal_mode | COMBO | 4 options: off, prev_output_blend, external_warped_prev, internal_flow_warp | |
| temporal_strength | FLOAT | 0.200–1 | — |
| reset_every_n | INT | 00–4096 | — |
| scene_cut_threshold | FLOAT | 0.180–1 | — |
| flow_confidence_scale | FLOAT | 1.000–1 | — |
| lock_seed | BOOLEAN | true | — |
| seed_stride_mode | COMBO | 2 options: fixed, sequential | |
| encode_chunk_size | INT | 81–4096 | — |
| sample_chunk_size | INT | 11–4096 | Only used when temporal_mode is off. Temporal recurrence forces per-frame sampling. |
| decode_chunk_size | INT | 81–4096 | — |
| auto_reduce_on_oom | BOOLEAN | true | Only used when temporal_mode is off. Temporal recurrence always samples one frame at a time. |
| min_chunk_size | INT | 11–4096 | Only used when temporal_mode is off. Temporal recurrence always samples one frame at a time. |
| clear_cache_on_retry | BOOLEAN | true | Only used when temporal_mode is off. Temporal recurrence does not use chunk-size retry fallback. |
| clear_cache_between_chunks | BOOLEAN | false | — |
| warped_previous_imagesopt | IMAGE | — | |
| flow_confidenceopt | MASK | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| latents | LATENT | — |
| denoised_latents | LATENT | — |
| reset_mask | MASK | — |