Nodes/kentskooking-nodes/Image Iterative Sampler
ComfyUI Node

Image Iterative Sampler

The deforum-style image morph loop, compressed into one node

By Kentskooking·Created 10 months ago·Updated 15 days ago· 8
Image Iterative Sampler
  • model
  • positive
  • negative
  • latent_image
  • wave_config
  • vae
  • checkpoint_config
  • latent_batch
seed0
add_noisetrue
sampler_name
scheduler
cfg1.0
noise_injection_strength0.10
lock_injection_seedfalse
feedback_modenone

Deforum made a generation of SD users obsessed with the zoom-morph: take one image, re-sample it over and over with a little zoom, a little prompt drift, a little injected noise, and you get a hypnotic motion loop out of a still. That workflow has been awkward to port to ComfyUI for years because it's really a loop wearing a mask. Image Iterative Sampler is the loop wearing a node: point it at a latent, and it re-samples that image over and over - with progressive steps, exponential zoom, and fresh noise - until you have a batch of frames that animate like a deforum clip.

How it works

The sampler takes your starting latent and runs through cycles, each cycle holding a fixed seed and stepping through a ramp of denoise steps. Between iterations it applies the stuff that makes deforum look like deforum:

  • Zoom - an exponential per-iteration multiplier (from the controller's zoom_rate, e.g. 1.05 = 5% per pass). The sampler does this in pixel space by decoding, scaling, and re-encoding through the VAE, because zooming raw latents corrupts them. That's why a VAE is mandatory when zoom is enabled.
  • Noise injection - each pass gets noise_injection_strength worth of fresh noise so the image actually drifts instead of locking onto itself. Lock the injection seed (lock_injection_seed) to keep the drift pattern stable across cycles.
  • Feedback - feedback_mode set to previous_iteration feeds the last output latent back as the next input, the classic chaining trick for smoother morphs.
  • Optional wave extras - if you've threaded CLIP vision, style, ControlNet or IPAdapter data into the wave_config, each applies here per-cycle with wave-modulated strength.

Inputs that matter

  • noise_injection_strength - the chaos dial. 0.1 is a gentle drift; 0.3+ gets actively trippy. This is the single knob that decides whether you get "smooth morph" or "glitch art."
  • feedback_mode - none or previous_iteration. On for tighter continuity, off if you want each frame more independent.
  • latent_image - your starting image, VAE-encoded.
  • wave_config - from the Image Wave Controller; without it this node refuses to run (it requires a wave_config input).
  • vae (optional) - required the moment zoom is on; also used for noise injection and checkpoint previews.
  • checkpoint_config (optional) - from Iterative Checkpoint Controller, so long morphs save their progress.

Standard sampler dials round it out: model, positive, negative, seed, add_noise, sampler_name, scheduler, cfg (default 1.0). Output is a latent_batch - decode it and save the frames as a video or GIF.

Installing it

Ships in kentskooking-nodes: ComfyUI Manager → search kentskooking-nodes → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Kentskooking/kentskooking-nodes

Restart after. No models to download.

Common issues

  • "ImageIterativeSampler requires a VAE input when zoom is enabled" - the most common stumble. zoom_rate ≠ 1.0 (or a nonzero zoom_max in the wave config) means the sampler needs a VAE for pixel-space zooming. Connect one, or disable zoom.
  • Frames that drift into mush - noise injection too high or feedback_mode chaining runaway drift. Drop noise_injection_strength toward 0.05.
  • It runs forever - exponential zoom multiplies frame resolution each pass; keep zoom_rate modest (1.01–1.05) unless you enjoy watching your VRAM evaporate.

The pack ships an example workflow (Image Iterative Sampler - zImage.json) - load that before you hand-roll anything.

Categorykentskooking/sampling

Inputs (15)

NameTypeDefaultDescription
modelMODEL
positiveCONDITIONING
negativeCONDITIONING
latent_imageLATENT
wave_configWAVE_CONFIG
seedINT00–18446744073709550000
add_noiseBOOLEANtrue
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
cfgFLOAT1.00–100
noise_injection_strengthFLOAT0.100–1
lock_injection_seedBOOLEANfalse
feedback_modeCOMBOnone2 options: none, previous_iteration
vaeoptVAERequired when zoom is enabled (zoom_min != zoom_max) for pixel-space zoom processing. Optional for noise injection and checkpoint preview.
checkpoint_configoptCHECKPOINT_CONFIG

Outputs (1)

NameTypeDescription
latent_batchLATENT