> For the complete documentation index, see [llms.txt](https://world-models-from-scratch.gitbook.io/wmfs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://world-models-from-scratch.gitbook.io/wmfs/chapters/chapter_02/05-generate-several-futures.md).

# 2.5 Generate Several Futures

Section 2.4 generated one rollout. Now we will run the model four times with the same observation and prompt. Only the random seed changes.

## Generate Four Rollouts

If you are generating locally, use the engine from Section 2.4:

```python
futures = [
    engine.generate(
        context,
        prompt=prompt,
        seed=seed,
        num_frames=29,
        guidance_scale=7.0,
        num_inference_steps=15,
    )
    for seed in range(4)
]

future_frames = [future.frames for future in futures]
```

To run the comparison with the included rollouts instead, load their frames:

```python
from pathlib import Path

from world_models.observation import load_video

seeds_dir = Path("assets/chapter_02/seeds")
future_frames = [
    load_video(seeds_dir / f"rollout_seed{seed}.mp4").frames
    for seed in range(4)
]
```

## Compare the Samples

The rollouts begin from the same visual context but diverge as generation continues. In this example, differences appear in the machinery, water, and other changing parts of the scene.

![](https://2690027296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKukkmMWtxTgXSbpK92Uk%2Fuploads%2Fgit-blob-9062efef2b915c9d8466a2cc41736c8abc2665ef%2Ffutures_seed0_vs_seed1.png?alt=media)

*Figure 2.2: Seed 0 (top) and seed 1 (bottom), generated from the same observation and prompt. The columns advance through each rollout.*

The explorer synchronizes all four rollouts at the same frame index.

[Open the sampled-futures view in a new tab](https://nahidalam.github.io/world_model_from_scratch/interactive/chapter_02/rollout_explorer.html#seeds).

## Where the Rollouts Differ

The four rollouts can also be compared at every pixel:

```python
from world_models.visualize import disagreement_map

disagreement = disagreement_map(future_frames)
```

The function produces one map for each frame. Brighter pixels vary more across the four rollouts. This variation can come from motion, spatial shifts, or sampling randomness; it is not a probability or confidence score.

[Open the disagreement view in a new tab](https://nahidalam.github.io/world_model_from_scratch/interactive/chapter_02/rollout_explorer.html#disagreement).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://world-models-from-scratch.gitbook.io/wmfs/chapters/chapter_02/05-generate-several-futures.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
