Generate Image
generate_imageCreate images from text prompts with flux-2-klein or qwen-image-2.1; save each result to a unique file and return the path plus temporary source URL.
Instructions
Generate an image from a text prompt with flux-2-klein (default) or qwen-image-2.1 (NaN API). qwen-image-2.1 is text-to-image only and renders text inside the image more cleanly; use edit_image when you already have reference images to transform. Saves each image under NAN_OUTPUT_DIR (default ~/nan-mcp-output) and never overwrites: a taken name gets -2, -3, and so on. Returns the saved path and the temporary source URL. Counts against the account image quota (100/month, shared by both image models).
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 |
|---|---|---|---|
| n | No | Number of images to generate (1-4). Default 1. Each one counts against the monthly quota | |
| seed | No | Base seed for reproducibility. qwen-image-2.1 requires an integer from 0 to 2147483647 | |
| size | No | Image size "WxH" divisible by 16, e.g. 1024x1024, 1536x1024, 1024x1536. flux-2-klein: 256-1536 px per side; qwen-image-2.1: 512-1280 px per side. Aspect ratio 1:3-3:1. Default 1024x1024 | |
| model | No | Image model: "flux-2-klein" (default; text to image) or "qwen-image-2.1" (text to image with cleaner text rendering; 512-1280 px, seed 0-2147483647, no guidance) | |
| prompt | Yes | Textual description of the image to generate | |
| guidance | No | FLUX guidance scale (flux-2-klein only) | |
| outputName | No | Optional base name for the output file(s). Sanitised to a safe filename; an existing name is never overwritten |