Skip to main content
Glama

comfyui_upload_mask

Upload a mask image to ComfyUI, merging its alpha channel with an existing original image for precise editing or compositing.

Instructions

Upload a mask image to ComfyUI.

The mask's alpha channel is merged into the original image's alpha channel by the ComfyUI server. The original image must already exist in ComfyUI. Defaults to ComfyUI's input directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYesName for the uploaded mask file (e.g. 'mask.png')
mask_dataYesBase64-encoded mask image data
overwriteNoIf True, replace any existing file with the same name. If False (default), ComfyUI auto-renames by suffixing ' (N)'.
subfolderNoOptional subfolder for the mask file
destinationNoDestination directory. 'input' (default) is where workflows read user-supplied masks from; 'output' and 'temp' are usually only useful for testing or scripted setups.input
original_imageYesFilename of the original image the mask applies to (must already exist in ComfyUI's input directory)
original_subfolderNoOptional subfolder of the original image

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses key behavioral details beyond the annotations: the server-side merging of the mask's alpha channel into the original image's alpha channel, and the requirement that the original image pre-exists. Annotations already indicate a non-read-only, non-destructive operation, but the description adds meaningful context about how the server processes the upload. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three short sentences, front-loaded with the primary purpose. Each sentence adds essential information (action, merge behavior, prerequisite, default directory) without redundant or wasted text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the rich input schema (7 params, full descriptions, output schema present), the description covers the core behavior and the critical prerequisite. It could be slightly more explicit about error conditions (e.g., what happens if the original image doesn't exist) or relationship to the sibling upload_image tool, but it is sufficient for correct usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides 100% coverage with descriptions for all 7 parameters, including defaults and enums. The description only vaguely references the default input directory, which is already documented in the schema. It adds no extra parameter-specific semantics, so the baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Upload a mask image to ComfyUI', a specific verb+resource statement that clearly identifies the tool's function. It further distinguishes itself from sibling tools like comfyui_upload_image by explaining the unique alpha-channel merging behavior and the prerequisite that the original image must already exist.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear contextual prerequisite: 'The original image must already exist in ComfyUI.' This implies when the tool is appropriate. However, it does not explicitly name alternative tools (e.g., comfyui_upload_image) or state when not to use this tool, so it falls short of the explicit when/when-not guidance that would earn a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hybridindie/comfyui_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server