KJNodes/samplersgenerated

Sampler SelfRefineVideo(SamplerSelfRefineVideo)

Its core functionality allows you to plan a 'random refinement' schedule, specifying at which step intervals additional processing should be performed during the sampling process.

Sampler Self Refine Video

input_mode
latent
SAMPLER
certain_percentage
0.999
uncertainty_threshold
0.20
verbose
seed
0
KJNodes

The Sampler SelfRefineVideo node is an attempt to implement https://github.com/agwmon/self-refine-video. For testing only – MAY NOT WORK AS INTENDED. This sampler is designed to enhance video quality by iteratively refining uncertain pixels during the sampling process.

Use Cases

Use the Sampler SelfRefineVideo node when you want to reduce flickering and frame jumps in generated videos during action transitions or complex scenes. For example, when creating animations with rapidly moving characters, adjusting the uncertainty threshold and certainty percentage can help stabilize motion. It is also well-suited for scenes requiring high detail, such as facial close-ups or objects with complex textures, by allowing the sampler to focus refinement on uncertain regions.

Inputs

NameTypeRequiredDefaultTooltip / Notes
input_modeDYNAMICCOMBOYes-How to configure the step plan. The available options are determined dynamically.
certain_percentageFLOATYes0.999Percentage of certain pixels to consider the frame as certain and skip further refinement. Range [0,1], step 0.001.
uncertainty_thresholdFLOATYes0.2Threshold of uncertainty to consider a pixel uncertain. Range [0,1], step 0.01.
verboseBOOLEANYesFalseEnable verbose logging during sampling.
latentLATENTNo-Optional latent input to get the input shape for LTX2 audio/video separation.
seedINTYes0Seed for stochastic sampling. Range [0, 2^64).

Outputs

TypeDescription
SAMPLERA sampler object configured for self-refinement.

Notes

  • Increasing refinement (by lowering certain_percentage or raising uncertainty_threshold) will significantly increase computation time and resource usage. It is recommended to start testing with default settings and then gradually adjust based on output quality.
  • The input_mode controls how the refinement plan is generated. Consult the dynamic options (e.g., "auto") for the available strategies.
  • The latent input is optional and only needed if your pipeline uses LTX2-style audio/video separation; otherwise it can be left disconnected.
  • This implementation is experimental. Behavior may change or be incomplete compared to the upstream reference.

The Sampler SelfRefineVideo node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…