ComfyUI  >  Nodes  >  ComfyUI Layer Style >  LayerUtility: ImageShift

ComfyUI Node: LayerUtility: ImageShift

Class Name

LayerUtility: ImageShift

Category
😺dzNodes/LayerUtility
Author
chflame163 (Account age: 445 days)
Extension
ComfyUI Layer Style
Latest Updated
6/24/2024
Github Stars
0.6K

How to Install ComfyUI Layer Style

Install this extension via the ComfyUI Manager by searching for  ComfyUI Layer Style
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI Layer Style 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

LayerUtility: ImageShift Description

Manipulate image position by shifting it horizontally and vertically, useful for creating dynamic compositions and adjusting element alignment.

LayerUtility: ImageShift:

The LayerUtility: ImageShift node is designed to manipulate the position of an image by shifting it horizontally and vertically. This node is particularly useful for AI artists who want to create dynamic compositions or adjust the alignment of elements within an image. By shifting the image, you can create interesting visual effects, correct misalignments, or prepare images for further processing. The node offers flexibility with options to handle the image edges, such as cyclic repetition or filling with a background color, and it can also generate masks to manage borders and transparency. This makes it a versatile tool for enhancing your creative workflow.

LayerUtility: ImageShift Input Parameters:

image

This parameter represents the input image that you want to shift. It is required and should be provided in an appropriate image format.

shift_x

This parameter controls the horizontal shift of the image. The value is an integer, with a default of 256, and it can range from -9999 to 9999. Positive values shift the image to the right, while negative values shift it to the left.

shift_y

This parameter controls the vertical shift of the image. The value is an integer, with a default of 256, and it can range from -9999 to 9999. Positive values shift the image downwards, while negative values shift it upwards.

cyclic

This boolean parameter determines whether the image should repeat cyclically when shifted. The default value is True. When enabled, the image will wrap around, creating a seamless effect. When disabled, the shifted areas will be filled with the background color.

background_color

This parameter specifies the color used to fill the areas exposed by the shift when cyclic is set to False. The value is a string representing a color code, with a default of "#000000" (black).

border_mask_width

This parameter defines the width of the border mask in pixels. The value is an integer, with a default of 20, and it can range from 0 to 999. The border mask helps in managing the edges of the shifted image.

border_mask_blur

This parameter controls the blur applied to the border mask. The value is an integer, with a default of 12, and it can range from 0 to 999. Blurring the border mask can help in creating smoother transitions at the edges.

mask

This optional parameter allows you to provide a mask that defines which parts of the image should be affected by the shift. If not provided, the entire image will be shifted.

LayerUtility: ImageShift Output Parameters:

image

This output parameter provides the shifted image. The image will be adjusted according to the specified shift_x and shift_y values, and other input parameters.

mask

This output parameter provides the mask used during the shifting process. If an input mask was provided, it will be adjusted according to the shift parameters. If no mask was provided, a default mask will be generated.

border_mask

This output parameter provides the border mask, which helps in managing the edges of the shifted image. The border mask will be adjusted according to the border_mask_width and border_mask_blur parameters.

LayerUtility: ImageShift Usage Tips:

  • To create a seamless tiling effect, enable the cyclic parameter to ensure the image wraps around when shifted.
  • Use the background_color parameter to fill exposed areas with a specific color when cyclic is disabled, allowing for creative background effects.
  • Adjust the border_mask_width and border_mask_blur parameters to manage the edges of the shifted image, creating smoother transitions and avoiding harsh lines.
  • Experiment with different shift_x and shift_y values to achieve the desired composition and alignment in your artwork.

LayerUtility: ImageShift Common Errors and Solutions:

"Invalid image format"

  • Explanation: The input image is not in a supported format.
  • Solution: Ensure that the input image is in a compatible format such as PNG or JPEG.

"Shift values out of range"

  • Explanation: The shift_x or shift_y values are outside the allowed range.
  • Solution: Adjust the shift_x and shift_y values to be within the range of -9999 to 9999.

"Mask dimension mismatch"

  • Explanation: The provided mask does not match the dimensions of the input image.
  • Solution: Ensure that the mask has the same dimensions as the input image before applying the shift.

"Invalid color code"

  • Explanation: The background_color parameter contains an invalid color code.
  • Solution: Use a valid color code in the format "#RRGGBB" for the background_color parameter.

LayerUtility: ImageShift Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Layer Style
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.