ComfyUI > Nodes > ComfyUI-RMBG > Image Stitch (RMBG) 🖼️

ComfyUI Node: Image Stitch (RMBG) 🖼️

Class Name

AILab_ImageStitch

Category
🧪AILab/🖼️IMAGE
Author
1038lab (Account age: 1116days)
Extension
ComfyUI-RMBG
Latest Updated
2026-02-03
Github Stars
1.89K

How to Install ComfyUI-RMBG

Install this extension via the ComfyUI Manager by searching for ComfyUI-RMBG
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-RMBG 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Image Stitch (RMBG) 🖼️ Description

Combines multiple images into one, offering grid arrangements, alignment, and spacing options.

Image Stitch (RMBG) 🖼️:

The AILab_ImageStitch node is designed to seamlessly combine multiple images into a single cohesive output. This node is particularly useful for AI artists who want to create composite images by stitching together different visual elements. It offers various stitching modes, allowing you to arrange images in a grid or align them in specific orientations such as left, right, up, or down. The node also provides options to match image sizes, add spacing between images, and apply color values to the spacing, ensuring a smooth and visually appealing transition between stitched images. By leveraging this node, you can efficiently create complex image compositions without needing extensive technical knowledge, making it an essential tool for enhancing your creative projects.

Image Stitch (RMBG) 🖼️ Input Parameters:

image1

This parameter represents the first image to be stitched. It serves as the reference image for size and color matching when combining with other images. The quality and dimensions of this image can significantly impact the final stitched output.

image2

The second image to be stitched alongside image1. If not provided, a blank image matching image1's dimensions and color will be used. This parameter allows you to expand your composition by adding another visual element.

image3

An optional third image to be included in the stitching process. If omitted, a blank image will be used. This parameter is useful for creating more complex compositions by adding additional layers.

image4

The fourth image to be stitched, completing a 2x2 grid if all images are provided. Like image3, it is optional and will default to a blank image if not specified. This parameter allows for maximum flexibility in creating multi-image layouts.

stitch_mode

Determines the arrangement of images. Options include "kontext_mode", "2x2", and other directional modes like "left", "right", "up", and "down". This parameter defines how images are aligned and combined, affecting the overall layout of the stitched image.

match_image_size

A boolean parameter that, when enabled, ensures all images are resized to match the dimensions of image1. This helps maintain a consistent look across the stitched output, especially when images of varying sizes are used.

megapixels

Specifies the target size of the final stitched image in megapixels. If set to a value greater than zero, the node will adjust the output size to meet this target, ensuring high-resolution results.

max_width

Defines the maximum allowable width for the stitched image. This parameter helps control the dimensions of the output, preventing excessively wide images that may be difficult to manage or display.

max_height

Sets the maximum height for the stitched image. Similar to max_width, this parameter ensures the output remains within manageable dimensions, particularly useful for maintaining aspect ratios.

spacing_width

Determines the width of the spacing between stitched images. This parameter allows you to create visual separation between images, enhancing the overall composition by adding breathing space.

color_val

Specifies the color used for spacing between images. This parameter accepts RGB values and ensures that the spacing complements the images, contributing to a harmonious final output.

upscale_method

Defines the method used to upscale images when resizing is necessary. This parameter affects the quality of resized images, with options that balance between speed and visual fidelity.

Image Stitch (RMBG) 🖼️ Output Parameters:

result

The final stitched image, combining all provided images according to the specified parameters. This output is a single cohesive image that reflects the chosen stitching mode, spacing, and color settings, ready for further use or display.

Image Stitch (RMBG) 🖼️ Usage Tips:

  • Experiment with different stitch_mode settings to achieve various layouts, such as grids or linear arrangements, to best suit your creative vision.
  • Use the match_image_size option to ensure a uniform look across all images, especially when working with images of different resolutions or aspect ratios.
  • Adjust spacing_width and color_val to create visually appealing separations between images, enhancing the overall aesthetic of your composition.

Image Stitch (RMBG) 🖼️ Common Errors and Solutions:

Image size mismatch

  • Explanation: This error occurs when images have incompatible dimensions and match_image_size is not enabled.
  • Solution: Enable match_image_size to automatically resize images to a consistent size, or manually adjust the dimensions of your images before stitching.

Invalid color value

  • Explanation: The color_val parameter may contain invalid RGB values outside the acceptable range.
  • Solution: Ensure that color_val is specified as a tuple of three integers, each ranging from 0 to 255, representing valid RGB color values.

Exceeding maximum dimensions

  • Explanation: The stitched image exceeds the specified max_width or max_height.
  • Solution: Adjust the max_width and max_height parameters to accommodate the desired output size, or reduce the number of images being stitched.

Image Stitch (RMBG) 🖼️ Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-RMBG
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.