import type { Metadata } from 'next'; import { TipBox } from '@/components/docs/shared/TipBox'; import { Table } from '@/components/docs/shared/Table'; import { CodeBlock } from '@/components/docs/shared/CodeBlock'; import { DocPage } from '@/components/docs/layout/DocPage'; import { JsonLd } from '@/components/seo/JsonLd'; import { createDocsMetadata, DOCS_PAGES } from '@/config/docs-seo'; import { createBreadcrumbSchema, createTechArticleSchema } from '@/config/docs-schema'; import { Hero, SectionHeader, InlineCode, ResponseBlock, } from '@/components/docs/blocks'; const PAGE = DOCS_PAGES['generation']; export const metadata: Metadata = createDocsMetadata(PAGE); const breadcrumbSchema = createBreadcrumbSchema([ { name: 'Home', path: '/' }, { name: 'Documentation', path: '/docs/' }, { name: 'Image Generation', path: '/docs/generation/' }, ]); const articleSchema = createTechArticleSchema(PAGE); const tocItems = [ { id: 'basic-generation', text: 'Basic Generation', level: 2 }, { id: 'aspect-ratios', text: 'Aspect Ratios', level: 2 }, { id: 'prompt-templates', text: 'Prompt Templates', level: 2 }, { id: 'reference-images', text: 'Using Reference Images', level: 2 }, { id: 'continuing-generation', text: 'Continuing Generation', level: 2 }, { id: 'regeneration', text: 'Regeneration', level: 2 }, { id: 'next-steps', text: 'Next Steps', level: 2 }, ]; export default function GenerationPage() { return ( <>
Basic Generation

Generate an image by sending a text prompt to the generations endpoint:

The response contains your generated image immediately:

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:

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:

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'], ]} />
Template selection coming soon. Currently uses general style for all generations.
Using Reference Images

Add reference images for style guidance or context. Pass image IDs or aliases in the referenceImages array:

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:

Continuing Generation

Chain multiple generations together by passing the same flowId:

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:

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

); }