Basic Generation
Generate an image by providing a model and a text prompt.- Python
- Node.js
- cURL
Image Sizes
Control the output dimensions with thesize parameter.
- Python
- Node.js
- cURL
Quality Settings
Thequality parameter controls the detail level and generation time.
Generating Multiple Images
Setn to generate multiple images in a single request.
- Python
- Node.js
- cURL
Response Format
Choose between a temporary URL or base64-encoded image data.URLs are temporary and expire after a short period. If you need to persist the image, download it immediately or use
b64_json.Saving Images Locally
- Python
- Node.js
- cURL
Tips for Better Prompts
Be specific and descriptive
Be specific and descriptive
Instead of “a dog”, try “a golden retriever sitting in a sunlit meadow, photorealistic, soft bokeh background”. More detail gives the model stronger guidance.
Specify a style
Specify a style
Include style cues like “watercolor”, “3D render”, “pixel art”, “oil painting”, or “studio photography” to steer the aesthetic.
Describe composition
Describe composition
Mention framing details such as “close-up”, “bird’s-eye view”, “centered”, or “rule of thirds” for more intentional compositions.