---
title: "Seed: Controlling randomness deterministically | Runware Docs"
url: https://runware.ai/docs/learn/seed
description: Pin the random noise to reproduce identical outputs or create controlled variations from the same starting point.
relatedDocuments:
  - https://runware.ai/docs/learn/text-to-image
  - https://runware.ai/docs/learn/schedulers
---
## Introduction

The `seed` parameter provides a **deterministic starting point for the pseudo-random processes** in AI generation. When you supply the same seed with the same parameters, the model produces identical output every time.

In [diffusion](https://runware.ai/docs/learn/glossary#diffusion) models, the seed determines the **initial noise pattern** from which the output is gradually refined. In other architectures ([autoregressive](https://runware.ai/docs/learn/glossary#autoregressive) video models, music generation), the seed initializes the random number generator that drives the model's sampling process. The underlying mechanism varies, but the effect is consistent: a fixed seed means reproducible output.

Seed is one of the few parameters that works across nearly every modality on the platform. Image, video, music and 3D models all accept a `seed` parameter, and **support is uneven inside each one**: roughly half the image and video catalog exposes it, so check the model's API reference before you build a workflow on reproducibility.

> **Prompt**: A massive sci-fi space battle with starships firing lasers across a backdrop of colorful nebulae, asteroids drifting between the chaos

**Seed: 1**

![Sci-fi space battle, seed variation 1](https://runware.ai/docs/assets/seed-01.BfKjNn1-_7ahEj.jpg)

**Seed: 2**

![Sci-fi space battle, seed variation 2](https://runware.ai/docs/assets/seed-02.6oSp8s6Z_Z20A7cB.jpg)

**Seed: 3**

![Sci-fi space battle, seed variation 3](https://runware.ai/docs/assets/seed-03.CT3OggLw_1jYInN.jpg)

**Seed: 4**

![Sci-fi space battle, seed variation 4](https://runware.ai/docs/assets/seed-04.B2QGhWbC_Zu8ylS.jpg)

**Seed: 5**

![Sci-fi space battle, seed variation 5](https://runware.ai/docs/assets/seed-05.CPbVXYsZ_ZKmlya.jpg)

**Seed: 6**

![Sci-fi space battle, seed variation 6](https://runware.ai/docs/assets/seed-06.C0a76Bya_ZfYcp4.jpg)

**Seed: 7**

![Sci-fi space battle, seed variation 7](https://runware.ai/docs/assets/seed-07.C8Xp5ZcF_oILX3.jpg)

**Seed: 8**

![Sci-fi space battle, seed variation 8](https://runware.ai/docs/assets/seed-08.D8OifwG9_45cFW.jpg)

**Seed: 9**

![Sci-fi space battle, seed variation 9](https://runware.ai/docs/assets/seed-09.DDvOkgyZ_Z1ThIvY.jpg)

**Seed: 10**

![Sci-fi space battle, seed variation 10](https://runware.ai/docs/assets/seed-10.D5e72XQD_19mi8u.jpg)

## Request structure

The `seed` parameter is an integer passed at the top level of your generation request. It works identically across task types.

**Image**:

**TypeScript**:

```typescript
import { createClient } from '@runware/sdk'

const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()

const [result] = await client.run({
  model: '<image-model-air>',
  positivePrompt: 'A massive sci-fi space battle with starships',
  seed: 42,
  steps: 30,
  width: 1024,
  height: 1024
})
```

**Python**:

```python
import asyncio
import os

from runware import Runware

async def main():
    async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
        results = await client.run({
            "model": "<image-model-air>",
            "positivePrompt": "A massive sci-fi space battle with starships",
            "seed": 42,
            "steps": 30,
            "width": 1024,
            "height": 1024
        })

asyncio.run(main())
```

**cURL**:

```bash
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "imageInference",
      "taskUUID": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "model": "<image-model-air>",
      "positivePrompt": "A massive sci-fi space battle with starships",
      "seed": 42,
      "steps": 30,
      "width": 1024,
      "height": 1024
    }
  ]'
```

**CLI**:

```bash
runware run "<image-model-air>" \
  positivePrompt="A massive sci-fi space battle with starships" \
  seed=42 \
  steps=30 \
  width=1024 \
  height=1024
```

**JSON**:

```json
{
  "taskType": "imageInference",
  "taskUUID": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "model": "<image-model-air>",
  "positivePrompt": "A massive sci-fi space battle with starships",
  "seed": 42,
  "steps": 30,
  "width": 1024,
  "height": 1024
}
```

**Video**:

**TypeScript**:

```typescript
import { createClient } from '@runware/sdk'

const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()

const [result] = await client.run({
  model: '<video-model-air>',
  positivePrompt: 'A pair of running shoes rotating slowly on a white studio turntable',
  seed: 42,
  duration: 5,
  resolution: '720p'
})
```

**Python**:

```python
import asyncio
import os

from runware import Runware

async def main():
    async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
        results = await client.run({
            "model": "<video-model-air>",
            "positivePrompt": "A pair of running shoes rotating slowly on a white studio turntable",
            "seed": 42,
            "duration": 5,
            "resolution": "720p"
        })

asyncio.run(main())
```

**cURL**:

```bash
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "videoInference",
      "taskUUID": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "model": "<video-model-air>",
      "positivePrompt": "A pair of running shoes rotating slowly on a white studio turntable",
      "seed": 42,
      "duration": 5,
      "resolution": "720p"
    }
  ]'
```

**CLI**:

```bash
runware run "<video-model-air>" \
  positivePrompt="A pair of running shoes rotating slowly on a white studio turntable" \
  seed=42 \
  duration=5 \
  resolution=720p
```

**JSON**:

```json
{
  "taskType": "videoInference",
  "taskUUID": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "model": "<video-model-air>",
  "positivePrompt": "A pair of running shoes rotating slowly on a white studio turntable",
  "seed": 42,
  "duration": 5,
  "resolution": "720p"
}
```

**Audio**:

**TypeScript**:

```typescript
import { createClient } from '@runware/sdk'

const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()

const [result] = await client.run({
  model: '<audio-model-air>',
  positivePrompt: 'An upbeat acoustic guitar track for a product launch video',
  seed: 42,
  settings: {
    lyrics: '##Bright morning, open road##'
  }
})
```

**Python**:

```python
import asyncio
import os

from runware import Runware

async def main():
    async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
        results = await client.run({
            "model": "<audio-model-air>",
            "positivePrompt": "An upbeat acoustic guitar track for a product launch video",
            "seed": 42,
            "settings": {
                "lyrics": "##Bright morning, open road##"
            }
        })

asyncio.run(main())
```

**cURL**:

```bash
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "audioInference",
      "taskUUID": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "model": "<audio-model-air>",
      "positivePrompt": "An upbeat acoustic guitar track for a product launch video",
      "seed": 42,
      "settings": {
        "lyrics": "##Bright morning, open road##"
      }
    }
  ]'
```

**CLI**:

```bash
runware run "<audio-model-air>" \
  positivePrompt="An upbeat acoustic guitar track for a product launch video" \
  seed=42 \
  settings.lyrics="##Bright morning, open road##"
```

**JSON**:

```json
{
  "taskType": "audioInference",
  "taskUUID": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "model": "<audio-model-air>",
  "positivePrompt": "An upbeat acoustic guitar track for a product launch video",
  "seed": 42,
  "settings": {
    "lyrics": "##Bright morning, open road##"
  }
}
```

**3D**:

**TypeScript**:

```typescript
import { createClient } from '@runware/sdk'

const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()

const [result] = await client.run({
  model: '<3d-model-air>',
  positivePrompt: 'A matte black portable speaker with a fabric grille',
  seed: 42
})
```

**Python**:

```python
import asyncio
import os

from runware import Runware

async def main():
    async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
        results = await client.run({
            "model": "<3d-model-air>",
            "positivePrompt": "A matte black portable speaker with a fabric grille",
            "seed": 42
        })

asyncio.run(main())
```

**cURL**:

```bash
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "3dInference",
      "taskUUID": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "model": "<3d-model-air>",
      "positivePrompt": "A matte black portable speaker with a fabric grille",
      "seed": 42
    }
  ]'
```

**CLI**:

```bash
runware run "<3d-model-air>" \
  positivePrompt="A matte black portable speaker with a fabric grille" \
  seed=42
```

**JSON**:

```json
{
  "taskType": "3dInference",
  "taskUUID": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "model": "<3d-model-air>",
  "positivePrompt": "A matte black portable speaker with a fabric grille",
  "seed": 42
}
```

If you don't specify a seed, a random one is generated in the unsigned 64-bit range. The response object always includes the seed that was used, so you can capture it for future use.

## Why seeds matter

Seeds are foundational for three common workflows:

**Reproducibility.** The same seed, prompt, and parameters produce identical output. This is critical for production pipelines where you need to guarantee that a previously approved result can be recreated exactly.

**Controlled experimentation.** Fix a seed, then change one parameter at a time (CFG scale, scheduler, prompt wording) to isolate its effect. Without a fixed seed, you can't tell whether a visual change came from your parameter adjustment or from a different random initialization.

**Iterative refinement.** Generate a batch of outputs, find a composition you like, then record that seed. Use it as your starting point while you fine-tune the prompt, adjust weights, or swap LoRAs. The overall structure stays stable while you dial in the details.

## Seed behavior across architectures

Seed behavior is not perfectly uniform across all models. There are two things to be aware of:

- **Same seed, different model**: Two different models given the same seed will produce completely different output. The seed initializes the noise, but each model interprets that noise through its own architecture.
- **Not all models support seed**: Roughly half the catalog exposes a `seed` parameter, and the rest reseed on every call. If reproducibility matters for your workflow, check the model's API reference before you build on it.

> [!NOTE]
> Stochastic schedulers (like Euler Ancestral or DPM++ SDE variants) introduce randomness at each [denoising](https://runware.ai/docs/learn/glossary#denoising) step, which means **even a fixed seed will produce slightly different results** between runs. If exact reproducibility matters, use a deterministic scheduler like DPM++ 2M Karras or DDIM.

## Tips

1. **Always log seeds in production.** Even if you don't set a seed explicitly, the response includes the one that was used. Store it alongside the output so you can reproduce or iterate on any result later.
2. **Use seed sweeps to explore.** Generate the same prompt with 10-20 different seeds to survey the model's output space. Pick the best composition, then lock that seed for refinement.
3. **Batch with sequential seeds.** When generating a batch, use sequential seeds (42, 43, 44...) rather than random ones. This makes it easy to reproduce any specific output from the batch.
4. **Combine seed with CFG sweeps.** Fix a seed and sweep CFG scale from low to high. This shows you the full range of prompt adherence for a single composition, which is the fastest way to find your ideal settings.