Skip to main content
Glama

convert_image

Re-encode generated images to PNG, JPEG, or WebP via asset ID or file path, optionally saving the result and reporting size savings.

Instructions

Re-encode a generated image to PNG, JPEG, or WebP and return it inline as an image content block. Source can be a registered asset_id or a path under the local ComfyUI output directory. Optionally writes the converted image back under the output directory and reports source/output size plus bytes saved.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
asset_idNoRegistered asset id from a completed job. Provide exactly one of asset_id or path.
pathNoPath to a source image under COMFYUI_PATH/output. Provide exactly one of asset_id or path.
formatYesTarget encoded image format.
qualityNoEncoder quality, 1-100. Applies where supported by the selected format.
progressiveNoJPEG only: write a progressive JPEG.
losslessNoWebP only: write lossless WebP.
effortNoWebP only: encoder effort, 0-6.
out_pathNoOptional output path under COMFYUI_PATH/output where the converted image should be written.
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the dual output (inline and optional file write), reports size and bytes saved, and implies read-only behavior (converts, no deletion). It could mention safety traits (no destructive actions) but is fairly transparent.

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?

Two sentences, front-loaded with the main action. Every word adds value. No redundancy or filler.

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?

Covers core functionality, source options, formats, optional output, and reporting. Lacks explicit mutual exclusivity warning for asset_id and path, and error handling. With rich schema and no output schema, it is relatively complete.

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?

Schema coverage is 100%, so the schema documents all parameters adequately. The description adds value by tying sources together and mentioning optional output, but does not elaborate on format-specific parameters like progressive or lossless beyond what schema says. Baseline 3 is appropriate.

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 clearly states the tool's purpose: re-encode a generated image to PNG, JPEG, or WebP, return it inline, and optionally write to output directory. It specifies the source (asset_id or path) and distinguishes itself from generation, viewing, and other sibling tools.

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 implies usage context by specifying sources (asset_id or local path) but does not explicitly state when to use this tool vs alternatives. However, the purpose is distinct from siblings like generate_image or view_image, offering clear implicit guidance.

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/artokun/comfyui-mcp'

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