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

OffsetMask

ComfyUI Node Documentation: OffsetMask

Overview

The OffsetMask node is a utility in the ComfyUI - KJNodes extension designed to manipulate masks by applying shifts in position and rotation. It offers flexibility in managing spatial positioning of masks and enables efficient creation of dynamic mask effects within ComfyUI workflows.

Functionality

The OffsetMask node adjusts the spatial alignment of masks by moving or transforming them based on user-defined parameters. With control over horizontal and vertical offsets, angle rotations, and duplication, this node offers comprehensive mask manipulation capabilities.

Inputs

The OffsetMask node accepts the following inputs:

  • mask: The mask or batch of masks that need to be offset. This input serves as the basis for positional transformations.
  • x: Specifies the horizontal offset to apply to the mask. Positive values shift the mask to the right, and negative values shift it to the left.
  • y: Specifies the vertical offset to apply to the mask. Positive values shift the mask downwards, and negative values shift it upwards.
  • angle: Specifies the rotation angle (in degrees) to apply to the mask. A positive angle rotates the mask clockwise, whereas a negative angle rotates it counterclockwise.
  • duplication_factor: Defines how many times the mask should be duplicated to form a batch. This allows for batch processing without requiring repeated node user interaction.
  • roll: A Boolean option to control edge wrapping. When enabled, edges wrap around instead of being padded.
  • incremental: A Boolean option to apply incremental transformations across batch elements. It facilitates gradual adjustments over multiple frames.
  • padding_mode: Specifies how padding should be applied when the mask is shifted beyond its original borders. Options include:
    • empty: Pads with zeros, resulting in black space.
    • border: Repeats the border values.
    • reflection: Mirrors the mask based on edge pixels.

Outputs

The OffsetMask node produces the following output:

  • mask: The transformed mask, featuring applied offsets, rotations, and duplications as specified by the input parameters.

Usage in ComfyUI Workflows

OffsetMask can be seamlessly integrated into various ComfyUI workflows. Here are some potential use cases:

  1. Dynamic Animations: By incrementally adjusting offsets or angles across a sequence of masks, users can create animations with moving or rotating elements.

  2. Multi-Frame Consistency: Use the node to ensure consistent spatial transformations across a batch of frames, especially when working with animations or time-segmented data.

  3. Layer Adjustments: Adjusting mask positions allows users to finely control how layered compositions overlap, ensuring correct alignment and coherence in design elements.

  4. Effect Creation: Combine with other nodes (like GrowMaskWithBlur) for advanced effects such as blurred movement paths, layered dynamic reveals, or creative mask splitting.

Special Features and Considerations

  • Batch Duplication: The node supports arbitrary duplication of masks for batch processing, making it adaptable for larger datasets or automation tasks.
  • Incremental Transformations: Incremental options provide the ability to apply gradual transformations across multiple frames, suitable for animations or progressive changes.
  • Padding Options: Different padding modes offer flexibility in managing edge behavior, whether for creativity or maintaining design integrity.
  • Performance Concerns: When using high duplication factors or complex transformations, users should be aware of potential performance impacts and adjust accordingly for efficient processing.

The OffsetMask node stands out as a versatile tool for mask manipulation, providing robust functionalities to refine and optimize visual designs in the ComfyUI environment.