LayerStyle
Run ComfyUI Easily with InstaSD
Skip the complex setup. 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: ImageScaleRestore
LayerUtility: ImageScaleRestore Node Documentation
Overview
The LayerUtility: ImageScaleRestore node in ComfyUI is designed to resize images while preserving or restoring their original styling and structure. This node is particularly useful for applications where images need to be adjusted to different scales without losing quality or detail.
What This Node Does
The ImageScaleRestore node resizes input images using a specified scaling method, either by a fixed scale factor or by matching the length of the longest side to a specified value. It ensures the scaled image maintains its original proportions and quality through various interpolation methods. It can process accompanying masks to maintain integrity in images with transparency or to handle regions of interest.
Inputs
-
image: The primary input image(s) that you want to scale. This input is required.
-
scale: A float indicating the factor by which to scale the image. The default is 1. The value can range from 0.01 to 100, allowing for significant enlargement or reduction.
-
method: The interpolation method used for scaling. Options include:
lanczosbicubichammingbilinearboxnearest
-
scale_by_longest_side: A boolean option indicating whether to scale the image such that the longest side matches a specified length. The default is
False. -
longest_side: An integer defining the target length of the longest side, used when
scale_by_longest_sideisTrue. The default value is 1024. -
mask (optional): An optional mask image that accompanies the main image. Useful for images with transparency layers.
-
original_size (optional): Specifies the original dimensions (width, height) if known. This is utilized to restore the image dimensions accurately post-scaling.
Outputs
-
image: The resulting scaled image.
-
mask: The processed mask, scaled to match the resized image dimensions.
-
original_size: A list containing the original width and height of the image before scaling.
-
width: The width of the scaled image.
-
height: The height of the scaled image.
Usage in ComfyUI Workflows
In ComfyUI workflows, this node can be used to:
- Prepare images for different output formats or requirements, ensuring they fit into different components or layouts as needed.
- Adjust image resolutions when integrating with other media, ensuring consistency with external content specifications.
- Apply uniform styling to a collection of images by applying consistent scaling methods across a batch.
- Manage image sizes dynamically based on user input or predefined conditions, streamlining image processing pipelines.
Special Features and Considerations
-
Interpolation Methods: The node offers multiple interpolation methods, allowing users to balance processing speed and image quality based on the needs of their project.
-
Mask Handling: With optional mask processing, the node ensures that areas of interest or transparency are not lost during scaling, maintaining image integrity.
-
Flexible Scaling: Users can opt to scale images based on set dimensions or proportions, adding versatility to its use in diverse projects.
-
Automatic Logging: The node provides logging for processes completed, aiding users in tracking workflow progress and identifying any processing stages at a glance.
The ImageScaleRestore is a versatile tool in ComfyUI for managing and styling images effectively, crucial in projects demanding high-quality visual consistency.