ComfyUI  >  Nodes  >  KJNodes for ComfyUI >  OffsetMaskByNormalizedAmplitude

ComfyUI Node: OffsetMaskByNormalizedAmplitude

Class Name

OffsetMaskByNormalizedAmplitude

Category
KJNodes/audio
Author
kijai (Account age: 2192 days)
Extension
KJNodes for ComfyUI
Latest Updated
6/25/2024
Github Stars
0.3K

How to Install KJNodes for ComfyUI

Install this extension via the ComfyUI Manager by searching for  KJNodes for ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter KJNodes for ComfyUI in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

OffsetMaskByNormalizedAmplitude Description

Manipulates mask image based on normalized amplitude for dynamic visual effects responsive to audio data, providing interactive transformations.

OffsetMaskByNormalizedAmplitude:

The OffsetMaskByNormalizedAmplitude node is designed to manipulate a mask image based on normalized amplitude values. This node is particularly useful for AI artists who want to create dynamic visual effects that respond to audio or other amplitude-based data. By adjusting the mask's position and rotation according to the amplitude values, you can achieve a variety of visual transformations that add a layer of interactivity and responsiveness to your artwork. The node ensures that the amplitude values are normalized within the range of 0 to 1, making it easier to control and predict the transformations. Whether you want to rotate the mask, shift it along the x or y axis, or both, this node provides a flexible and intuitive way to achieve these effects.

OffsetMaskByNormalizedAmplitude Input Parameters:

mask

The mask parameter is the input mask image that you want to transform. This image will be manipulated based on the normalized amplitude values to create the desired visual effect.

x

The x parameter controls the horizontal shift of the mask. It determines how much the mask will move along the x-axis based on the amplitude values. The value should be a float, with 0 meaning no shift and higher values resulting in more significant shifts.

y

The y parameter controls the vertical shift of the mask. It determines how much the mask will move along the y-axis based on the amplitude values. The value should be a float, with 0 meaning no shift and higher values resulting in more significant shifts.

angle_multiplier

The angle_multiplier parameter is used to scale the rotation angle of the mask. It multiplies the normalized amplitude values to determine the rotation angle in degrees. A higher multiplier will result in more significant rotations.

rotate

The rotate parameter is a boolean that determines whether the mask should be rotated based on the amplitude values. If set to True, the mask will be rotated; if set to False, no rotation will occur.

normalized_amp

The normalized_amp parameter is an array of normalized amplitude values within the range of 0 to 1. These values are used to control the transformations applied to the mask, such as shifting and rotating.

OffsetMaskByNormalizedAmplitude Output Parameters:

offsetmask

The offsetmask parameter is the transformed mask image. This output reflects the changes made based on the input parameters and normalized amplitude values, providing a dynamically altered mask that can be used in further processing or as a final visual element.

OffsetMaskByNormalizedAmplitude Usage Tips:

  • To create subtle shifts in the mask, use small values for the x and y parameters.
  • For more dramatic effects, increase the angle_multiplier to amplify the rotation based on the amplitude values.
  • Combine both shifting and rotating by setting rotate to True and adjusting the x, y, and angle_multiplier parameters for complex transformations.
  • Ensure your normalized_amp values are correctly normalized between 0 and 1 for predictable and controlled transformations.

OffsetMaskByNormalizedAmplitude Common Errors and Solutions:

"ValueError: normalized_amp values out of range"

  • Explanation: This error occurs when the normalized_amp values are not within the range of 0 to 1. - Solution: Ensure that all values in the normalized_amp array are clipped or normalized to be within the range of 0 to 1 before passing them to the node.

"TypeError: mask is not a valid image tensor"

  • Explanation: This error occurs when the mask parameter is not a valid image tensor.
  • Solution: Verify that the mask input is a properly formatted image tensor before using it with the node.

"IndexError: batch size mismatch"

  • Explanation: This error occurs when the batch size of the mask does not match the length of the normalized_amp array.
  • Solution: Ensure that the batch size of the mask image tensor matches the length of the normalized_amp array to avoid this error.

OffsetMaskByNormalizedAmplitude Related Nodes

Go back to the extension to check out more related nodes.
KJNodes for ComfyUI
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.