KJNodes/audiogenerated

ImageTransformByNormalizedAmplitude

This node technically accepts an array of type NORMALIZED_AMPLITUDE and a batch of IMAGE images as input.

Image Transform By Normalized Amplitude

normalized_amp
image
IMAGE
zoom_scale
0.000
x_offset
INT
y_offset
INT
cumulative
KJNodes

The ImageTransformByNormalizedAmplitude node technically receives an array of type NORMALIZED_AMPLITUDE and a batch of IMAGE images as input.

The ImageTransformByNormalizedAmplitude node is an image processing node capable of dynamically transforming images based on input audio amplitude data. Its core function is to map the normalized amplitude values of audio to image scaling and displacement operations, thereby creating visual change effects synchronized with the audio rhythm.

Node Function

This node technically receives an array of type NORMALIZED_AMPLITUDE and a batch of IMAGE images as input. Internally, it clips the amplitude values to the range [0, 1] and calculates the cropping dimensions of the image based on the amplitude values to achieve a scaling effect. Additionally, the node supports a cumulative mode, which can accumulate continuous amplitude changes to produce a more intense visual impact. The processed images are output in IMAGE format, maintaining the same batch structure as the input.

Node Parameter Description - ImageTransformByNormalizedAmplitude

Connection Inputs (Inputs)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
normalized_ampNORMALIZED_AMPLITUDEYes--normalized_amp (Input Parameter): Receives normalized audio amplitude data to drive image transformation. The value range is limited to 0.0 to 1.0.
imageIMAGEYes--image (Input Parameter): Inputs the original image batch to be transformed.

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
zoom_scaleFLOATYes0.0-1.0 - 1.0 (Step: 0.001)zoom_scale (Input Parameter): Controls the base coefficient for how amplitude affects image scaling. The value range is -1.0 to 1.0, with a step size of 0.001.
x_offsetINTYes0-x_offset (Input Parameter): Sets the base offset for the image in the horizontal direction (X-axis). The value range is limited by the system's maximum resolution.
y_offsetINTYes0-y_offset (Input Parameter): Sets the base offset for the image in the vertical direction (Y-axis). The value range is limited by the system's maximum resolution.
cumulativeBOOLEANYesFalse-cumulative (Input Parameter): Enables cumulative mode. When set to True, the amplitude effect accumulates frame by frame, enhancing the transformation intensity.

Output

Parameter NameData TypeDescription
IMAGEIMAGEIMAGE (Output Parameter): Outputs the image batch transformed by amplitude-driven effects.

Usage Scenarios

A typical use case is in workflows that combine audio to generate video. Users can connect the normalized amplitude data output from an AudioScheduler node to this node while inputting a set of keyframe images. The node will automatically apply varying degrees of scaling and offset to each frame based on the real-time audio amplitude, thereby generating a dynamic video sequence that "pulses" or "breathes" in sync with the music rhythm.

Notes

Please note that this node is designed to work with the ComfyUI-AudioScheduler extension to ensure the correct amplitude data format is received. The number of images in the input batch should match the length of the amplitude array; otherwise, errors may occur.

The ImageTransformByNormalizedAmplitude node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…