Nodes/ComfyUI_KubaNodes/kubakub sound mask swap
ComfyUI Node

kubakub sound mask swap

Layers trade their masks in time with a sound. Each layer has a mask and, if you connect them, a picture; the pictures stay where they are and the masks move on by one step per beat, bar, fixed time, or per hit in the low, mid or high frequencies. Gives the frames, the moving mask of one layer, fps and the sound, ready for Create Video. Nothing connected = a sample facade and a built-in beat. The kubakub director has the same thing as the behaviour 'swap masks'.

By kubakubkub·Created 15 days ago·Updated 3 days ago· 9
kubakub sound mask swap
  • audio
  • background
  • masks
  • pictures
  • signal
  • frames
  • mask
  • fps
  • audio
  • report
◄orderloop►
◄step_onbeats►
◄nth1►
◄fade0.00►
◄fade_stylecrossfade►
◄feather0►
◄threshold0.30►
◄fps25.00►
◄seconds0.0►
◄scale0.50►
◄mask_of1►
◄step_times►
◄start0.0►
◄bpm0.0►
◄every0.50►
◄gap0.10►
◄seed1►
Categorykubakub/2d/motion

Inputs (22)

NameTypeDefaultDescription
orderCOMBOlooploop: every layer moves on to the next mask. pingpong: there and back. random: a new shuffle every step.
step_onCOMBObeatsWhat makes a step: beats or bars (tempo of the sound), every (a fixed time), a hit in the low (kick, bass), mid or high (hats, clicks) frequencies, signal (the control wav in 'signal' rises through the threshold) or list (the times in 'step_times').
nthINT11–64Step on every nth beat, bar or hit.
fadeFLOAT0.000–10Seconds of fade into the new mask. 0 = the layer just appears there.
fade_styleCOMBOcrossfadeWith a fade: crossfade = the new picture fades in over the old one. out, then in = each layer fades out of its old mask first, then into the new one.
featherFLOAT00–500Soft mask edges, in pixels of the background. 0 = the masks as they are.
thresholdFLOAT0.300–1low / mid / high: how strong a hit has to be to count (0 = every hit, 1 = only the strongest). signal: the level it has to rise through (0-1 of its peak).
fpsFLOAT25.001–120Frames per second.
secondsFLOAT0.00–3600Length to render. 0 = to the end of the sound.
scaleFLOAT0.500.05–1Size of the frames relative to the background (RAM: 250 frames at 1600x1080 = ~7 GB).
mask_ofINT11–64Which layer's moving mask goes out on 'mask' (1 = the first mask of the batch).
audiooptAUDIOThe sound the masks react to. Empty = a built-in beat (120 bpm).
backgroundoptIMAGEThe picture behind the layers; it gives the size. Empty = the sample facade.
masksoptMASKOne mask per layer (a mask batch, at least two). Empty = the windows of the sample facade, one layer per floor.
picturesoptIMAGEOne whole picture per layer (an image batch, repeated when there are fewer than masks). Each shows through the mask its layer holds at that moment. Empty = a flat colour per layer, to see the masks move.
signaloptAUDIOstep_on = signal: a control track as a wav (a gate or trigger track, an LFO, an envelope, CV recorded from a synth). A step each time it rises through 'threshold'. Its time runs with the sound's.
step_timesoptSTRINGstep_on = list: the times of the steps in seconds, separated by commas, spaces or new lines (e.g. 0.5, 1, 1.75, 3).
startoptFLOAT0.00–3600Seconds into the sound where the frames start.
bpmoptFLOAT0.00–400Tempo for beats / bars. 0 = found in the sound.
everyoptFLOAT0.500.02–600step_on = every: seconds between two steps.
gapoptFLOAT0.100–10low / mid / high: the shortest time between two steps, so a roll does not flicker.
seedoptINT10–2147483647order = random: another shuffle.

Outputs (5)

NameTypeDescription
framesIMAGEEvery frame: the background with each picture (or colour) in the mask its layer holds.
maskMASKThe moving mask of the layer chosen in mask_of, one per frame.
fpsFLOATFrames per second.
audioAUDIOThe sound, cut to the frames.
reportSTRINGTempo or hits found, the number of steps, frames and size.