ComfyTV/Imagegenerated

Crop(CropStage)

The Crop node (CropStage) extracts a rectangular region from a COMFYTV_IMAGE.

Crop Stage

image
image
crop_x
0
crop_y
0
crop_w
0
crop_h
0
ComfyTV

Description

The Crop node (CropStage) extracts a rectangular region from a COMFYTV_IMAGE. You define the region by its top-left corner using crop_x and crop_y, and by its size using crop_w and crop_h. The result is returned as a new COMFYTV_IMAGE containing only the selected area.

This node is useful for isolating part of an image, such as a subject, sprite, UI element, or any other region that needs to be processed separately in a ComfyTV workflow.

Inputs

InputTypeRequiredDefaultRangeDescription
crop_xINTYes00 to 8192Horizontal offset in pixels from the left edge of the source image. A value of 0 starts the crop at the left edge.
crop_yINTYes00 to 8192Vertical offset in pixels from the top edge of the source image. A value of 0 starts the crop at the top edge.
crop_wINTYes00 to 8192Width in pixels of the region to keep. This is the size of the crop, not the right edge coordinate.
crop_hINTYes00 to 8192Height in pixels of the region to keep. This is the size of the crop, not the bottom edge coordinate.
imageCOMFYTV_IMAGENoNone-The source image to crop. When connected, the node extracts the requested region from this image. Because the input is optional, a workflow can exist without an image connected, but a source image is needed to produce a meaningful cropped result.

Outputs

OutputTypeDescription
IMAGECOMFYTV_IMAGEThe cropped image region. The output uses the same COMFYTV_IMAGE type as the input, so it can be connected to other ComfyTV nodes that accept images.

Usage Notes

  • crop_x and crop_y locate the top-left corner of the crop region. They are offsets from the original image, not absolute canvas coordinates.
  • crop_w and crop_h define the width and height of the region to extract. They do not represent the bottom-right corner position.
  • All crop values are integer pixel values and are constrained to the range 0 to 8192.
  • The default value for all crop controls is 0. Set crop_w and crop_h explicitly when you want a non-empty crop region; leaving the size values at 0 may produce an empty or zero-sized result depending on the surrounding workflow.
  • The image input is optional in the node definition. Connect a COMFYTV_IMAGE to supply the source image that should be cropped.
  • The node category is ComfyTV/Image, so it is grouped with other image-processing stages in the ComfyTV package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…