Nodes/Difforum/Difforum · Live Step (realtime)
ComfyUI Node

Difforum · Live Step (realtime)

One warp-plus-diffuse step per tick — the realtime building block

By chillithebillis·Created 3 months ago·Updated about a month ago· 7
Difforum · Live Step (realtime)
  • model
  • positive
  • negative
  • vae
  • params
  • camera
  • prev_frame
  • anchor
  • positive_schedule
  • depth
  • control_net
  • frame
  • next_index
frame_index0
strength0.50
steps2
cfg1.2
sampler_namelcm
schedulersgm_uniform
color_coherence0.50
color_modelab
control_strength0.60
loop_cameratrue
seed0

Realtime hosts don't work the way ComfyUI normally does. Stock ComfyUI re-runs the whole graph per "Queue Prompt", which is way too slow for live video. Realtime runtimes - ComfyStream, StreamDiffusion, webcam loops - instead re-run the graph every frame, so the right primitive is a single-step node. Difforum Live Step is exactly that: take the previous output frame, warp it by the camera, run a 1–2 step re-diffuse, colour-match, and return one frame. Wire its output back into its own prev_frame input, bump frame_index each tick, and you have a Deforum-style feedback loop running at interactive speed.

This is the sibling of the Live Sampler (which keeps the model resident and runs its own internal loop). LiveStep deliberately has no internal loop - it's the composable building block for hosts that already own the loop. That's the trade: it composes with any realtime runtime, and it stays cheap.

The settings that make it live or make it crawl

Frame 0 passes through untouched (that's your seed frame); everything after that is warp → re-diffuse → colour-match. The defaults are already tuned for realtime:

  • steps - 2 by default. This is the whole game. On a few-step model (SD-Turbo, LCM, DMD2, SDXL-Turbo) two steps is plenty.
  • cfg - 1.2 by default. Low, because distilled few-step models like it low. Don't come at this with SD1.5 habits.
  • sampler_name - lcm by default, matching the few-step models this node is built for.
  • strength - denoise per step (0.5 default). Lower it to calm flicker, raise it for more change per tick.
  • color_coherence / color_mode - LAB colour matching against the previous frame (or an anchor image) keeps hue drift from compounding across ticks. This is what stops a live loop from wandering into a different colour palette every ten seconds.

The optional inputs read like the full-feature sampler: positive_schedule for prompt travel in realtime, depth for 3D warp, control_net + control_strength for structure-guided feedback, loop_camera to wrap the camera path, seed. The outputs are frame (wire it back to prev_frame and onward to your sink) and next_index (feed it to frame_index - the two wires are the loop).

The realtime recipe

The README's difforum_realtime_live.json template is the honest blueprint: SD-Turbo or LCM checkpoint, 1–2 steps, cfg ~1, 512px. That's where the FPS lives - not in the node. On a Mac, remember fp16 isn't faster than fp32 on M-series ALUs, so few-step models are the speed lever, and fp8 checkpoints don't run on MPS at all (use fp16/GGUF). On any platform, the black-frames gotcha applies: some SD1.5 fp16 builds NaN to black - launch with --force-fp32 before you debug the node for an hour.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/chillithebillis/Difforum.git difforum

Restart ComfyUI - console prints [Difforum] loaded N nodes (ComfyUI Manager: search "Difforum"). Deps: numpy only; the pack runs on Python 3.12+. To push the live stream to Resolume/TouchDesigner/OBS, pair it with an NDI or Spout sink (the README's realtime notes cover it) - LiveStep gives you the frames, the sink gets them on the wall.

CategoryDifforum/live

Inputs (22)

NameTypeDefaultDescription
modelMODEL
positiveCONDITIONING
negativeCONDITIONING
vaeVAE
paramsDIFFORUM_PARAMS
cameraDIFFORUM_CAMERA
prev_frameIMAGE
frame_indexINT00–4294967295
strengthFLOAT0.500–1
stepsINT21–50
cfgFLOAT1.20–15
sampler_nameCOMBOlcm44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBOsgm_uniform9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
color_coherenceFLOAT0.500–1
color_modeCOMBOlab3 options: lab, rgb, none
anchoroptIMAGE
positive_scheduleoptDIFFORUM_PROMPT
depthoptIMAGE
control_netoptCONTROL_NET
control_strengthoptFLOAT0.600–3
loop_cameraoptBOOLEANtrue
seedoptINT00–18446744073709550000

Outputs (2)

NameTypeDescription
frameIMAGE
next_indexINT