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:

Create a generation
npx @banatie/cli generate "a serene mountain landscape at sunset" --aspect-ratio 16:9 --output-dir .

The response contains your generated image immediately:

201 Created
{
  "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:11024 x 1024Social media posts, profile pictures, thumbnails
16:91792 x 1008Blog headers, presentations, video thumbnails
9:161008 x 1792Stories, mobile backgrounds, vertical banners
3:21536 x 1024Photography-style images, print layouts
21:92016 x 864Ultra-wide banners, cinematic headers

Default is 16:9 if not specified.

Prompt Templates

Templates improve your prompt for specific styles. Available templates:

Template
Description
generalBalanced style for most use cases
photorealisticPhoto-like realism with natural lighting
illustrationArtistic illustration style
minimalistClean, simple compositions
stickerSticker-style with clear edges
productE-commerce product photography
comicComic book visual style
Template selection coming soon. Currently uses general style for all generations.

Using Reference Images

Add reference images for style guidance or context. Pass image aliases with -r/--reference (repeat for several):

With references
npx @banatie/cli generate "product photo in this style" -r @brand-style -r @product-template --aspect-ratio 1:1 --output-dir .
Pro Tip: Use aliases like @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:

Auto-detected aliases
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:

Continue in a flow
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:

Regenerate
npx @banatie/cli generation regenerate 550e8400-e29b-41d4-a716-446655440000

Same prompt, new image. The generation ID and URL stay the same: the image content is replaced.

Next Steps