generate_image_from_text
Create an image from a text prompt using Gemini AI, with optional saving to a directory.
Instructions
Generate an image from a text prompt using Gemini.
Args: prompt: Text description of the desired image. output_dir: Optional directory to save the generated image. If not provided, the image is only returned in the response (not saved to disk). model: Optional Gemini model name. If not provided, uses GEMINI_MODEL environment variable. ctx: Optional context for progress reporting.
Returns: List containing ImageContent with the generated image, and optionally TextContent with file path if saved.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | ||
| prompt | Yes | ||
| output_dir | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |