Run ComfyUI Easily with InstaSD

Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:

  • One-click deployment
  • Any model, any node
  • Powerful GPUs for rapid iteration
Get Started

Available Nodes

OffsetMaskByNormalizedAmplitude

OffsetMaskByNormalizedAmplitude Node Documentation

Overview

The OffsetMaskByNormalizedAmplitude node is part of the KJNodes collection for ComfyUI. This node is specifically designed to adjust the position and possibly the orientation of a given mask based on normalized audio amplitude input. It functions as a bridge to the AudioScheduler nodes, which are part of an additional repository available at a1lazydog/ComfyUI-AudioScheduler. This integration allows users to create dynamic audio-responsive visual elements by modifying existing masks in conjunction with audio data.

Functionality

The primary function of this node is to transform the spatial properties (i.e., position and orientation) of a mask in response to varied audio amplitudes. It does this by translating and/or rotating the mask based on the incoming normalized amplitude data.

Inputs

The OffsetMaskByNormalizedAmplitude node accepts the following inputs:

  1. Normalized Amplitude: This is an array of amplitude values that are normalized (i.e., scaled between 0 and 1). It represents the audio input which will dictate the extent of offset applied to the mask.

  2. Mask: The mask that you wish to modify. This input accepts a mask that will be transformed according to the other input parameters.

  3. X Offset: An integer defining the desired offset in the x-axis, within the range of -4096 to a maximum resolution. This determines how far and in which direction along the x-axis the mask will be shifted.

  4. Y Offset: Similar to the X Offset, this integer value ranges from -4096 to maximum resolution and specifies the translation along the y-axis.

  5. Rotate: A Boolean toggle indicating whether rotation should be applied to the mask. If enabled, the mask rotation will be calculated based on the amplitude data.

  6. Angle Multiplier: A float input that influences the degree of rotation applied to the mask when the Rotate option is enabled. The value multiplies the amplitude-derived angle, allowing nuanced control over rotation dynamics.

Outputs

The node produces the following output:

  • Mask: The output is a modified version of the input mask. After processing, the mask will have been spatially adjusted according to the normalized amplitudes and other input parameters provided. This output can be used in subsequent nodes within ComfyUI workflows.

Usage in ComfyUI Workflows

The OffsetMaskByNormalizedAmplitude node can be integrated into a larger ComfyUI project where audio-reactive visualizations are desired. By adjusting the spatial properties of a mask based on audio amplitude, dynamic and interactive visual elements can be created. This is particularly useful in audio-visual installations, live performances, and interactive art projects where visual content reacts to sound.

For example, users might connect an audio input through the AudioScheduler nodes to drive the amplitude normalization process. The resulting normalized amplitude values can then feed into this node, modifying masks live during a performance. The masks, after being adjusted, can be visualized, composited, or further processed to create compelling visual effects aligned with music or sound effects.

Special Features and Considerations

  • Dynamic Masking: The node provides a unique capability to link mask transformations directly with audio input, allowing for real-time dynamic changes in visuals.

  • Customizable Offsets and Rotations: With adjustable x and y offsets and the optional rotation feature, users have fine-grained control over how masks are adjusted in response to audio.

  • Integration with AudioScheduler: This node works in conjunction with the AudioScheduler nodes, providing an easy method to convert audio signals into transformative visual adjustments.

  • High Resolution Support: Supports a wide range of resolutions, making it suitable for various projects, from small interfaces to large-scale displays.

This node provides powerful, flexible options for creating sound-responsive visuals in ComfyUI, expanding the creative possibilities in audio-visual art and installations.