Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > opencv-comfyui > OpenCV addWeighted_0

ComfyUI Node: OpenCV addWeighted_0

Class Name

addWeighted_0

Category
image/OpenCV
Author
geroldmeisinger (Account age: 1432days)
Extension
opencv-comfyui
Latest Updated
2026-07-22
Github Stars
0.04K

How to Install opencv-comfyui

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

OpenCV addWeighted_0 Description

Blends two images using weighted sum for smooth transitions and adjustable transparency.

OpenCV addWeighted_0:

The addWeighted_0 node is a powerful tool in image processing that allows you to blend two images together using a weighted sum. This node leverages the OpenCV addWeighted function, which is particularly useful for creating smooth transitions between images or for overlaying one image onto another with adjustable transparency. By controlling the weights of each image, you can achieve a variety of visual effects, such as fading, merging, or highlighting specific features. This node is essential for tasks that require precise control over image blending, making it a valuable asset for AI artists looking to enhance their creative projects with sophisticated image compositions.

OpenCV addWeighted_0 Input Parameters:

src1

src1 is the first input image represented as an NPARRAY. This parameter serves as one of the two images to be blended. The choice of this image significantly impacts the final output, as it forms the base layer of the blend. There are no specific minimum or maximum values for this parameter, but it should be a valid image array.

alpha

alpha is a FLOAT value that determines the weight of the first image (src1) in the blending process. It controls the influence of src1 on the final output. A higher alpha value means src1 will be more prominent in the blend. Typically, this value ranges from 0.0 to 1.0, with no default specified.

src2

src2 is the second input image, also represented as an NPARRAY. This image is blended with src1 based on the specified weights. Like src1, it should be a valid image array and complements src1 in creating the final blended image.

beta

beta is a FLOAT value that determines the weight of the second image (src2) in the blending process. It works in conjunction with alpha to balance the contribution of both images. The typical range is from 0.0 to 1.0, and it should be set such that the sum of alpha and beta is ideally 1.0 for a balanced blend.

gamma

gamma is a FLOAT value that adds a scalar to each sum of the weighted images. It acts as a brightness adjustment factor, allowing you to fine-tune the overall brightness of the blended image. There are no strict limits, but it is often set to 0.0 for no additional brightness.

dtype

dtype is an INT that specifies the desired depth of the output image. This parameter is crucial for ensuring that the output image has the correct data type, which can affect the precision and range of pixel values. The specific values depend on the data types supported by OpenCV.

dst

dst is an optional NPARRAY parameter that can be used to store the output image. If provided, the result of the blending operation will be stored in this array. This parameter is useful for reusing existing arrays and optimizing memory usage.

OpenCV addWeighted_0 Output Parameters:

nparray

The output parameter nparray is an NPARRAY that contains the blended image resulting from the weighted sum of src1 and src2. This output is crucial as it represents the final visual product of the blending operation, incorporating the specified weights and gamma adjustment. The nparray can be used directly in further image processing tasks or saved as an image file.

OpenCV addWeighted_0 Usage Tips:

  • To achieve a smooth transition between two images, ensure that the sum of alpha and beta is close to 1.0. This balance helps maintain the integrity of both images in the blend.
  • Use the gamma parameter to adjust the brightness of the blended image. A small positive or negative value can enhance the visual appeal without altering the weights.
  • Experiment with different dtype values to see how they affect the output image's quality and performance, especially when working with high-resolution images.

OpenCV addWeighted_0 Common Errors and Solutions:

Invalid image array

  • Explanation: This error occurs when src1 or src2 is not a valid image array.
  • Solution: Ensure that both src1 and src2 are correctly formatted NPARRAY objects representing images.

Alpha and beta sum not equal to 1

  • Explanation: The sum of alpha and beta should ideally be 1.0 for a balanced blend.
  • Solution: Adjust the values of alpha and beta so that their sum is approximately 1.0.

Unsupported dtype

  • Explanation: The specified dtype is not supported by OpenCV for the output image.
  • Solution: Verify that the dtype value is compatible with OpenCV's supported data types for images.

OpenCV addWeighted_0 Related Nodes

Go back to the extension to check out more related nodes.
opencv-comfyui
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.

OpenCV addWeighted_0