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

> ## Agent Instructions
> To build and serve your own model, start at /deploy/development/quickstart and /deploy/development/overview. Deploying is the default path: reactor init scaffolds a workspace, reactor auth login authenticates, and reactor model deploy registers the model, publishes the release with the weights/ folder, and activates it on Reactor's GPUs, in one command from that workspace. Docker must be running, because the publish step builds the image locally. Bump model.version in reactor.yaml before redeploying a change, because a release that already has an image is reactivated as it is. Deployment access is granted per account, so contact team@reactor.inc if a deploy is refused. Every key in reactor.yaml is documented at /deploy/platform/reactor-yaml. Model code imports reactor_runtime; Python client code imports reactor_sdk. The runtime overview explains the model interface. Running the model on your own machine with reactor run is optional and needs a GPU you attach with --gpus; /deploy/development/local-testing covers that loop and pairs a complete brightness model with a Python client test in a separate brightness-test workspace.
> Reactor hosts multiple models, each with its own connect slug (modelName) and command/event schema. The video model catalog — slug, typed SDK package, and links to its schema — is at /model-api-reference/overview. Robotics policy documentation starts at /robotics/overview; The launch policies are Cosmos Nano DROID (/robotics/cosmos/nano-policy-droid/), DreamZero DROID (/robotics/dreamzero/droid/), and FLUX Action DROID (/robotics/flux-action/droid/), organized by model family and embodiment. Some models expose one slug per experience (e.g. HappyOyster); always take the slug from the model's own pages, never guess it.
> Fastest path to a working app: `npx create-reactor-app my-app --model=<slug>` scaffolds a complete app with secure auth wired up. Typed TypeScript SDKs are published as @reactor-models/<model>; Python uses the base reactor-sdk package.
> Auth: exchange an API key (rk_...) for a JWT via POST https://api.reactor.inc/tokens from your server. Never put the API key in client-side code.
> Append .md to any docs URL for clean Markdown. Search these docs via the MCP server at https://docs.reactor.inc/mcp.

# PixVerse R2 Director overview

> Build a world from a description and reference images, then direct it clip by clip.

**PixVerse R2 Director** makes a film one clip at a time. First create the world from a description,
up to six reference images, or both. Give it one of three styles: Dramatic, Ambient, or POV. Then
send a prompt for each clip. Each prompt becomes a 5 to 10 second clip that continues from the last
frame of the one before. A clip can also cut to one of your reference images, or move from one image
to another.

The model builds clips and plays them in separate steps. A built clip waits as `ready` until you
play it or autoplay plays it. Between clips, the picture holds on the last frame. The model also
keeps every clip as a step result of the session, with its video, its last frame, and its prompt.

You can generate clips from the same world more than once. Save its `world_id` and attach the world
in a later session, so you do not have to create it again.

The PixVerse R2 Director reference has four pages: this overview; the
[schema](https://docs.reactor.inc/model-api-reference/pixverse-r2-director/schema.md), which lists every command and message;
the [prompt guide](https://docs.reactor.inc/model-api-reference/pixverse-r2-director/prompt-guide.md), which covers world
descriptions and clip prompts; and the
[tutorial](https://docs.reactor.inc/model-api-reference/pixverse-r2-director/tutorial.md), which shows how to create a world,
queue clips, and play them.

PixVerse R2 Director uses the same wire protocol as every other Reactor model. You open a session
with the [`Reactor`](https://docs.reactor.inc/sdk-reference/reactor-class) class, send named commands, and receive messages.
Its model name is **`reactor/pixverse-r2-director`**. The
[`@reactor-models/pixverse-r2-director` typed SDK](https://docs.reactor.inc/sdk-reference/typed-model-sdk) adds named
methods and React hooks on top of the same protocol.

## At a glance

| Spec | Value |
| - | - |
| Model name | `reactor/pixverse-r2-director` |
| Pricing | |
| Frame rate | 24 fps |
| Resolution | 1280 × 720 for a `16:9` world, or 720 × 1280 for `9:16` |
| Input | A text prompt and up to 6 reference images, then one prompt per clip |
| Output tracks | `main_video` |
| Styles | `Dramatic`, `Ambient`, or `POV` |
| Clip length | 5 to 10 seconds |

Pass the model name, `reactor/pixverse-r2-director`, to the SDK. A session token uses the same name
as its scope. The short slug, `pixverse-r2-director`, names the docs folder, the typed SDK, and the
row for this model on [Pricing and billing](https://docs.reactor.inc/resources/billing.md).

## Key features

> [card] Worlds from text and images
>
> Describe the world, add up to six reference images, and pick a style: `Dramatic`, `Ambient`, or
> `POV`.

> [card] Clips that continue
>
> Each clip continues from the last frame of the one before. A clip can also cut to a reference
> image, or move from one image to another.

> [card] A queue and a player
>
> Queue prompts while clips build. Play ready clips one at a time, or turn on autoplay. The model
> keeps every clip as a step result.

## Quick start

> [tab] npm
>
> ```shell theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
> npx create-reactor-app my-director-app --model=pixverse-r2-director
> ```

> [tab] pnpm
>
> ```shell theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
> pnpm create reactor-app my-director-app --model=pixverse-r2-director
> ```

Create a session token on your server. Then connect with the base JavaScript SDK or the
`@reactor-models/pixverse-r2-director` typed SDK. Do not put your `rk_` API key in browser code. To
create tokens, see [Authentication](https://docs.reactor.inc/authentication.md).

```typescript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
import { Reactor } from "@reactor-team/js-sdk";

const reactor = new Reactor({ modelName: "reactor/pixverse-r2-director" });
const video = document.querySelector("video")!;

reactor.on("trackReceived", (name, _track, stream) => {
  if (name === "main_video") {
    video.srcObject = stream;
    void video.play().catch(console.error);
  }
});

reactor.on("statusChanged", async (status) => {
  if (status !== "ready") return;
  await reactor.sendCommand("set_autoplay", { enabled: true });
  await reactor.sendCommand("create_world", {
    prompt: "A rainy neon market at night. A street cook works at her noodle stall.",
    style: "Dramatic",
    aspect_ratio: "16:9",
  });
  // The clip waits for the world, builds, and then plays on its own.
  await reactor.sendCommand("enqueue", { prompt: "The cook flips the noodles. Slow push-in." });
});

await reactor.connect(await getToken()); // Implement getToken() on your server.
```

```tsx React theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
import {
  PixverseR2DirectorProvider,
  PixverseR2DirectorMainVideoView,
  usePixverseR2Director,
} from "@reactor-models/pixverse-r2-director";

export function App({ token }: { token: string }) {
  return (
    <PixverseR2DirectorProvider jwtToken={token} connectOptions={{ autoConnect: true }}>
      <Director />
    </PixverseR2DirectorProvider>
  );
}

function Director() {
  const { status, createWorld, enqueue, setAutoplay } = usePixverseR2Director();

  async function start() {
    await setAutoplay({ enabled: true });
    await createWorld({
      prompt: "A rainy neon market at night. A street cook works at her noodle stall.",
      style: "Dramatic",
      aspect_ratio: "16:9",
    });
    await enqueue({ prompt: "The cook flips the noodles. Slow push-in." });
  }

  return (
    <>
      <PixverseR2DirectorMainVideoView className="w-full" />
      <button disabled={status !== "ready"} onClick={() => void start()}>
        Direct
      </button>
    </>
  );
}
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
import asyncio
import os
from reactor_sdk import Reactor, ReactorStatus

async def main():
    reactor = Reactor(model_name="reactor/pixverse-r2-director",
                      api_key=os.environ["REACTOR_API_KEY"])

    @reactor.on_status(ReactorStatus.READY)
    async def on_ready(status):
        await reactor.send_command("set_autoplay", {"enabled": True})
        await reactor.send_command("create_world", {
            "prompt": "A rainy neon market at night. A street cook works at her noodle stall.",
            "style": "Dramatic",
            "aspect_ratio": "16:9",
        })
        await reactor.send_command("enqueue", {"prompt": "The cook flips the noodles. Slow push-in."})

    @reactor.on_message
    def on_message(msg):
        if msg["type"] == "clip_failed":
            print("clip failed:", msg["data"]["reason"])

    await reactor.connect()
    await asyncio.Event().wait()  # run until interrupted

asyncio.run(main())
```

## How it works

1. Connect to `reactor/pixverse-r2-director`. The first `session_state` has phase `idle`.
2. Call `create_world` with a description, reference images, or both. Or call `attach_world` with a
   saved `world_id`. The phase changes to `world_ready`.
3. Call `enqueue` with a prompt for each clip. The first `enqueue` on a world starts a run. The
   model builds the clips in order. When a clip is ready, the model sends `clip_generated`.
4. To send a ready clip on `main_video`, call `play`. Or turn on `set_autoplay`, and ready clips
   play on their own, oldest first.
5. End the run with `end_run`, or let it end on its own. Built clips stay ready after the run ends.
   The next `enqueue` starts a new run on the same world.

> [!NOTE]
>
> For playback without gaps, let about 30 seconds of clips become `ready` before you play them or
> turn on autoplay. Between clips, `main_video` holds the last frame.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.