ComfyUI Node

Feedback Sampler

Feedback Sampler's Deforum-style loops

By pizurny·Created 11 months ago·Updated 7 months ago· 35
Feedback Sampler
  • model
  • positive
  • negative
  • latent_image
  • vae
  • final_latent
  • all_latents
seed42
steps20
cfg8.0
sampler_name
scheduler
denoise1.00
zoom_value0.0500
translate_x0.0
translate_y0.0
angle0.0
border_modezeros
iterations10
feedback_denoise0.40
seed_variationincrement
color_coherenceLAB
noise_amount0.200
noise_typeperlin
sharpen_amount0.05
contrast_boost0.90

You want a slow zoom into a portrait, a flythrough, a spiral, and you don't want to wrestle with a video model to get it. That's the exact gap Feedback Sampler fills. It's a drop-in KSampler replacement that renders N frames of animation by sampling, nudging the latent, and sampling again - the iterative "feedback loop" trick Deforum popularized back in 2022, now living inside a single ComfyUI node. No video checkpoint, no motion module, no keyframes. Just your normal image model doing a camera move.

Let me be upfront: the name oversells a little. This is not motion coherence in the AnimateDiff/Wan sense - a character won't turn their head or walk anywhere. It's a camera move on a regenerating image, plus a chain of tricks that keeps frames from drifting into a color-blob mess. If "slow zoom into a still" is the shot, this is the easiest way to get it.

How it works

Here's the loop in one breath: the first iteration samples your latent at full denoise and stores it as the color reference. Every iteration after that takes the previous frame's latent, applies an affine transform (zoom + pan + rotate, GPU-side via F.affine_grid/F.grid_sample), then - if you've wired a VAE - decodes to pixels, matches the color histogram back toward frame 0, sharpens, adds noise, encodes to latent, and samples at the much lower feedback_denoise. Repeat until iterations frames are done.

The per-frame image pass is the whole game: histogram matching (CDF matching per channel, LAB by default) stops the classic feedback-loop drift toward mush, unsharp-mask sharpening recovers detail the VAE round-trip eats, and pixel-space noise keeps flat areas alive. There's also ControlNet sequence support - a batched hint image gets sliced per frame and loops when you run out.

The inputs that matter

It's a KSampler plus an animation set - same model, positive, negative, latent_image, seed, steps, cfg, sampler_name, scheduler, and denoise, with the camera controls on top. The ones you'll actually touch:

  • zoom_value - zoom speed per frame; positive in, negative out. Start around 0.001–0.005 for a smooth push-in.
  • translate_x / translate_y / angle - pan and rotate per frame, in pixels and degrees. They combine, so you can spiral.
  • iterations - the frame count. 30 frames is a short clip; your card will feel every one.
  • feedback_denoise - strength of each frame after the first. Lower (0.25–0.35) keeps things coherent, higher (0.4+) gets more change and more drift.
  • color_coherence - keep LAB (the default); RGB and HSV are there if you want to experiment.
  • seed_variation - increment (default) varies the seed per frame; fixed locks it.
  • border_mode - how out-of-bounds edges fill: zeros (black), border, or reflection. reflection hides the panning edge best.

Two outputs: all_latents (every frame, batched) and final_latent (last frame alone). Wire all_latents → VAE Decode → Video Combine; feed final_latent to an upscaler.

Install and quick start

Clone into custom_nodes, install the one optional dependency, restart:

cd ComfyUI/custom_nodes/
git clone https://github.com/pizurny/Comfyui-FeedbackSampler
pip install -r requirements.txt   # scipy - enables sharpening + Perlin noise

ComfyUI Manager also finds it if you search the pack title; add it under sampling → custom → Feedback Sampler.

The wiring is short: model + CLIP + latent in, and importantly connect the vae input - color coherence needs it, and skipping it is the README's #1 "black frames" cause. Prefer a turbo/lightning model: 30 iterations at full steps is where this node gets slow.

Where people get burned

A few real-world gotchas, grounded in the code rather than vibes:

  • No VAE = black frames, plus color coherence silently disables with a console warning - so frames drift and you won't know why.
  • The first frame is special. It samples at denoise (default 1.0), everything after at feedback_denoise - a first frame that looks radically different is by design.
  • Perlin noise and sharpening need scipy. Without it, Perlin falls back to Gaussian and sharpening is skipped. pip install scipy is the fix.
  • Don't copy SDXL settings to Flux. Default cfg of 8 is an SD-family habit; flow-matching models want CFG ~1 with an Euler-family sampler on a conservative scheduler. True of most KSampler nodes, but worse at 30 iterations.

Verdict

This is a small, work-in-progress pack from an author who's clearly still iterating - v2.0 added ControlNet sequences, pan/rotate, and a real progress bar, and the schema change means old workflows need the node recreated. It's niche. But it does exactly one thing, simply, with any checkpoint you already own: precise, controllable camera movement without a video model. For motion of things, go grab Wan or LTX - for a zoom that lands where you want it, this is the one I'd reach for.

Categorysampling/custom

Inputs (24)

NameTypeDefaultDescription
modelMODEL
seedINT420–18446744073709550000
stepsINT201–10000
cfgFLOAT8.00–100
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
positiveCONDITIONING
negativeCONDITIONING
latent_imageLATENT
denoiseFLOAT1.000–1
zoom_valueFLOAT0.0500-0.5–0.5
translate_xFLOAT0.0-100–100
translate_yFLOAT0.0-100–100
angleFLOAT0.0-180–180
border_modeCOMBOzeros3 options: zeros, border, reflection
iterationsINT101–1000000
feedback_denoiseFLOAT0.400–1
seed_variationCOMBOincrement3 options: fixed, increment, random
color_coherenceCOMBOLAB4 options: None, LAB, RGB, HSV
noise_amountFLOAT0.2000–1
noise_typeCOMBOperlin2 options: gaussian, perlin
sharpen_amountFLOAT0.050–1
contrast_boostFLOAT0.900.8–1.5
vaeoptVAE

Outputs (2)

NameTypeDescription
final_latentLATENT
all_latentsLATENT