download_image
Download and save images from URLs directly to a specified absolute path, facilitating image management within the ComfyUI MCP Server.
Instructions
Download an image from a URL and save it to a file.
Args:
url: The URL of the image to download.
save_path: The absolute path to save the image to. Must be an absolute path, otherwise the image will be saved relative to the server location.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| save_path | Yes | ||
| url | Yes |
Implementation Reference
- src/server.py:33-42 (handler)The download_image tool handler, registered via @mcp.tool() decorator. Downloads the image from the given URL using urllib.request.urlretrieve and saves it to save_path, returning success status.@mcp.tool() async def download_image(url: str, save_path: str) -> Any: """Download an image from a URL and save it to a file. Args: url: The URL of the image to download. save_path: The absolute path to save the image to. Must be an absolute path, otherwise the image will be saved relative to the server location. """ urllib.request.urlretrieve(url, save_path) return {"success": True}