upscale_image
Provide an image URL and choose an upscaler model (ESRGAN, SwinIR). The tool fetches the image, runs the upscale through ComfyUI, and outputs the URL of the upscaled result.
Instructions
Upscale an image using a loaded upscaler model (ESRGAN, SwinIR, etc.). Fetches the source image, uploads to ComfyUI, runs the upscale node, and returns the output URL. Requires at least one upscaler model in ComfyUI's models/upscale_models/ directory.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source_image_url | Yes | URL of the image to upscale. Will be fetched and uploaded to ComfyUI. | |
| upscale_model | Yes | Upscaler model filename (e.g. RealESRGAN_x4plus.pth). Use list_models with kind=upscalers to see what's installed. |
Implementation Reference
- src/comfyui/workflows.ts:122-141 (helper)The 'upscale' helper function defines the ComfyUI workflow JSON for upscaling: loads the source image, loads the upscaler model, applies ImageUpscaleWithModel, and saves the result.
export function upscale(params: UpscaleParams): Workflow { return { "1": { class_type: "LoadImage", inputs: { image: params.sourceImage }, }, "2": { class_type: "UpscaleModelLoader", inputs: { model_name: params.upscaleModel }, }, "3": { class_type: "ImageUpscaleWithModel", inputs: { upscale_model: ["2", 0], image: ["1", 0] }, }, "4": { class_type: "SaveImage", inputs: { filename_prefix: "comfyui-mcp-upscale", images: ["3", 0] }, }, }; } - src/comfyui/client.ts:128-130 (helper)The 'listUpscaleModels' method on ComfyUIClient queries ComfyUI for available upscaler model names from the UpscaleModelLoader node, supporting the list_models tool.
async listUpscaleModels(): Promise<string[]> { return this.listNodeOptions("UpscaleModelLoader", "model_name"); }