Generate image from text
text-to-imageGenerate an image from a text prompt using Gemini, Grok, GPT-image, or impossibl.com, then save the result to disk.
Instructions
Generates an image from a text prompt using Gemini, Grok Image, GPT-image, or impossibl.com, and saves it to disk.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of images to generate. Default 1. | |
| size | No | Provider-specific size string, e.g. "1024x1024". | |
| model | No | Specific model id. Defaults to that provider's latest non-top-tier model. Call list_image_providers to see options. | |
| prompt | Yes | Text description of the image to generate. | |
| quality | No | Provider-specific quality hint (e.g. "low"/"medium"/"high" for gpt-image). Defaults to a non-maximum tier. | |
| filename | No | Base filename (without extension) to save the image as. | |
| provider | No | Which image provider to use. REQUIRED when more than one of GEMINI_API_KEY / XAI_API_KEY / OPENAI_API_KEY / IMPOSSIBL_API_KEY is configured and IMAGE_PROVIDER_DEFAULT is not set. In that case: first check your memory for a stored user preference for a default image provider; if there is none, ask the user which provider to use before calling this tool, then remember their answer for future calls. | |
| aspect_ratio | No | Aspect ratio such as "16:9" (Gemini only). |