LayerStyle
Run ComfyUI Easily with InstaSD
Skip the complex setup and run ComfyUI online. InstaSD helps creative professionals build workflows and deploy them to the world:
- One-click deployment
- Any model, any node
- Powerful GPUs for rapid iteration
A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
Available Nodes
LayerUtility: ImageScaleByAspectRatio V2
LayerUtility: ImageScaleByAspectRatio V2 - Documentation
Overview
The LayerUtility: ImageScaleByAspectRatio V2 node is a powerful image processing tool within the ComfyUI framework. It enables users to scale images while preserving or altering their aspect ratios. This node provides flexibility in resizing images according to various user-defined criteria, utilizing several fitting modes and rendering methods to achieve the desired output.
Functionality
This node is designed to adjust the dimensions of images based on a specified aspect ratio. It can either maintain the original aspect ratio or use a custom one, ensuring that the resulting image’s width and height fit particular constraints. This is especially useful in workflows where images need to be standardized in size while preserving certain visual characteristics.
Inputs
This node accepts the following inputs:
Required Inputs
-
Aspect Ratio: Defines how the image's dimensions are proportioned. Options include:
original: Maintains the original aspect ratio of the image.custom: Allows for a user-defined aspect ratio.- Pre-defined ratios such as
1:1,3:2,4:3,16:9,2:3,3:4,9:16.
-
Proportional Width & Proportional Height: Integers that define the custom width and height ratios when
customis selected as the aspect ratio. -
Fit Mode: Specifies how the image will be adjusted within the new dimensions. Options include
letterbox,crop, andfill. -
Method Mode: Selects the algorithm for image resampling during resizing. Available methods are
lanczos,bicubic,hamming,bilinear,box, andnearest. -
Round to Multiple: Ensures that the final image dimensions are rounded up to a specified multiple. Options range from
8to512, orNone. -
Scale To Side: Determines which side of the image is used for scaling. Options include
None,longest,shortest,width,height, andtotal_pixel(kilo pixel). -
Scale To Length: An integer specifying the target length for scaling, applicable when
Scale To Sideis notNone. -
Background Color: A string value defining the background color used when resizing with
letterboxfit mode.
Optional Inputs
- Image: The image data to be processed.
- Mask: An optional mask that can be applied to the image for additional processing.
Outputs
The node produces the following outputs:
- Image: The processed image, resized according to the specified parameters.
- Mask: The processed mask, if one was provided and applicable for transformation.
- Original Size: A tuple containing the original width and height of the image.
- Width & Height: Integers indicating the final width and height of the processed image.
Usage in ComfyUI Workflows
Within a ComfyUI workflow, this node can be employed to standardize image sizes, adapt images for display on various devices, or prepare images for further processing steps. The flexibility in aspect ratio selection and the variety of fit and method modes make it a versatile node suitable for numerous scenarios. Users can efficiently incorporate this node to ensure consistent image dimensions across different workflow stages, especially in graphics design or digital content creation pipelines.
Special Features and Considerations
- Customizable Aspect Ratios: Users can keep the original aspect ratio or define a custom one, providing great flexibility in meeting specific design requirements.
- Multiple Resizing Methods: Various methods are available for resizing images, allowing users to prioritize quality or speed based on their needs.
- Flexible Dimension Constraints: With options to scale based on width, height, or pixel count, users can meet specific project constraints effectively.
- Background Color for Letterbox Fit: When using the letterbox fit mode, users can specify a background color to fill any space around the resized image.
Consider the implications of aspect ratio changes and rounding to multiples on the image's visual appearance, as they can impact the final result significantly, especially in design-sensitive workflows.