ComfyUI  >  Nodes  >  zhangp365/ComfyUI-utils-nodes >  Image Composite Masked with Switch

ComfyUI Node: Image Composite Masked with Switch

Class Name

ImageCompositeMaskedWithSwitch

Category
utils/image
Author
zhangp365 (Account age: 408 days)
Extension
zhangp365/ComfyUI-utils-nodes
Latest Updated
10/16/2024
Github Stars
0.0K

How to Install zhangp365/ComfyUI-utils-nodes

Install this extension via the ComfyUI Manager by searching for  zhangp365/ComfyUI-utils-nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter zhangp365/ComfyUI-utils-nodes 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 Composite Masked with Switch Description

Facilitates seamless overlay of two images with optional masking and switch control for conditional processing.

Image Composite Masked with Switch:

The ImageCompositeMaskedWithSwitch node is designed to facilitate the seamless combination of two images, allowing you to overlay a source image onto a destination image at specified coordinates. This node is particularly useful for creating complex image compositions where precise placement and optional masking are required. One of its standout features is the ability to enable or disable the operation through a switch, providing flexibility in workflows where conditional image processing is needed. By leveraging this node, you can achieve intricate image overlays with optional resizing and masking, making it a powerful tool for AI artists looking to enhance their creative projects.

Image Composite Masked with Switch Input Parameters:

destination

The destination parameter specifies the base image onto which the source image will be overlaid. This is the primary canvas for the composite operation. The input type is IMAGE.

source

The source parameter defines the image that will be overlaid onto the destination image. This image can be resized and masked as per the other parameters. The input type is IMAGE.

x

The x parameter determines the horizontal position (in pixels) where the top-left corner of the source image will be placed on the destination image. It accepts integer values with a default of 0, a minimum of 0, and a maximum of 16384.

y

The y parameter sets the vertical position (in pixels) where the top-left corner of the source image will be placed on the destination image. It accepts integer values with a default of 0, a minimum of 0, and a maximum of 16384.

resize_source

The resize_source parameter is a boolean that indicates whether the source image should be resized to fit within the destination image. The default value is False.

mask

The mask parameter is optional and allows you to specify a mask image that defines the transparency levels for the source image. This mask can be used to create more complex and nuanced composites. The input type is MASK.

enabled

The enabled parameter is a boolean switch that controls whether the composite operation is performed. If set to False, the node will bypass the operation. The default value is True.

Image Composite Masked with Switch Output Parameters:

IMAGE

The output is a single IMAGE that represents the result of the composite operation. This image is the destination image with the source image overlaid at the specified coordinates, optionally resized and masked as per the input parameters.

BOOLEAN

The output also includes a BOOLEAN value that reflects the state of the enabled parameter. This can be useful for conditional workflows where the composite operation may be toggled on or off.

Image Composite Masked with Switch Usage Tips:

  • Ensure that the x and y coordinates are within the bounds of the destination image to avoid unexpected results.
  • Use the resize_source parameter to fit the source image within the destination image if the source image is larger.
  • Apply a mask to the mask parameter to create more intricate and visually appealing composites by controlling the transparency of the source image.
  • Utilize the enabled switch to conditionally apply the composite operation, which can be useful in dynamic workflows where certain conditions dictate whether the operation should be performed.

Image Composite Masked with Switch Common Errors and Solutions:

Invalid image file: <image>

  • Explanation: This error occurs when the specified image file does not exist or is not accessible.
  • Solution: Verify that the image file path is correct and that the file exists in the specified directory.

Mask dimensions do not match source image dimensions

  • Explanation: This error occurs when the mask image dimensions do not match the source image dimensions.
  • Solution: Ensure that the mask image has the same width and height as the source image.

Composite operation disabled

  • Explanation: This message indicates that the composite operation was not performed because the enabled parameter was set to False.
  • Solution: Set the enabled parameter to True if you want the composite operation to be executed.

Image Composite Masked with Switch Related Nodes

Go back to the extension to check out more related nodes.
zhangp365/ComfyUI-utils-nodes
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.