generate_image
Generate images from detailed text prompts using a chosen AI model, with options for size and a reference image to guide the result. Saves the output to a specified file path.
Instructions
Generate an image from a text prompt using the specified model.
Args: prompt: Detailed text description of the image to generate. Be specific about subject, style, lighting, colors, composition, and mood. Example: "A fluffy orange cat sitting on a windowsill, golden hour lighting, watercolor style" model_id: Model identifier from list_models(). Examples: "amazon.nova-canvas-v1:0", "gpt-image-1.5", "models/gemini-2.5-flash-image" output_path: Absolute or relative file path where the generated image will be saved. Supports PNG, JPEG formats. Parent directories are created automatically. reference_image: Optional. Path to an existing image to use as style/content reference. The model will generate a new image influenced by this reference. width: Optional. Image width in pixels. Default: 1024. Common values: 512, 768, 1024, 1280. Note: Some models only support specific sizes. Max: 4096px. height: Optional. Image height in pixels. Default: 1024. Common values: 512, 768, 1024, 1280. Note: Some models only support specific sizes. Max: 4096px.
Returns: Success message with output path, or error description.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | ||
| height | No | ||
| prompt | Yes | ||
| model_id | Yes | ||
| output_path | Yes | ||
| reference_image | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |