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

CreateAudioMask

ComfyUI-KJNodes: CreateAudioMask Node Documentation

Overview

The CreateAudioMask node is part of the ComfyUI-KJNodes collection, a set of nodes designed to enhance the functionality and workflow of the ComfyUI framework. This particular node is designed to create visual masks based on audio input, typically in the form of spectrogram-inspired patterns, allowing users to integrate audio-driven visuals into their UI projects.

Functionality

Purpose

The CreateAudioMask node generates a series of visual masks derived from an input audio file. The masks correspond to frames, creating an animated effect when used in sequence. This node is particularly useful for projects that require synchronizing visual elements with audio tracks.

Inputs

The CreateAudioMask node accepts the following inputs:

  • invert (BOOLEAN): A toggle option to invert the grayscale mask values. When enabled, the bright and dark areas in the mask are swapped.

  • frames (INT): Specifies the number of frames or masks to generate from the audio file. This determines the granularity of the audio-to-visual transformation.

  • scale (FLOAT): A scaling factor for the size of the shapes in the mask. It adjusts the intensity or visibility of the audio features in the visual representation.

  • audio_path (STRING): The path to the audio file (e.g., WAV format) from which visual masks will be generated.

  • width (INT): The width in pixels of the masks to be generated.

  • height (INT): The height in pixels of the masks to be generated.

Outputs

The CreateAudioMask node produces the following output:

  • IMAGE: A batch of images that serve as masks, each representing a frame of the animation driven by the audio input. These images can be further processed or directly utilized in the ComfyUI project.

Usage in ComfyUI Workflows

The CreateAudioMask node can be integrated into a ComfyUI workflow in several ways, including:

  • Audio-Driven Visuals: Users can utilize the mask outputs in animation or visualization schemes that need to be synchronized with an audio track. For example, creating visual effects for music videos or interactive installations.

  • Creative Coding Projects: This node is valuable for projects that explore the intersection of audio and visual arts, enabling the creation of generative art that responds to sound.

  • Interactive Interfaces: Designers aiming to build user interfaces that react to sound inputs can employ this node to generate dynamic visual feedback.

Special Features or Considerations

  • Audio Processing: The node requires the librosa library to process audio files. Ensure this library is installed in your environment to avoid runtime errors.

  • Mask Inversion: The ability to invert the generated masks can be useful in artistic projects where the contrast of visual representation is crucial.

  • Resolution and Frame Count: The resolution (width and height) and the number of frames should be chosen carefully based on the desired output quality and animation smoothness. Higher values may offer better quality but result in increased computational demands.

  • Path Requirement: The node requires a valid path to an audio file to generate masks. Ensure the correct file path to avoid incorrect or failed mask generation.

In summary, the CreateAudioMask node is a versatile tool within the ComfyUI-KJNodes suite, enabling developers to craft unique visual elements that respond to audio inputs for dynamic, synchronized visual projects.