Visit ComfyUI Online for ready-to-use ComfyUI environment
Calculate rectangular region coordinates from center & size text for precise image manipulation.
The region-util-get-crop-location-from-center-size-text
node is designed to calculate the coordinates of a rectangular region based on a given center point and size, provided as a text string. This node is particularly useful for AI artists who need to define specific regions within an image for cropping or other manipulations. By inputting a string that specifies the center coordinates and dimensions of the desired region, the node computes the top-left and bottom-right coordinates, as well as the center coordinates and dimensions of the region. This functionality simplifies the process of region selection, making it more intuitive and less error-prone, especially when dealing with complex image processing tasks.
The text
parameter is a string that specifies the center coordinates and dimensions of the region to be cropped. The format of the string should be cx,cy,w,h
, where cx
and cy
are the x and y coordinates of the center, and w
and h
are the width and height of the region, respectively. The default value is '128,128,256,256'
, which means the center of the region is at (128, 128) and the size of the region is 256x256 pixels. This parameter allows you to easily define the region without needing to input multiple separate values.
The left
output parameter represents the x-coordinate of the left edge of the calculated region. This value is derived from the center coordinates and width provided in the input text.
The top
output parameter represents the y-coordinate of the top edge of the calculated region. This value is derived from the center coordinates and height provided in the input text.
The right
output parameter represents the x-coordinate of the right edge of the calculated region. This value is derived from the center coordinates and width provided in the input text.
The bottom
output parameter represents the y-coordinate of the bottom edge of the calculated region. This value is derived from the center coordinates and height provided in the input text.
The cx
output parameter represents the x-coordinate of the center of the calculated region. This value is directly taken from the input text.
The cy
output parameter represents the y-coordinate of the center of the calculated region. This value is directly taken from the input text.
The w
output parameter represents the width of the calculated region. This value is directly taken from the input text.
The h
output parameter represents the height of the calculated region. This value is directly taken from the input text.
cx,cy,w,h
to avoid errors in the calculation of the region coordinates.cx,cy,w,h
.cx,cy,w,h
, where cx
and cy
are the center coordinates, and w
and h
are the width and height of the region.© Copyright 2024 RunComfy. All Rights Reserved.