ComfyUI  >  Nodes  >  JPS Custom Nodes for ComfyUI >  Crop Image Square (JPS)

ComfyUI Node: Crop Image Square (JPS)

Class Name

Crop Image Square (JPS)

Category
JPS Nodes/Image
Author
JPS (Account age: 370 days)
Extension
JPS Custom Nodes for ComfyUI
Latest Updated
5/22/2024
Github Stars
0.0K

How to Install JPS Custom Nodes for ComfyUI

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

Crop Image Square (JPS) Description

Crop images into perfect square format with control over position, zoom, and interpolation for uniform visuals.

Crop Image Square (JPS):

The Crop Image Square (JPS) node is designed to help you crop images into a perfect square format, which is particularly useful for creating uniform and aesthetically pleasing visuals. This node allows you to specify the crop position, offsets, zoom level, and interpolation method, ensuring that you have full control over how the image is cropped. By using this node, you can easily prepare images for various artistic and design purposes, maintaining a consistent aspect ratio and enhancing the overall visual appeal of your work.

Crop Image Square (JPS) Input Parameters:

source_crop_pos

This parameter allows you to specify the position from which the image will be cropped. You can choose from options such as "center", "top", "bottom", "left", and "right". The choice of crop position affects which part of the image will be retained in the final square crop. For example, selecting "center" will crop the image around its center, while "top" will crop from the top part of the image.

source_crop_offset

This parameter defines the offset value for the source crop position. It accepts integer values ranging from -2048 to 2048, with a default value of 0. The offset value shifts the crop area horizontally or vertically, depending on the crop position, allowing you to fine-tune the exact area of the image to be cropped.

support_crop_pos

Similar to source_crop_pos, this parameter specifies the position for the support crop. The available options are "center", "top", "bottom", "left", and "right". This parameter is useful when you need to align the crop position of the source image with another reference or support image.

support_crop_offset

This parameter defines the offset value for the support crop position. It accepts integer values ranging from -2048 to 2048, with a default value of 0. The offset value shifts the crop area of the support image horizontally or vertically, allowing you to align it precisely with the source image crop.

crop_intpol

This parameter specifies the interpolation method to be used when resizing the cropped image. The available options are "lanczos", "nearest", "bilinear", "bicubic", "area", and "nearest-exact". The choice of interpolation method affects the quality and smoothness of the resized image. For example, "lanczos" provides high-quality results, while "nearest" is faster but may produce a more pixelated image.

Crop Image Square (JPS) Output Parameters:

source_crop_pos

This output parameter returns the crop position used for the source image. It helps you verify the exact position from which the image was cropped, ensuring consistency in your workflow.

source_crop_offset

This output parameter returns the offset value applied to the source crop position. It allows you to confirm the exact offset used, which is useful for documentation and reproducibility of your image processing steps.

support_crop_pos

This output parameter returns the crop position used for the support image. It helps you verify the alignment of the support image crop with the source image crop.

support_crop_offset

This output parameter returns the offset value applied to the support crop position. It allows you to confirm the exact offset used for the support image, ensuring precise alignment.

crop_intpol

This output parameter returns the interpolation method used for resizing the cropped image. It helps you verify the quality and smoothness of the resized image, ensuring that the chosen interpolation method meets your requirements.

Crop Image Square (JPS) Usage Tips:

  • To achieve a perfectly centered square crop, set source_crop_pos to "center" and source_crop_offset to 0.
  • Use the crop_intpol parameter to select "lanczos" for high-quality image resizing, especially when working with detailed images.
  • Experiment with different source_crop_pos and support_crop_pos settings to create unique compositions and alignments in your artwork.

Crop Image Square (JPS) Common Errors and Solutions:

"Invalid crop position"

  • Explanation: The specified crop position is not recognized.
  • Solution: Ensure that the source_crop_pos and support_crop_pos parameters are set to one of the valid options: "center", "top", "bottom", "left", or "right".

"Offset value out of range"

  • Explanation: The specified offset value is outside the acceptable range.
  • Solution: Adjust the source_crop_offset and support_crop_offset parameters to be within the range of -2048 to 2048.

"Unsupported interpolation method"

  • Explanation: The specified interpolation method is not supported.
  • Solution: Choose a valid interpolation method from the available options: "lanczos", "nearest", "bilinear", "bicubic", "area", or "nearest-exact".

Crop Image Square (JPS) Related Nodes

Go back to the extension to check out more related nodes.
JPS Custom Nodes for ComfyUI
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.