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'.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| order | COMBO | loop | loop: every layer moves on to the next mask. pingpong: there and back. random: a new shuffle every step. |
| step_on | COMBO | beats | What 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'). |
| nth | INT | 11–64 | Step on every nth beat, bar or hit. |
| fade | FLOAT | 0.000–10 | Seconds of fade into the new mask. 0 = the layer just appears there. |
| fade_style | COMBO | crossfade | With 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. |
| feather | FLOAT | 00–500 | Soft mask edges, in pixels of the background. 0 = the masks as they are. |
| threshold | FLOAT | 0.300–1 | low / 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). |
| fps | FLOAT | 25.001–120 | Frames per second. |
| seconds | FLOAT | 0.00–3600 | Length to render. 0 = to the end of the sound. |
| scale | FLOAT | 0.500.05–1 | Size of the frames relative to the background (RAM: 250 frames at 1600x1080 = ~7 GB). |
| mask_of | INT | 11–64 | Which layer's moving mask goes out on 'mask' (1 = the first mask of the batch). |
| audioopt | AUDIO | The sound the masks react to. Empty = a built-in beat (120 bpm). | |
| backgroundopt | IMAGE | The picture behind the layers; it gives the size. Empty = the sample facade. | |
| masksopt | MASK | One mask per layer (a mask batch, at least two). Empty = the windows of the sample facade, one layer per floor. | |
| picturesopt | IMAGE | One 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. | |
| signalopt | AUDIO | step_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_timesopt | STRING | step_on = list: the times of the steps in seconds, separated by commas, spaces or new lines (e.g. 0.5, 1, 1.75, 3). | |
| startopt | FLOAT | 0.00–3600 | Seconds into the sound where the frames start. |
| bpmopt | FLOAT | 0.00–400 | Tempo for beats / bars. 0 = found in the sound. |
| everyopt | FLOAT | 0.500.02–600 | step_on = every: seconds between two steps. |
| gapopt | FLOAT | 0.100–10 | low / mid / high: the shortest time between two steps, so a roll does not flicker. |
| seedopt | INT | 10–2147483647 | order = random: another shuffle. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| frames | IMAGE | Every frame: the background with each picture (or colour) in the mask its layer holds. |
| mask | MASK | The moving mask of the layer chosen in mask_of, one per frame. |
| fps | FLOAT | Frames per second. |
| audio | AUDIO | The sound, cut to the frames. |
| report | STRING | Tempo or hits found, the number of steps, frames and size. |