A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
The LayerUtility: ImageShift
node is a component of the ComfyUI LayerStyle toolkit that enables users to shift the position of an input image by specified pixel amounts on the x and y axes. This node is designed to be flexible, providing several options for how pixels are handled, including cyclic repetition and background color padding.
The primary function of the LayerUtility: ImageShift
node is to manipulate images by shifting their content horizontally and vertically. This node is particularly useful in workflows where repositioning image elements or creating artistic effects is required. It supports multiple images and mask layers simultaneously.
The LayerUtility: ImageShift
node accepts the following inputs:
Image: This is the primary input that takes the image(s) to be processed. The expected format is an image type compatible with ComfyUI.
Shift X: An integer value determining the number of pixels to shift the image along the x-axis. The default value is 256 pixels. This value can range from -9999 to 9999.
Shift Y: An integer value determining the number of pixels to shift the image along the y-axis. The default value is 256 pixels. This value can also range from -9999 to 9999.
Cyclic: A boolean option that, when enabled, causes the image to repeat cyclically when shifted. By default, this option is set to true.
Background Color: A string representing the background color to use when shifting the image. The default color is black (#000000).
Border Mask Width: An integer specifying the width of the border mask around the image. The default value is 20 pixels, and it can vary from 0 to 999 pixels.
Border Mask Blur: An integer that denotes the amount of blur to apply to the border mask. The default is 12 pixels, adjustable between 0 and 999 pixels.
Mask (Optional): This optional input accepts a mask that defines specific areas of the image to be shifted. If no mask is provided, a default white mask is applied to the entire image.
The LayerUtility: ImageShift
node produces three types of outputs:
Image: The resultant image after applying the specified shifts and transformations.
Mask: This is the output mask that corresponds to the shifted image, useful for further processing or as a reference.
Border Mask: A mask representing the border area, which can be customized in terms of width and blur.
The LayerUtility: ImageShift
node can be integrated into ComfyUI workflows to achieve effects such as:
Repositioning: Adjust the placement of specific parts of an image without altering its content.
Artistic Effects: Combine the shift with cyclic repetition to create looping or tiling patterns in graphics.
Layer Manipulation: Use masks to isolate and manipulate different regions of an image independently.
Custom Borders: Apply border masks to emphasize or create separation between different parts of an image.
Cyclic Repetition: When enabled, this option ensures that the image content that is shifted out of frame reappears on the opposite side, creating a seamless looping effect.
Background Handling: The node offers flexibility in specifying a background color, ensuring that any areas introduced by the shift can be filled with a consistent color.
Mask Support: By utilizing mask input, users can target specific parts of an image for shifting, which is particularly useful in complex layering scenarios.
Performance Logging: The node provides logging feedback for the number of images processed, aiding workflow management and debugging.
This node is designed to be intuitive and adaptable, making it a powerful tool for image manipulation within ComfyUI environments.