Nodes/Node_Fun_ComfyUI/Fun KSampler
ComfyUI Node

Fun KSampler

A KSampler that shows its work — and drops every preview on disk

By nofunstudio·Created 2 years ago·Updated about a month ago· 9
Fun KSampler
  • model
  • positive
  • negative
  • latent_image
  • vae
  • latent
  • preview_latents
seed0
steps20
cfg8.0
sampler_name
scheduler
denoise1.00
preview_steps5
skip_steps0

Fun KSampler is a drop-in replacement for ComfyUI's built-in KSampler that saves progress pictures as it samples. You get the exact same sampler interface - model, seed, steps, cfg, sampler, scheduler, positive, negative, latent, denoise - plus two extra dials, and instead of a black void while a 30-step run churns, you get a folder filling up with checkpoints of the image at various stages. It's the "show me your work" feature the default sampler never had.

The mechanism is straightforward and worth understanding before you crank the dials. This node wraps ComfyUI's own comfy.sample.sample() call and passes in a callback that fires at specific steps. At each of those steps it takes the current latent, decodes it to a real image, and writes it to your output folder as preview_step_XXX_00001_.png. The decode uses ComfyUI's built-in latent previewer - the same TAESD path the browser preview uses, so it's fast when you have the tiny autoencoder weights around, and if you don't, it falls back to a full VAE decode on CPU. That fallback is slow enough that you'll notice it.

The two inputs that make this yours:

  • preview_steps (default 5): how many intermediate images to save across the whole run. Max 20. Keep it low - every preview is a decode you're paying for.
  • skip_steps (default 0): how many early steps to skip before saving anything. Set this to maybe 4–5 on a 20-step run if you don't want a folder of pure noise stills. The first few sampling steps look like static; skipping them is free.

Everything else behaves exactly like the core KSampler, right down to the cfg tooltip warning that too-high guidance hurts quality. The sampler_name list is the full ComfyUI roster (44 options, euler through the dpm family), and denoise still means image-to-image strength.

Outputs: latent is your final denoised latent - wire it into a VAEDecode as you always would. The second output is named preview_latents, and here's the trap: despite the name and the LATENT type, it does not return latents. It returns the callback's results dict holding the file paths of the previews it saved. Don't feed it into a latent chain expecting a tensor - treat it as a side channel, or just ignore it. The real output is the folder full of PNGs, which is the whole point of the node.

You install it as part of the Node_Fun_ComfyUI pack: ComfyUI Manager → search "Node Fun", or clone it manually:

cd ComfyUI/custom_nodes
git clone https://github.com/nofunstudio/Node_Fun_ComfyUI
pip install -r requirements.txt
# restart ComfyUI

No API key, no model download, no extra dependencies beyond the pack's own replicate and fal-client (which you'd only need for the API nodes in the same pack). This node is pure sampler plumbing.

Where people get burned: mainly the fallback decode. If you don't have TAESD weights installed, every preview step runs a full VAE decode on CPU and a 20-step run suddenly takes twice as long. Either install the TAESD models ComfyUI's preview system wants, or keep preview_steps in single digits. It's a niche tool - you'll reach for it when you're doing long hires-fix passes or debugging why a run goes off the rails at step 14 - but when you need to watch a sampler work, nothing else in this pack does it.

Categorysampling

Inputs (13)

NameTypeDefaultDescription
modelMODELThe model used for denoising the input latent.
seedINT00–18446744073709550000The random seed used for creating the noise.
stepsINT201–10000The number of steps used in the denoising process.
cfgFLOAT8.00–100The Classifier-Free Guidance scale balances creativity and adherence to the prompt. Higher values result in images more closely matching the prompt however too high values will negatively impact quality.
sampler_nameCOMBOThe algorithm used when sampling, this can affect the quality, speed, and style of the generated output.
schedulerCOMBOThe scheduler controls how noise is gradually removed to form the image.
positiveCONDITIONINGThe conditioning describing the attributes you want to include in the image.
negativeCONDITIONINGThe conditioning describing the attributes you want to exclude from the image.
latent_imageLATENTThe latent image to denoise.
vaeVAEThe VAE used for decoding the latent images.
denoiseFLOAT1.000–1The amount of denoising applied, lower values will maintain the structure of the initial image allowing for image to image sampling.
preview_stepsINT51–20Number of intermediate previews to generate during sampling.
skip_stepsINT00–10000Number of steps to skip before starting to save previews.

Outputs (2)

NameTypeDescription
latentLATENTThe final denoised latent.
preview_latentsLATENTPreview images are saved directly to the outputs folder using TAESD for better quality.