Image Generation
Generate AI images from text prompts with support for references, templates, and chaining.
Basic Generation
Generate an image from a text prompt — the result downloads to your output directory:
npx @banatie/cli generate "a serene mountain landscape at sunset" --aspect-ratio 16:9 --output-dir .The response contains your generated image immediately:
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "success",
"prompt": "a serene mountain landscape at sunset",
"aspectRatio": "16:9",
"outputImage": {
"id": "8a3b2c1d-4e5f-6789-abcd-ef0123456789",
"storageUrl": "https://cdn.banatie.app/my-org/my-project/img/8a3b2c1d-4e5f-6789-abcd-ef0123456789",
"width": 1792,
"height": 1008
},
"flowId": "770e8400-e29b-41d4-a716-446655440002"
}
}One request, one result. The storageUrl is your production-ready image, served via CDN.
Aspect Ratios
Choose the aspect ratio that fits your use case:
Ratio | Dimensions | Best For |
|---|---|---|
1:1 | 1024 x 1024 | Social media posts, profile pictures, thumbnails |
16:9 | 1792 x 1008 | Blog headers, presentations, video thumbnails |
9:16 | 1008 x 1792 | Stories, mobile backgrounds, vertical banners |
3:2 | 1536 x 1024 | Photography-style images, print layouts |
21:9 | 2016 x 864 | Ultra-wide banners, cinematic headers |
Default is 16:9 if not specified.
Prompt Templates
Templates improve your prompt for specific styles. Available templates:
Template | Description |
|---|---|
general | Balanced style for most use cases |
photorealistic | Photo-like realism with natural lighting |
illustration | Artistic illustration style |
minimalist | Clean, simple compositions |
sticker | Sticker-style with clear edges |
product | E-commerce product photography |
comic | Comic book visual style |
Using Reference Images
Add reference images for style guidance or context. Pass image aliases with -r/--reference (repeat for several):
npx @banatie/cli generate "product photo in this style" -r @brand-style -r @product-template --aspect-ratio 1:1 --output-dir .@logo instead of UUIDs. See Working with Images to learn about aliases.You can also mention aliases directly in your prompt text: they're auto-detected:
npx @banatie/cli generate "create a banner using @brand-colors and @logo style" --output-dir .Continuing Generation
Chain multiple generations together by passing the same flowId:
npx @banatie/cli generate "same scene but at night" --flow 770e8400-e29b-41d4-a716-446655440002 --output-dir .Each response includes a flowId you can use to continue the sequence. Flows help organize related generations together.
Regeneration
Want a different result with the same parameters? Regenerate an existing generation:
npx @banatie/cli generation regenerate 550e8400-e29b-41d4-a716-446655440000Same prompt, new image. The generation ID and URL stay the same: the image content is replaced.