Image generation

Shows a picture taking shape while the model works, with the prompt, progress and a Regenerate button.

Loading preview…

Install

  1. 1

    Run this command in your Tailwind CSS project. It adds components/ai/image-generation-noise.tsx and installs its dependencies.

    $ npx shadcn@latest add https://gradientdeck.com/ai-components/r/image-generation-noise.json

Build image-generation progress and regenerate controls →

Usage & API

Example

image-generation-noise.tsx
import { ImageGenerationNoise } from "@/components/ai/image-generation-noise"

<ImageGenerationNoise
  prompt="…"
  progress={1}
  status="generating"
/>

Props ImageGenerationNoise

PropType & descriptionRequired
promptstringRequired
progressnumber0–1Required
status"generating" | "done"Required
onRegenerate() => voidOptional
seednumberOptional
palettePaletteOptional
stepsnumberOptional

Dependencies

  • React
  • Tailwind CSS
  • motion
  • lucide-react
Implementation notes

Out of noise covers the landscape with a pixelated colour grain painted on a 160 by 90 canvas and scaled up. The grain keeps repainting about twenty times a second while the card is generating and on screen, and it stops when status is done or motion is reduced. Opacity of that grain follows progress, and the SVG underneath is blurred and slightly desaturated, then sharpens as the fraction climbs. The pill reads Denoising with the current step and the step total, defaulting to 30 steps, beside a small pinging dot. A three-pixel gradient bar runs along the bottom and scales with progress. At the end the pill swaps to Done with a sparkle. The accessible name during the run is the step count, and afterward it is the prompt. Regenerate restarts the demo's clock and picks the next palette.

Choosing a layout

Use it when the wait is long enough that a bare spinner throws away the prompt the person just wrote. A diffusion-style job, a slow upscale, or a batch of four all fit, because the card is built around a fraction you already have. Keep the same card mounted and update progress. Remounting resets nothing inside the component except the local animation clock in the demo. Your own timer, polling loop, or stream of step events should own that clock. The demo's loop is only there so the preview finishes in about five seconds.

Switch to Image results once several finished pictures exist and someone needs to choose, upscale, vary, or download one. Switch to Before and after when the question is what an edit changed, and to Edit region when the person must paint the area that should change. Video generation is the sibling for a clip that renders frame by frame and then plays. This card is the wait before any of those tools. It is a poor fit for a chat bubble that only needs a one-line status, and it is the wrong surface if you already have a final bitmap to show at full sharpness on the first paint.

Does the card create the image?

No. Each variant draws a seeded landscape so the motion has something to reveal. You supply the prompt string, progress, and status. Seed and palette only change that stand-in artwork. A production screen can keep this layout, but the files as written do not accept an image source, a blob, or a model request.

Why is Regenerate disabled mid-run?

The button's disabled state is tied to status being generating, and the icon spins for that same stretch. onRegenerate still fires from the click once the run is done. The component does not debounce, queue, or cancel an in-flight job. If you need a cancel action, it is not on this card.