Image Gen Loader

Holds the frame while FLUX generates: latent drift, film grain and progress that resolve into the final image.

Your image will appear here

In use

Every result of a Playground run, in the grid above the prompt: queued, generating, then revealed. The Image Edit Studio shows each edit in one, over its parent.

Lumen
CreateEditVideo
240 credits

Your image will appear here

Your image will appear here

Your image will appear here

Your image will appear here

16 credits

Installation

pnpm dlx shadcn@latest add https://mgp.paukraft.com/r/image-gen-loader.json

ImageGenLoader

Every layer, assembled. Also takes className, style and render.

PropTypeDefault
status"idle" | "queued" | "generating" | "ready" | "moderated" | "error"

Where the generation is. A "ready" image that fails to load shows as "error".

—
progressnumber

0–1. Omit while the backend reports none.

—
srcstring

Final image, revealed once status is "ready" and it loads.

—
altstring

Describe the image, e.g. with its prompt.

—
aspectRationumber | string

A number, CSS "16 / 9", or the API's "16:9".

1
sourcestring

Image worked from: an edit's input or the previous result.

—
errorReactNode

What went wrong, while status is "error" or "moderated".

—
onRetry() => void

Renders a retry action on failure, except when moderated.

—
actionsReactNode

Shown on the revealed image.

—
announcementsPartial<Record<status, string>>

Screen reader messages as the generation moves along.

—

Parts

PropTypeDefault
ImageGenLoaderRootImageGenLoaderRootProps

The frame and its state. Takes status, progress and aspectRatio; layers stack in the order you write them.

—
ImageGenLoaderSource<img> props

Image worked from: blurred while busy, dimmed on failure.

—
ImageGenLoaderLatent<div> props

Color field in --chart-1…4 that sharpens with progress.

—
ImageGenLoaderAnnotations{ groups?, cursor?, track? }

Fake detections in --primary. groups replaces them: boxes in %, or a function of the ratio.

—
ImageGenLoaderGrain<div> props

Film grain, cleared once the image is revealed.

—
ImageGenLoaderProgress<div> props

Percent badge, bottom right, while progress is reported.

—
ImageGenLoaderImage<img> props

The result, revealed once ready and loaded.

—
ImageGenLoaderIdle<div> props

Shown before a run. Children replace the copy.

—
ImageGenLoaderError{ label?, onRetry?, retryLabel? }

Failure frame. Children are the message.

—
ImageGenLoaderActions<div> props

Shown on the revealed image, top right.

—
useImageGenLoader() => { status, progress, busy, inView, … }

The root's state, for your own layers.

—

useBflGeneration

Submits a task, polls it until it settles and maps each result onto the loader. Returns loader to spread onto the component, plus generate, retry and busy.

PropTypeDefault
poll(task, signal) => Promise<BflResult>

Fetches the task's polling_url, through your server. Called until the task settles.

—
intervalnumber

Between polls, in ms.

500