download_image
Download images from URLs and save them to specified file paths for use in ComfyUI workflows.
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 |
|---|---|---|---|
| url | Yes | ||
| save_path | Yes |
Implementation Reference
- src/server.py:33-42 (handler)The handler function for the 'download_image' tool. It is registered via the @mcp.tool() decorator. Downloads an image from the provided URL and saves it to the specified path using urllib.request.urlretrieve, then returns a success indicator. The function signature and docstring define the input schema.@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}