ComfyUI > Nodes > ComfyUI SAM3 > Mask Outline

ComfyUI Node: Mask Outline

Class Name

MaskOutline

Category
SAM3
Author
wouterverweirder (Account age: 5185days)
Extension
ComfyUI SAM3
Latest Updated
2025-12-11
Github Stars
0.06K

How to Install ComfyUI SAM3

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

Mask Outline Description

Generates customizable outlines for masks to highlight image areas for design tasks.

Mask Outline:

The MaskOutline node is designed to enhance your image processing workflow by generating an outline version of a given mask. This node is particularly useful for artists and designers who need to emphasize or highlight specific areas within an image. By creating an outline, you can draw attention to the boundaries of a mask, which can be crucial for tasks such as image segmentation, object detection, or artistic effects. The node allows you to customize the width of the outline and choose whether the outline should be created inside, outside, or on both sides of the original mask boundary. This flexibility ensures that you can achieve the desired visual effect for your specific project needs.

Mask Outline Input Parameters:

mask

The mask parameter is the input mask from which the outline will be created. It is expected to be a tensor with values ranging from 0 to 1, representing the areas of interest within the image. This parameter is crucial as it defines the base shape and area that the outline will follow.

outline_width

The outline_width parameter determines the thickness of the outline in pixels. It allows you to specify how bold or subtle the outline should appear. The width can range from a minimum of 1 pixel to a maximum of 100 pixels, with a default value of 5 pixels. Adjusting this parameter affects the prominence of the outline in the final output.

mode

The mode parameter specifies where the outline should be created relative to the original mask boundary. You can choose from three options: "inside," "outside," or "both." The default setting is "inside," which creates the outline within the mask boundary. Selecting "outside" will generate the outline outside the mask, while "both" will create outlines on both sides of the boundary. This parameter allows for creative flexibility in how the outline interacts with the mask.

Mask Outline Output Parameters:

outline_mask

The outline_mask is the output parameter that provides the resulting mask with the applied outline. This output is a tensor that maintains the same dimensions as the input mask, with the outline added according to the specified parameters. The outline_mask is essential for visualizing the enhanced boundaries of the original mask, making it easier to identify and work with specific areas in your image processing tasks.

Mask Outline Usage Tips:

  • Experiment with different outline_width values to achieve the desired level of emphasis on the mask boundaries. A larger width can make the outline more prominent, while a smaller width can provide a subtle effect.
  • Use the mode parameter creatively to achieve different artistic effects. For instance, using "both" can create a double outline effect that can be visually striking in certain compositions.

Mask Outline Common Errors and Solutions:

"Input mask is not a tensor"

  • Explanation: The input mask provided is not in the expected tensor format.
  • Solution: Ensure that the input mask is a tensor with values between 0 and 1. Convert any non-tensor input to the appropriate format before using the node.

"Outline width out of range"

  • Explanation: The specified outline_width is outside the allowed range of 1 to 100 pixels.
  • Solution: Adjust the outline_width parameter to be within the valid range. Check the input value and ensure it is between 1 and 100.

"Invalid mode selection"

  • Explanation: The mode parameter has been set to a value that is not recognized.
  • Solution: Verify that the mode parameter is set to one of the valid options: "inside," "outside," or "both." Correct any typos or incorrect values.

Mask Outline Related Nodes

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