KJNodes/samplinggenerated

Model Preview Override(ModelPreviewOverrideKJ)

Adds a dedicated live-preview frame on this node, with overridable max resolution. Default ComfyUI preview caps at 512px; this node sends its own preview straight to a DOM widget on the node so pixel-space models (Chroma Radiance, ZImage, HiDream-O1, …) can be previewed at full sampler resolution.

Model Preview Override KJ

model
vae
MODEL
max_resolution
1024
jpeg_quality
80
suppress_default_preview
preview_frames
1
preview_fps
12
KJNodes

The Model Preview Override node (class ModelPreviewOverrideKJ) adds a dedicated live-preview frame directly on the node, bypassing ComfyUI’s default 512‑px cap on sampler previews. This is especially useful for pixel‑space models (Chroma Radiance, ZImage, HiDream‑O1, …) that benefit from viewing intermediate results at full sampler resolution. The node also supports animated WebP previews for video models and can optionally suppress the standard sampler‑node preview overlay for a cleaner workflow.

Inputs

model (MODEL, required)

The model to attach the preview override to. Every step during sampling will produce a live preview on this node.

max_resolution (INT, default 1024, range 0–8192, step 8)

Maximum side length (in pixels) for the live preview widget.

  • 0 – no downscale; the preview is rendered at the full sampler resolution (use with caution for very high resolutions).
  • Any positive value – the longer edge of the preview is clamped to this size; the other edge is scaled proportionally.

jpeg_quality (INT, default 80, range 30–100, step 1)

JPEG quality used when compressing the preview image for transport to the DOM widget. Higher values yield better quality but larger payloads; lower values reduce overhead at the cost of visible compression artifacts.

suppress_default_preview (BOOLEAN, default true)

When enabled, the standard sampler‑node preview overlay is hidden while sampling, so only the frame from this node updates. The progress bar continues to advance normally. Disable if you still want to see the default ComfyUI preview alongside the node’s live frame.

preview_frames (INT, default 1, range 1–1024, step 1)

Number of frames to sample from each video step’s latent for an animated preview.

  • 1 – single frame (current behaviour, fastest).
  • 2 to 1024 – produces an animated WebP from the sampled frames, played back at the FPS set by preview_fps.
    This input is only effective for video models (5D latents); it is ignored for image models.

preview_fps (INT, default 12, range 1–60, step 1)

Playback frame rate for the animated WebP preview. Ignored when preview_frames is 1.

vae (VAE, optional)

Optional VAE for decoding latents into true‑RGB previews.

  • TAEHV‑LTX – uses a fast, tiny decode (the VAE is pinned to GPU).
  • Any other LTX VAE – performs a full‑quality decode via vae.decode(), which is significantly slower per step.
    If not provided, the node falls back to the model’s default VAE (if available) or to a standard decode method.

Outputs

MODEL

The same model passed into the model input, unchanged. This node is a pass‑through that adds preview functionality without modifying the model or its outputs.

Usage Notes

  • The live preview frame appears as a self‑contained widget on the node, so it remains visible even when the sampler node’s preview is hidden or when suppress_default_preview is enabled.
  • For video models, set preview_frames to a value greater than 1 to see an animated preview during sampling. Bear in mind that extracting multiple frames per step increases memory and computation overhead.
  • When using an optional VAE, the trade‑off between speed and quality is controlled by the VAE type: TAEHV‑LTX prioritizes speed; other LTX VAEs prioritise fidelity.

Comments

Sign in with GitHub to join the discussion.

Loading comments…
Model Preview Override (ModelPreviewOverrideKJ) - ComfyUI-KJNodes | ComfyUI Wiki