ComfyUI  >  Nodes  >  HivisionIDPhotos-ComfyUI >  AddBackgroundNode

ComfyUI Node: AddBackgroundNode

Class Name

AddBackgroundNode

Category
AIFSH_HivisionIDPhotos
Author
AIFSH (Account age: 345 days)
Extension
HivisionIDPhotos-ComfyUI
Latest Updated
9/16/2024
Github Stars
0.1K

How to Install HivisionIDPhotos-ComfyUI

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

AddBackgroundNode Description

Enhance images by adding customizable backgrounds seamlessly.

AddBackgroundNode:

The AddBackgroundNode is designed to enhance your images by adding a background to transparent images. This node is particularly useful for creating ID photos, profile pictures, or any other images where a solid or gradient background is desired. By providing various background rendering modes, such as pure color, up-down gradient, and center gradient, this node allows you to customize the look and feel of your images to match your specific needs. The main goal of this node is to seamlessly integrate a background into your transparent images, ensuring a professional and polished final result.

AddBackgroundNode Input Parameters:

size

This parameter specifies the size of the output image. It allows you to choose from a predefined list of sizes, ensuring that your image meets specific requirements or standards. The available options are provided in the size_list_CN dictionary.

bgcolor

This parameter defines the background color of the image. You can select from a list of predefined colors, which are specified in the color_list_CN dictionary. This allows you to match the background color to your desired aesthetic or branding.

render

This parameter determines the rendering mode of the background. You can choose from three options: "纯色" (pure color), "上下渐变" (up-down gradient), and "中心渐变" (center gradient). Each mode provides a different visual effect, allowing you to customize the background to your liking.

kb

This parameter sets the kilobyte size of the output image. It is an integer value with a default of 300. This allows you to control the file size of the output image, which can be important for storage or upload constraints.

dpi

This parameter specifies the dots per inch (DPI) of the output image. It is an integer value with a default of 300. DPI is a measure of the image's resolution, and setting it appropriately ensures that your image is of high quality and suitable for printing or other high-resolution applications.

AddBackgroundNode Output Parameters:

normal_params

This output parameter returns a dictionary containing the parameters used for generating the background. It includes the size, background color, rendering mode, kilobyte size, and DPI. This output is useful for verifying the settings used and for further processing or documentation purposes.

AddBackgroundNode Usage Tips:

  • To achieve a professional look for ID photos, use the "纯色" (pure color) rendering mode with a neutral background color.
  • For more creative or visually appealing images, experiment with the "上下渐变" (up-down gradient) and "中心渐变" (center gradient) rendering modes.
  • Adjust the kb parameter to control the file size of the output image, especially if you need to meet specific upload or storage requirements.
  • Set the dpi parameter to 300 for high-quality prints or to a lower value for web use to optimize file size.

AddBackgroundNode Common Errors and Solutions:

The input image must have 4 channels. 输入图像必须有4个通道,即透明图

  • Explanation: This error occurs when the input image does not have an alpha channel (transparency). The node requires a 4-channel image (RGBA) to add a background correctly.
  • Solution: Ensure that your input image has an alpha channel. You can use image editing software to add transparency to your image before using this node.

Invalid render mode selected

  • Explanation: This error occurs when an invalid rendering mode is selected. The node only supports "纯色" (pure color), "上下渐变" (up-down gradient), and "中心渐变" (center gradient) modes.
  • Solution: Verify that you have selected one of the supported rendering modes. Double-check the input parameters to ensure they match the available options.

Invalid background color selected

  • Explanation: This error occurs when an invalid background color is selected. The node requires a valid color from the predefined list.
  • Solution: Ensure that you have selected a background color from the color_list_CN dictionary. Verify the input parameters to match the available options.

AddBackgroundNode Related Nodes

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