convert_image
Re-encode generated images to PNG, JPEG, or WebP formats. Accepts asset IDs or local file paths with configurable quality and compression options.
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
| Name | Required | Description | Default |
|---|---|---|---|
| asset_id | No | Registered asset id from a completed job. Provide exactly one of asset_id or path. | |
| path | No | Path to a source image under COMFYUI_PATH/output. Provide exactly one of asset_id or path. | |
| format | Yes | Target encoded image format. | |
| quality | No | Encoder quality, 1-100. Applies where supported by the selected format. | |
| progressive | No | JPEG only: write a progressive JPEG. | |
| lossless | No | WebP only: write lossless WebP. | |
| effort | No | WebP only: encoder effort, 0-6. | |
| out_path | No | Optional output path under COMFYUI_PATH/output where the converted image should be written. |