generate_and_download_image
Generate an image from a text prompt and immediately download it, receiving the image as base64 or saving to a file. Combines generation and download in one operation.
Instructions
Generate an image and automatically download it. This combines generate_image and download_image into a single operation. Returns the image as base64 or saves to a file. Best for when you want the image data immediately.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Image size (e.g., "1280x1280", "1568x1056") | 1280x1280 |
| model | No | Model to use for generation | glm-image |
| output | No | Output format: "base64" returns the image data directly, "file_output" saves to disk | base64 |
| prompt | Yes | Text description of the image to generate | |
| quality | No | Quality level: "hd" (more detailed, ~20s) or "standard" (faster, ~5-10s) | |
| user_id | No | Unique end user ID for abuse prevention (6-128 characters) | |
| max_wait | No | Maximum seconds to wait for image generation (default: 120) | |
| file_output | No | Absolute path to save the image file (required if output is "file_output"). Example: /path/to/image.png | |
| poll_interval | No | Seconds to wait between polling for async results (default: 3) |