Skip to content
Back

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-generation
The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

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

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.

Terminal
oxyn add image-generation

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Dot matrix

Four variations forming on the dot matrix.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Blur up

Blur-up placeholder in 16:9 (Oxyn extra).

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Batch grid

All four in a grid with scan lines (Oxyn extra).

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Failed

The third variation fails; the others finish.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

ImageGeneration

PropTypeDefaultDescription
nowrequiredClockMs—Host clock.
autoplaybooltrueGenerate once on mount.
failboolDefault::default()The third variation fails (error demo).
aspectusizeDefault::default()Starting aspect (0 1:1, 1 4:5, 2 16:9).
placeholderString"dots"Placeholder style: `dots` (halftone), `blur` (blur-up) or `scan` (Oxyn extras).
gridboolDefault::default()Show the four variations as a grid instead of canvas + filmstrip (Oxyn extra).

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
Cmd/CtrlEnterGenerate from the prompt
←or→Model chips, aspect chips or variations in the filmstrip
EscapeStop a running batch; finished images are kept
TabVariations, 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.

TransitionDurationEasing
Forming per variation≈ 2.4 s, staggered 300 msease-out
Upscale1400 ms (UPSCALE_MS)linear
Blur into image400 msease-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 ImageGeneration from oxyn_dioxus and include STATUS_INDICATOR_CSS plus the token stylesheet once.
  • A GPUI version exists: AiKitView in oxyn_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.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI