KJNodes/samplinggenerated

Get Preview Override Frames(GetPreviewOverrideFramesKJ)

Returns the frames captured by Model Preview Override during the most recent sampling. Wire 'model' from Model Preview Override (the same one feeding the sampler) and 'after_sample' from after the sampler (LATENT/IMAGE) to enforce correct execution order.

Get Preview Override Frames KJ

model
after_sample
frames
KJNodes

Description

Retrieves the preview frames that were captured by the Model Preview Override node during the most recent sampling step. This node must be wired correctly to ensure it runs after the sampling has completed and that it has access to the frames stored internally by the Model Preview Override.

Inputs

  • model (MODEL, required)
    The model output by the Model Preview Override node. This connection allows the Get Preview Override Frames node to locate the captured frames stored within the model wrapper. Do not wire the original model from a checkpoint loader – only the model coming directly from the Model Preview Override will work.

  • after_sample (MULTITYPE, required)
    Accepts either a LATENT or IMAGE tensor from after the sampler (e.g., the output of a KSampler, VAEDecode, or similar). The actual value is ignored – it is used solely to enforce correct execution order. Without this connection, ComfyUI may attempt to run this node before the sampling occurs, resulting in empty or outdated frames.

Outputs

  • IMAGE – A batch of images (tensor) containing the frames captured by Model Preview Override during the most recent sampling. If no frames have been captured yet (e.g., the node runs before any sampling), the output will be empty.

Usage Notes

  • Wire the model input to the model output of the Model Preview Override node – both the input and the output sides must use the same model wrapper for the frames to be accessible.
  • The after_sample input should be connected to any output that appears after the sampler in your workflow (e.g., the latent from KSampler, or a decoded image). This ensures the node executes only after the sampling step that generated the preview frames.
  • A common pattern is to connect the after_sample input to the latent output of the sampler that is also fed by the same Model Preview Override. This guarantees correct ordering without requiring additional nodes.
  • The frames returned are exactly those that were collected at each noise removal step (or preview interval) during the sampling, in chronological order. They can be used for animation previews, frame-by-frame analysis, or as input to subsequent image processing nodes.

Comments

Sign in with GitHub to join the discussion.

Loading comments…
Get Preview Override Frames (GetPreviewOverrideFramesKJ) - ComfyUI-KJNodes | ComfyUI Wiki