> 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/06-control-and-inspect.md).

# 2.6 Control and Inspect Generation

Section 2.5 changed the seed while keeping the other settings fixed. Here we keep the seed fixed and compare two generation settings: guidance and inference steps.

## Guidance

`guidance_scale` determines how strongly generation follows the text prompt. The explorer compares values 3, 7, and 12:

```python
guidance_runs = [
    engine.generate(
        context,
        prompt=prompt,
        seed=0,
        num_frames=29,
        guidance_scale=guidance,
        num_inference_steps=15,
    )
    for guidance in (3.0, 7.0, 12.0)
]
```

Compare how closely each rollout follows the prompt, along with its motion, continuity, and visual artifacts.

## Inference Steps

`num_inference_steps` controls how many refinement steps the model performs while generating the video. The explorer compares 15, 20, 36, and 50 steps:

```python
step_runs = [
    engine.generate(
        context,
        prompt=prompt,
        seed=0,
        num_frames=29,
        guidance_scale=7.0,
        num_inference_steps=steps,
    )
    for steps in (15, 20, 36, 50)
]
```

More steps use more computation but do not increase the number of output frames; every rollout in this comparison still contains 29 frames. Compare the videos instead of assuming that the largest value is best.

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


---

# 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/06-control-and-inspect.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.
