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_1

ComfyUI Node: OpenCV addWeighted_1

Class Name

addWeighted_1

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_1 Description

Blends two images using weighted sum for transitions, overlays, and brightness adjustment.

OpenCV addWeighted_1:

The addWeighted_1 node is a powerful tool within the OpenCV library designed to blend two images together by applying a weighted sum. This node is particularly useful for creating smooth transitions between images or for overlaying one image onto another with adjustable transparency. By leveraging the cv2.addWeighted function, it allows you to specify the contribution of each image to the final result through weights, making it ideal for tasks such as image blending, watermarking, and creating composite images. The node's ability to incorporate a constant scalar value (gamma) further enhances its flexibility, enabling you to adjust the brightness of the resulting image. Overall, addWeighted_1 provides a straightforward yet versatile method for combining images in a controlled manner, making it an essential tool for AI artists looking to manipulate and enhance visual content.

OpenCV addWeighted_1 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 image should be in a compatible format, typically a multi-dimensional array representing pixel values. The quality and resolution of this image will directly affect the final output.

alpha

alpha is a FLOAT value that determines the weight of the first image (src1) in the blending process. It ranges from 0.0 to 1.0, where 0.0 means the first image does not contribute to the final result, and 1.0 means it fully contributes. Adjusting this value allows you to control the prominence of src1 in the blended image.

src2

src2 is the second input image, also represented as an NPARRAY. Like src1, this image is blended with the first image based on the specified weights. It should be of the same size and type as src1 to ensure proper blending.

beta

beta is a FLOAT value that specifies the weight of the second image (src2) in the blending process. Similar to alpha, it ranges from 0.0 to 1.0. This parameter allows you to control how much src2 influences the final blended image.

gamma

gamma is a FLOAT value that adds a constant scalar to the weighted sum of the two images. This parameter can be used to adjust the brightness of the resulting image, providing additional control over the final appearance.

dtype

dtype is an INT that specifies the desired depth of the output image. This parameter is crucial for ensuring that the resulting image has the appropriate data type, which can affect the precision and range of pixel values.

dst

dst is an optional NPARRAY parameter that can be used to store the output image. If provided, the result will be stored in this array, allowing for in-place operations and potentially optimizing memory usage.

OpenCV addWeighted_1 Output Parameters:

nparray

The output parameter nparray is an NPARRAY that contains the blended image resulting from the weighted sum of src1 and src2, adjusted by alpha, beta, and gamma. This output represents the final visual content after the blending operation, ready for further processing or display.

OpenCV addWeighted_1 Usage Tips:

  • Ensure that src1 and src2 are of the same size and type to avoid errors and achieve a seamless blend.
  • Experiment with different values of alpha and beta to find the perfect balance between the two images for your specific artistic needs.
  • Use the gamma parameter to fine-tune the brightness of the resulting image, especially if the initial blend appears too dark or too bright.

OpenCV addWeighted_1 Common Errors and Solutions:

Mismatched Image Sizes

  • Explanation: The images src1 and src2 must be of the same size for the blending operation to work correctly.
  • Solution: Resize the images to match in dimensions before using the addWeighted_1 node.

Invalid Data Type

  • Explanation: The dtype parameter must be compatible with the data types of src1 and src2.
  • Solution: Ensure that the dtype is set to a value that matches the data types of the input images, or convert the images to a compatible type.

Out of Range Alpha/Beta Values

  • Explanation: The alpha and beta values should be within the range of 0.0 to 1.0.
  • Solution: Adjust the alpha and beta values to be within the valid range to ensure proper blending.

OpenCV addWeighted_1 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_1