HomeLabHire Me
ml-ui10 components

Get started

IntroductionInstallation

UI

Dots

Dot CalendarNewDot CodeNew

Dither

Dither GlobeNew

Text

Ink PrintNew

Data viz

Dither

Dither MapNew

Media

Dots

Dot WaveformNew

AI

Diffusion ImageNew

Backgrounds

Koi PondNewMarigoldsNewWhite BlossomNew

ml-ui / AI

Diffusion Image

It starts as pure coloured static. Step by step the noise thins and the picture comes through it coarse to fine, the broad shapes and colours first and the detail last, as a denoiser recovers them, printed in a dither of a few levels a channel with the static changing at each step. A counter ticks the steps, and when it's done the full-resolution image prints in through blue noise. Drive it with your model's progress callbacks, or let it run itself as the placeholder while a request is out.

Needs: None. Canvas 2D. The image must be same-origin or CORS-enabled.

Demo photos by Linh Nguyen, Kenneth Thewissen and Jimmy Fermin on Unsplash

Customize

picture

Props

PropTypeDefaultDescription
srcstringrequiredThe finished image.
altstringrequiredWhat it shows, for screen readers.
progressnumber–How far the generation has got, 0 to 1. Leave unset and it runs itself.
stepsnumber30Steps the counter counts.
durationnumber6Seconds it takes when it runs itself.
onDone() => void–Called once the image is fully in.
aspectnumber1Width over height.
cellnumber3Size of one dither cell in px.
classNamestring–Class on the image.
styleCSSProperties–Style on the image.