ComfyUI Node: Image Overlay

Class Name

Image Overlay

Category
Efficiency Nodes/Image
Author
jags111 (Account age: 3922days)
Extension
Efficiency Nodes for ComfyUI Version 2.0+
Latest Updated
2024-08-07
Github Stars
0.83K

How to Install Efficiency Nodes for ComfyUI Version 2.0+

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

Image Overlay Description

Superimpose images with customization options for seamless integration and complex compositions.

Image Overlay:

The Image Overlay node allows you to superimpose one image over another, providing a powerful tool for creating composite images. This node is particularly useful for adding watermarks, logos, or any other graphical elements to a base image. By offering various customization options such as resizing, rotating, and adjusting the opacity of the overlay image, this node ensures that the overlay can be seamlessly integrated into the base image. Additionally, it supports the use of masks to define the transparency of the overlay, allowing for more complex and nuanced compositions. The main goal of this node is to provide a flexible and efficient way to combine images, enhancing your creative workflow.

Image Overlay Input Parameters:

base_image

The base image onto which the overlay image will be applied. This is the primary image that will serve as the background for the overlay. The quality and resolution of the base image will directly affect the final output.

overlay_image

The image that will be overlaid on the base image. This image can be resized, rotated, and have its opacity adjusted to fit the desired composition. The overlay image should ideally be in a format that supports transparency, such as PNG.

overlay_resize

Determines how the overlay image should be resized before being applied to the base image. Options include "None" (no resizing), "Fit" (resize to fit within the base image dimensions), "Resize by rescale_factor" (resize based on a scaling factor), and "Resize to width & height" (resize to specific dimensions). This parameter ensures that the overlay image fits well with the base image.

resize_method

Specifies the method used for resizing the overlay image. Common methods include "nearest", "bilinear", and "bicubic". The choice of method can affect the quality and smoothness of the resized image.

rescale_factor

A scaling factor used to resize the overlay image when the "Resize by rescale_factor" option is selected. This factor is a multiplier applied to the original dimensions of the overlay image. For example, a factor of 0.5 will reduce the size by half, while a factor of 2 will double it.

width

The target width for the overlay image when the "Resize to width & height" option is selected. This allows for precise control over the dimensions of the overlay image.

height

The target height for the overlay image when the "Resize to width & height" option is selected. This allows for precise control over the dimensions of the overlay image.

x_offset

The horizontal offset for positioning the overlay image on the base image. This value determines how far from the left edge of the base image the overlay will be placed.

y_offset

The vertical offset for positioning the overlay image on the base image. This value determines how far from the top edge of the base image the overlay will be placed.

rotation

The angle in degrees to rotate the overlay image before applying it to the base image. This allows for creative positioning and alignment of the overlay.

opacity

The opacity level of the overlay image, specified as a percentage. A value of 100% means the overlay is fully opaque, while 0% means it is fully transparent. This parameter allows for blending the overlay with the base image.

optional_mask

An optional mask image that defines the transparency of the overlay image. The mask should be the same size as the overlay image, with white areas representing full opacity and black areas representing full transparency. This allows for more complex and nuanced compositions.

Image Overlay Output Parameters:

base_image

The resulting image after the overlay has been applied. This image combines the base image and the overlay image according to the specified parameters, producing the final composite image.

Image Overlay Usage Tips:

  • To ensure the overlay image fits well with the base image, use the "Fit" option in the overlay_resize parameter.
  • Adjust the opacity parameter to blend the overlay image smoothly with the base image, creating a more natural composite.
  • Use the optional_mask parameter to create complex transparency effects, such as fading edges or selective visibility.
  • Experiment with different rotation angles to achieve creative and dynamic compositions.

Image Overlay Common Errors and Solutions:

"Overlay image size mismatch"

  • Explanation: The overlay image size does not match the expected dimensions.
  • Solution: Ensure that the overlay image is resized correctly using the overlay_resize parameter.

"Invalid mask dimensions"

  • Explanation: The optional mask image does not match the dimensions of the overlay image.
  • Solution: Resize the mask image to match the overlay image dimensions before applying it.

"Unsupported resize method"

  • Explanation: The specified resize method is not supported.
  • Solution: Choose a valid resize method such as "nearest", "bilinear", or "bicubic".

"Opacity value out of range"

  • Explanation: The opacity value is not within the valid range of 0 to 100.
  • Solution: Adjust the opacity parameter to a value between 0 and 100.

Image Overlay Related Nodes

Go back to the extension to check out more related nodes.
Efficiency Nodes for ComfyUI Version 2.0+
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.