Nodes/kubakub nodes/kubakub region video sampler
ComfyUI Node

kubakub region video sampler

Animate three windows of a building, leave the other four hundred alone

By kubakubkub·Created about a month ago·Updated 2 days ago· 10
kubakub region video sampler
  • model
  • clip
  • vae
  • plan
  • audio_vae
  • image
  • upscale_model
  • enhance_clip
  • background
  • audio
  • material
  • frames
  • report
  • fps
  • audio
  • mask
◄frames121►
◄fps25.00►
◄seed42►
◄stage1_mp0.20►
◄context_px64►
◄feather_px6►
◄output_scale0.50►
◄negativecamera movement, zoom, pan, shaky, morphing facade, blurry, low quality, text, watermark►
◄only►
◄save_folder►
◄filename_prefixregion_video►
◄stage2_max_mp0.60►
◄enhance_promptfalse►
◄loopfalse►
◄scheduleauto►
◄steps0►

Video diffusion and architecture have a compatibility problem: the model wants to move the whole frame. Camera drift, a slight pan, the whole scene breathing - that's the aesthetic. Projection mapping is the opposite. The building must not move, because the pixels are landing on real stone and any drift is immediately visible as content sliding off a window frame.

kubakub region video sampler (ltx) exists for exactly that. It animates only the regions your plan says animate = on, on LTX 2.x, and pastes the result back into a still frame after still frame - so everything that isn't an animated region is not merely stable, it's bit-identical to the input.

How it works

The plan decides. Regions sharing the same video_prompt, t_start, t_end and motion are grouped into one clip, because there's no point running the model twice for two windows that are doing the same thing. Each clip runs on its own crop, sized to the LTX grid, with the rest of the crop held by a noise mask - so the model sees the surrounding facade but isn't allowed to change it. The first frame is your still. Then the result is pasted back into the untouched still, frame by frame, with a feather_px soft edge. Beyond the feather, nothing was ever touched.

The whole illusion rests on that paste. The moss growing over a window is generated; the mortar around it is literally the same bytes as the input image.

The inputs

model is LTX 2.5 22B distilled, clip is the Gemma text encoder loaded as type ltxv, and you need both vae and audio_vae - the model is audio-video, and without an audio input the audio just stays silent. plan from kubakub region plan, with keys animate, video_prompt, t_start, t_end and motion. And image is the still (your frame-in-frame + region sampler result, or just a photo).

Then:

  • frames - length, rounded up to 8k+1 because that's what LTX wants. Ignored when background is connected, since then the video is as long as the background.
  • fps - the plan's t_start/t_end are in seconds, so this is what makes them mean anything.
  • stage1_mp - megapixels per clip in the first stage, doubled per side by the upscaler. 0.2 by default.
  • context_px - how much still each clip sees around its regions. 64 by default; raise it if a clip's content looks unconnected to its surroundings.
  • output_scale - 0.5 by default, and the tooltip is brutally honest about why: a 4K batch of 121 frames needs 12 GB of RAM just to hold the output. Use save_folder for full-size PNGs instead.
  • stage2_max_mp - the cap for the sharper second stage, and the pack's own note is the most useful line in the node: 0.6 MP × 121 frames is safe on a 12 GB card, 1.8 MP crashed it. Take that seriously.

Optional but worth knowing: upscale_model (the LTX latent spatial upscaler ×2) makes the second stage actually sharper. only narrows to a selection in plan syntax. negative is one negative prompt for all clips, and it ships with a good one - camera movement, zoom, pan, shaky, morphing facade, blurry, low quality, text, watermark - which tells you the failure mode this node was built to fight. loop makes each clip return to the still so the video repeats, with calmer motion near the end because it has to come back. audio holds a sound the clips are sampled with; with an audio-reactive LoRA and its trigger words in video_prompt, the regions move with the music. enhance_prompt + enhance_clip expand each clip's prompt with a writing text encoder - the Gemma LTX int8 encoder can't generate text, so you need a separate one like a Qwen.

Outputs

frames, report (clips, frames, stages, time, one line per clip), fps (passed through for Create Video), audio (your sound cut or padded to the length of the frames, silence if none connected), and mask (the animated regions at the frame size). Note the audio caveat from the tooltip: the frames carry no sound - add the same audio in Create Video.

Install, and the honest VRAM conversation

cd ComfyUI/custom_nodes
git clone https://github.com/kubakubkub/ComfyUI_KubaNodes
python -m pip install -r ComfyUI_KubaNodes/requirements.txt

Manager → kubakub nodes. ComfyUI 0.37.0+. No Blender, but you need an LTX 2.x video model, which is where the real cost is.

The pack says it was tested on a 12 GB GPU, and it means 12 GB with quantised weights. The wider community reality for LTX-2.3 22B is that quantised GGUF workflows are what make 12 GB work at all, and that 64 GB of system RAM is the comfortable pairing. The relevant point for this node: it eases the pressure enormously, because each clip is a small crop rather than a full-frame generation. You're not running 4K video generation - you're running a 0.2 MP crop of a window, several times.

Clips are cached individually and models load once for all clips, so the second pass at the same settings is dramatically faster than the first - and while the director is holding or nothing is animated, the models aren't loaded at all.

Two things to expect

Motion has to be describable. "The window becomes an aquarium" runs. "Subtle atmospheric change" doesn't, on any video model. Short vague prompts are the most common reason a clip comes back nearly still.

only uses the plan's selector syntax, and 0.3.0 fixed it so group: and tag: work and the report says when a selector matched nothing. Before that, a group: selection silently rendered no clip at all - worth knowing if you're reading an old issue thread.

Categorykubakub/2d/motion

Inputs (27)

NameTypeDefaultDescription
modelMODELThe video model, any variant: LTX 2.x (dev or distilled, fp8 / nvfp4 / int8 / GGUF) or MiniMax H3 (fl2va or ref2va, pruned or full), with or without a speed LoRA on it. The node sees which it is.
clipCLIPThe text encoder of the same model: Gemma for LTX (CLIPLoader type ltxv), Qwen3-VL for H3 (CLIPLoader type minimax).
vaeVAEThe video VAE of the same model (LTX or H3).
planKUBA_PLANFrom kubakub region plan: animate = on, video_prompt, t_start, t_end and motion say which regions move and how.
framesINT1219–1025Video length in frames; rounded up to 8k + 1. Ignored when background is connected (the video is as long as the background).
fpsFLOAT25.001–120Frame rate of the video (the plan's t_start / t_end are in seconds).
seedINT420–18446744073709550000Noise seed; each clip adds its number, so clips differ. Change it for another take.
stage1_mpFLOAT0.200.05–4Megapixels of each clip in the first stage (x2 per side with the upscaler).
context_pxINT640–2048Still around the regions each clip sees.
feather_pxINT60–256Soft edge when pasting back; beyond it the still is untouched.
output_scaleFLOAT0.500.05–1Size of the IMAGE output (a 4K batch of 121 frames needs 12 GB RAM); use save_folder for the full-size frames. Ignored when background is connected (the frames keep the background's size).
audio_vaeoptVAEThe audio VAE of the same model (LTX 2.x and H3 make sound with the picture; a video-only LTX needs none). Needed for the 'audio' input; without it the clip's sound is empty.
imageoptIMAGEThe still (matrix size), e.g. frame in frame + region sampler result. Not needed (and not used) when background is connected.
upscale_modeloptLATENT_UPSCALE_MODELLTX latent spatial upscaler x2: adds a sharper second stage (LTX only; H3 has none).
negativeoptSTRINGcamera movement, zoom, pan, shaky, morphing facade, blurry, low quality, text, watermarkWhat the clips should avoid (one negative prompt for all clips).
onlyoptSTRINGOnly these animated regions. Empty = all. Written as in kubakub region plan: names with wildcards ('W_F1_*'), 'group:Windows', 'tag:front', 'region:3-7'; comma or Enter = or, space = and, '!' = not.
save_folderoptSTRINGWrite every frame at matrix size as PNG (an image sequence for After Effects).
filename_prefixoptSTRINGregion_videoStart of the PNG names in save_folder (<prefix>_00000.png ...).
stage2_max_mpoptFLOAT0.600.1–8Cap for the second stage (4x the stage-1 pixels): stage 1 shrinks to fit. 0.6 MP x 121 frames is safe on a 12 GB card; 1.8 MP crashed it.
enhance_promptoptBOOLEANfalseExpand each clip's video prompt with a writing text encoder (enhance_clip) and core's LTX prompt instructions, looking at the clip's first frame.
enhance_clipoptCLIPA text encoder that can write, e.g. qwen3.5_9b ... pe_i2i (CLIPLoader type qwen_image). The Gemma 4 LTX int8 encoder cannot generate text.
backgroundoptIMAGEA video to animate into instead of the still (e.g. the director's frames): clips start at their region's t_start and continue its frames; everything else of the background plays as it is.
loopoptBOOLEANfalseEach clip comes back to the still and its last frame is its first frame, so the video can repeat. The motion has to return within the clip, so it is calmer near the end. On a still only, not into a background video.
audiooptAUDIOA sound the clips are sampled with (held as it is). With an audio-reactive LoRA on the model and its trigger words in video_prompt the regions move with the sound. The frames carry no sound: add the same audio in Create Video.
materialoptIMAGEA clip the animated regions follow, e.g. the images of a kubakub shader with the same regions connected: each region moves as the clip moves there, and the model repaints it in its own look (plan: material_repaint, 0.8; 0.91 is freer, small regions can lose the timing). Frame by frame at this node's fps; a shorter clip holds its last frame. Where the clip is the same as the picture the model moves the region freely.
scheduleoptCOMBOautoauto = from the model's file names (a 'distilled' / '4step' / 'flashgen' / 'taomate' name = fast, a 'dev' LTX or an H3 without a speed LoRA = full steps); the report says what it took. Set it when your files have other names.
stepsoptINT00–1000 = what the model needs (8 distilled LTX, 20 dev LTX, 3 / 4 / 8 with an H3 speed LoRA, 20 H3 without). Another number overrides it.

Outputs (5)

NameTypeDescription
framesIMAGEThe video at output_scale.
reportSTRINGClips, frames, stages and time, one line per clip (size, time range, cache, prompt).
fpsFLOATThe frame rate (frames per second), passed through for Create Video.
audioAUDIOThe connected audio cut or padded with silence to the length of the frames; silence of that length when no audio is connected.
maskMASKThe regions that were animated, as one mask at the size of the frames (white = moves at some time in the video).