Crop:
The ComfyTV.CropStage node is designed to facilitate the cropping of images within the ComfyTV/Image category. This node allows you to specify a rectangular area of an image that you wish to retain, effectively trimming away the unwanted portions. By providing precise control over the cropping dimensions, this node is particularly useful for focusing on specific areas of an image, enhancing composition, or preparing images for further processing. The cropping operation is non-destructive to the original image, meaning you can experiment with different crop settings without altering the source file. This node is essential for tasks that require image manipulation and refinement, offering a straightforward method to achieve the desired visual outcome.
Crop Input Parameters:
force_run_token
This parameter is used internally to manage the execution flow of the node. It typically defaults to 0 and does not require user modification.
project_id
This parameter identifies the project context in which the node is operating. It is a string value that links the node's operation to a specific project, ensuring that the cropping action is associated with the correct project data.
parent_output_id
This parameter is used to track the output from a preceding node in the workflow. It helps maintain the sequence of operations by linking the current node's input to the output of a previous node.
crop_x
This integer parameter specifies the x-coordinate of the top-left corner of the cropping rectangle. It determines where the crop starts horizontally on the image. The value ranges from 0 to 8192, with a default of 0, allowing you to adjust the horizontal starting point of the crop.
crop_y
This integer parameter specifies the y-coordinate of the top-left corner of the cropping rectangle. It determines where the crop starts vertically on the image. The value ranges from 0 to 8192, with a default of 0, allowing you to adjust the vertical starting point of the crop.
crop_w
This integer parameter defines the width of the cropping rectangle. It determines how wide the cropped area will be. The value ranges from 0 to 8192, with a default of 0, enabling you to set the desired width of the crop.
crop_h
This integer parameter defines the height of the cropping rectangle. It determines how tall the cropped area will be. The value ranges from 0 to 8192, with a default of 0, enabling you to set the desired height of the crop.
image
This parameter accepts the input image that you wish to crop. It is optional, meaning that if no image is provided, the node will not perform any cropping operation. The image input is crucial for the node to function, as it specifies the source material for the cropping process.
Crop Output Parameters:
image
The output parameter is the cropped image. This parameter provides the resulting image after the specified cropping operation has been applied. The cropped image retains the specified rectangular area, allowing you to use it in subsequent processing stages or export it as needed. The output is essential for verifying the success of the cropping operation and for further image manipulation tasks.
Crop Usage Tips:
- Ensure that the
crop_wandcrop_hparameters are set to values greater than zero to perform a meaningful crop operation. - Use the
crop_xandcrop_yparameters to precisely position the cropping rectangle over the desired area of the image. - If you are unsure about the exact dimensions needed, start with larger crop values and iteratively adjust them to achieve the desired focus.
Crop Common Errors and Solutions:
Image not provided
- Explanation: The node requires an image input to perform the cropping operation.
- Solution: Ensure that an image is connected to the node's input before executing the crop operation.
Invalid crop dimensions
- Explanation: The crop width or height is set to zero or exceeds the image dimensions.
- Solution: Verify that
crop_wandcrop_hare set to appropriate values within the image's dimensions and greater than zero. Adjust the values as necessary to fit within the image boundaries.
