ComfyUI > Nodes > ComfyUI Fictiverse Nodes > Add Margin With Color

ComfyUI Node: Add Margin With Color

Class Name

Add Margin With Color

Category
Fictiverse/ImageProcessing
Author
Fictiverse (Account age: 1343days)
Extension
ComfyUI Fictiverse Nodes
Latest Updated
2026-04-26
Github Stars
0.02K

How to Install ComfyUI Fictiverse Nodes

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

Add Margin With Color Description

Enhances images by adding customizable top/bottom margins with black or white color options.

Add Margin With Color:

The Add Margin With Color node is designed to enhance your images by adding a customizable margin around them. This node allows you to specify the size of the margin as a percentage of the image's height and choose whether the margin should be added to the top or bottom of the image. Additionally, you can select the color of the margin, opting for either black or white. This functionality is particularly useful for creating a uniform look across a series of images or for preparing images for presentations or publications where a consistent border is desired. By using this node, you can easily adjust the visual framing of your images without needing to manually edit each one, saving time and ensuring consistency.

Add Margin With Color Input Parameters:

image

This parameter represents the input image to which the margin will be added. It is the primary content that will be processed by the node.

margin_pct

This parameter specifies the size of the margin as a percentage of the image's height. The default value is 10, with a minimum of 0 and a maximum of 100. Adjusting this value will increase or decrease the margin size proportionally to the image's height, allowing for precise control over the margin's appearance.

top

This boolean parameter determines the position of the margin. If set to true, the margin will be added to the top of the image; if false, it will be added to the bottom. The default setting is false, meaning the margin is added to the bottom unless specified otherwise.

black

This boolean parameter allows you to choose the color of the margin. When set to true, the margin will be black; when set to false, it will be white. The default is true, providing a black margin unless you opt for a white one.

Add Margin With Color Output Parameters:

OUTPUT_IMAGE

This output parameter provides the resulting image with the added margin. It includes the original image content along with the newly added margin, either at the top or bottom, depending on the input settings.

MASK

The MASK output is a binary mask that indicates the areas of the original image and the margin. It is useful for further image processing tasks where distinguishing between the original content and the added margin is necessary.

Add Margin With Color Usage Tips:

  • To create a consistent look across multiple images, use the same margin_pct value for each image.
  • If you want to highlight the top of an image, set the top parameter to true to add the margin at the top.
  • Use the black parameter to switch between black and white margins, depending on the background or theme of your project.

Add Margin With Color Common Errors and Solutions:

Image shape mismatch

  • Explanation: This error occurs when the input image does not have the expected shape or dimensions.
  • Solution: Ensure that the input image is in the correct format and dimensions expected by the node, typically a 4D tensor with shape (1, height, width, 3).

Invalid margin percentage

  • Explanation: This error arises when the margin_pct value is set outside the allowed range of 0 to 100.
  • Solution: Adjust the margin_pct value to be within the valid range, ensuring it is not less than 0 or greater than 100.

Add Margin With Color Related Nodes

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