> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runanywhere.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Image Generation

> Generate images on-device

`RunAnywhere.images` generates an image from a prompt.

```ts theme={null}
const result = await RunAnywhere.images.generate('A lighthouse at dusk, oil painting', {
  negativePrompt: 'blurry, text, watermark',
  width: 512,
  height: 512,
  steps: 20,
  seed: 42,
})
```

## Options

| Field            | Default       | Meaning                                            |
| ---------------- | ------------- | -------------------------------------------------- |
| `negativePrompt` | none          | What to avoid                                      |
| `width`          | model default | Output width                                       |
| `height`         | model default | Output height                                      |
| `steps`          | model default | Denoising steps; more is slower and usually better |
| `guidanceScale`  | model default | How closely to follow the prompt                   |
| `seed`           | random        | Fix it to reproduce an image                       |
| `mode`           | generate      | Generate or inpaint                                |
| `reportPartials` | `false`       | Emit intermediate images while streaming           |

## Watching it appear

With `reportPartials` on, the stream emits intermediate images, so you can show the picture
resolving rather than a spinner.

```ts theme={null}
for await (const event of RunAnywhere.images.generateStream('A lighthouse at dusk', {
  steps: 20,
  reportPartials: true,
})) {
  if (event.type === 'partial') showPreview(event.image)
  if (event.type === 'completed') showFinal(event.result)
}
```

## Reproducing an image

Fix the seed and every other option, and the same prompt produces the same image. Without a
fixed seed, it will not.

## Cost

Image generation is the heaviest thing in the SDK. A 512×512 image at 20 steps takes far longer
than a text completion and warms the device noticeably. Run one at a time, show progress, allow
cancellation, and do not put it on a timer.

## Availability

Check before offering it:

```ts theme={null}
const capabilities = await RunAnywhere.capabilities()
```

A diffusion model has to be registered and a backend has to serve it. The namespace existing
does not mean the catalog has an entry.
