Generate Image
generate_imageCreate one or more images from text prompts locally using ComfyUI and Qwen Image 2.1; queue jobs and retrieve results via prompt IDs. Supports seeds, exact sizes, aspect ratios, and batches.
Instructions
Generate one or more images locally using ComfyUI and Qwen Image 2.1. Queues the job(s) and returns immediately with prompt_ids and seeds; then call get_result with the prompt_ids to wait for and receive the image paths. The seed is a decimal string; pass that exact string back to reproduce the same generation. A seed does not edit an existing picture; use edit_image for that. Prefer width+height for exact sizes (icons ~256-512, UI ~1024, cinematic up to 2048). Values are rounded to multiples of 8. If width/height are omitted, aspect_ratio + megapixels are used instead.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Seed as a decimal string. Reuse the exact seed from a previous result to reproduce that generation. When count is greater than 1, later images use seed+1, seed+2, and so on. | |
| count | No | Number of images to generate, from 1 to 4 | |
| width | No | Exact width in pixels (64-2048). Requires height. When set with height, bypasses aspect_ratio/megapixels. | |
| height | No | Exact height in pixels (64-2048). Requires width. When set with width, bypasses aspect_ratio/megapixels. | |
| prompt | Yes | Detailed image description | |
| megapixels | No | Approximate image resolution in megapixels (used when width/height are omitted; min 0.05, max 4) | |
| aspect_ratio | No | Image aspect ratio (used when width/height are omitted) | 1:1 |