generate_image
Generate an image using AI. Supports MeiGen platform or OpenAI-compatible APIs. Tip: get prompts from get_inspiration() or enhance_prompt().
Instructions
Generate an image using AI. Supports MeiGen platform or OpenAI-compatible APIs. Tip: get prompts from get_inspiration() or enhance_prompt(). For MeiGen Midjourney, use referenceType for content/style images and niji7Options for stylize, chaos, raw, image/style weights, sref, profile and MJ quality. Inline --sref/--profile codes remain compatible; other prompt flags are cleaned by the backend. Use referenceImages for local files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Image size for OpenAI-compatible providers: "1024x1024", "1536x1024", "auto". MeiGen: use aspectRatio instead. | |
| wait | No | MeiGen only: false returns the accepted generation ID immediately; poll check_generation separately. Default true waits for completion. Submit-only requires requestId. | |
| model | No | Model name. For OpenAI-compatible providers: any model ID your endpoint supports. For MeiGen: use model IDs from list_models (e.g. "gpt-image-2", "grok-image" = xAI Grok Imagine Quality, 1K/2K, supports image-to-image, "nanobanana-2", "seedream-4.5", "flux2-klein"). | |
| prompt | Yes | The image generation prompt | |
| modelId | No | Alias of model for portable workflow calls. If both are present they must match. | |
| quality | No | Image quality. MeiGen gpt-image-2: "low" / "medium" / "high". OpenAI-compatible providers also accept "high". | |
| download | No | Save the completed result locally (default true). Set false for URL-only workflows. Ignored when wait=false. Other providers may return inline image content when local saving is disabled. | |
| provider | No | Which provider to use. Auto-detected from configuration if not specified. | |
| requestId | No | Persistent UUID for this workflow step. Required when wait=false. Reuse with identical inputs after interruption, including after MCP restart; use a new UUID for a new generation. Omit only for a new interactive generation. | |
| resolution | No | Resolution tier. MeiGen: "1K" / "2K" / "3K" / "4K" — each model supports a subset (list_models reports resolutions when applicable). OpenAI: not used (use size instead). | |
| aspectRatio | No | Aspect ratio for MeiGen provider. Use "auto" (recommended, default when omitted) to let MeiGen infer the best ratio from the prompt content. Explicit values: "1:1", "3:4", "4:3", "16:9", "9:16", "21:9", "2:3", "3:2", "4:5", "5:4", etc. (model-dependent). | |
| modelVariant | No | Optional model variant from live list_models, such as a supported GPT Image 2.5 variant. Forwarded unchanged to MeiGen. | |
| niji7Options | No | MeiGen Midjourney advanced options, matching Web/App. Prefer these over prompt flags; V8.2 ignores weird and fixes sv=6. Preserve identical options on recovery. | |
| referenceType | No | MeiGen Midjourney uploaded-image role; default content. Style images override niji7Options.sref; saved characters remain content references. | |
| negativePrompt | No | Negative prompt for OpenAI-compatible providers. | |
| referenceImages | No | Image references for style/content guidance. Accepts direct public HTTPS URLs without credentials/fragments or accessible absolute local paths. Relative paths are rejected. Local PNG/JPEG/WebP/GIF references up to 32 MiB and 64 million pixels are fully decoded, stripped of metadata and prepared up to 4096px, preserving transparency. Sources: gallery URLs from search_gallery/get_inspiration, URLs from previous generate_image results, or local file paths. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| urls | Yes | ||
| error | No | ||
| status | Yes | ||
| deduped | No | ||
| modelId | No | ||
| success | Yes | ||
| imageUrl | No | ||
| provider | No | ||
| videoUrl | No | ||
| mediaType | No | ||
| requestId | No | ||
| savedPath | No | ||
| nextAction | No | ||
| creditsUsed | No | ||
| generationId | No | ||
| creditsStatus | No | ||
| failureDetail | No | ||
| seedanceDraft | No | ||
| receiptWarning | No | ||
| downloadWarning | No | ||
| observationEnded | No | ||
| pollAfterSeconds | No | ||
| requestedMediaType | No |