Image generationPro
Four variations grow out of a grid of dots: first a ripple, then a halftone in the colours to come, then a soft focus that resolves. Pick one from the strip, then upscale it, vary it or save it.
oxyn add image-generationThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- Generate images from a prompt and pick one: four variations form, a filmstrip picks one, Upscale doubles it and Vary makes four more from it.
When not to use
- Replays a multi-agent run on one clock: use Agent timeline instead.
- One model at a glance: use Model card instead.
- A small automation on a single rail: use AI workflow instead.
Installation
Image generation is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add image-generationUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Dot matrix
Four variations forming on the dot matrix.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Blur up
Blur-up placeholder in 16:9 (Oxyn extra).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Batch grid
All four in a grid with scan lines (Oxyn extra).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Failed
The third variation fails; the others finish.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
ImageGeneration
| Prop | Type | Default | Description |
|---|---|---|---|
nowrequired | ClockMs | — | Host clock. |
autoplay | bool | true | Generate once on mount. |
fail | bool | Default::default() | The third variation fails (error demo). |
aspect | usize | Default::default() | Starting aspect (0 1:1, 1 4:5, 2 16:9). |
placeholder | String | "dots" | Placeholder style: `dots` (halftone), `blur` (blur-up) or `scan` (Oxyn extras). |
grid | bool | Default::default() | Show the four variations as a grid instead of canvas + filmstrip (Oxyn extra). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Cmd/CtrlEnter | Generate from the prompt |
| ←or→ | Model chips, aspect chips or variations in the filmstrip |
| Escape | Stop a running batch; finished images are kept |
| Tab | Variations, Upscale, Vary, Download, then prompt, model, aspect, Generate |
Accessibility
- Model and aspect chips and the filmstrip are radio groups with a roving tab stop.
- The main canvas is named after its picture, or its progress while forming; strip items read Variation 1 to 4.
- Each start, finish, failure, pick, upscale and save is spoken, and the demo says nothing real was generated.
- A failed tile shows a warning glyph with the word Failed; the picked tile is outlined and marked aria-checked.
From the spec
The canvas is an img with a label that changes per state; the filmstrip is a listbox with arrow keys; Escape stops a running batch. Every action returns the line the polite live region announces. The focus outline shows only for keyboard focus.
Motion & interaction
The dot matrix ripples while waiting, picks up the palette of the coming image, then blurs into it. Filmstrip selection moves a ring; upscale fills a hairline and the size label doubles. Model and aspect are chips in the prompt bar.
Timing
Everything on screen is derived from the host clock now (no timers in the component), so playback, tests and the GPUI view agree.
| Transition | Duration | Easing |
|---|---|---|
| Forming per variation | ≈ 2.4 s, staggered 300 ms | ease-out |
| Upscale | 1400 ms (UPSCALE_MS) | linear |
| Blur into image | 400 ms | ease-out |
Reduced motion: streamed text and moves appear at their end state; progress still advances, without travel animation.
Responsive behaviour
- Grows to 600 px; the canvas follows the chosen aspect and never gets taller than 440 px.
- Below 500 px the action buttons go icon-only, leaving room for all four thumbnails on one line.
- Under 440 px the chips wrap onto two rows and Generate follows them.
Edge cases (spec)
Aspect 1:1, 4:5 and 16:9 keep the canvas size and letterbox. Long prompts wrap to three lines in the bar. A failed variation shows Retry in its own tile. Checked at 1440, 768 and 390 px in light and dark with no text overlap. Chrome is monochrome grey; colour is semantic only (success, warning, danger, info) plus the providers' coloured brand marks.
Notes for AI
- Import
ImageGenerationfromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
AiKitViewinoxyn_gpui. - Props to set first:
now. - It reads a clock (
now) for live timers; pass one clock for the whole page rather than one per component. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.