Generate image (ComfyUI)
generate_imageCreates images from text prompts with a local ComfyUI diffusion model, including reference-guided edits, transparent cutouts, and reproducible seeds; saves PNGs plus prompt and settings metadata.
Instructions
Generates an image with a diffusion model running in ComfyUI on a GPU machine. No API key or per-image cost. Use it for design mockups, reference-guided variations and edits (pass refs), and finished raster assets such as illustrations, photos, textures and transparent cutouts. The PNG is written to out, relative to the project root, with a <out>.json sidecar recording the prompt, seed and settings. The image is also returned in the result when it is small enough. Each call takes roughly 20-120 s, so make calls one at a time. Local models render small text poorly: describe layout, hierarchy, palette, type character and imagery, keep quoted copy to short headlines, and do not rely on body text.
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>",
"out": "<out>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | Yes | Output .png path relative to the project root, e.g. mocks/hero-a.png | |
| refs | No | Reference image paths (project-relative), e.g. a screenshot or a crop. Uses the edit workflow. | |
| seed | No | Fix the seed to make a variation reproducible. | |
| size | No | WIDTHxHEIGHT. Default 1536x1024. Large sizes are scaled down to the configured megapixel cap. Edit workflows may size from the reference instead. | |
| prompt | Yes | Full image prompt. Lead with structure/composition, then style, palette, type character. | |
| negative | No | Negative prompt, if the workflow uses one. | |
| background | No | transparent = run background removal and return a PNG with alpha (for cutouts). |