reactor.sendCommand(), the events the model emits back, and an end-to-end example. For the
conceptual model and a quick start, see the overview.
LongLive-2.0 outputs a single video track, main_video, in chunks of 29 frames (~1.2s at
24fps). Transitions take effect on chunk boundaries. See
Chunks, scenes, and length for
how the per-scene 48-chunk budget and the cumulative session_chunk clock work.
Commands
Send commands to the model usingreactor.sendCommand(). Below are all available commands:
| Command | Description |
|---|---|
set_shot | Set the opening shot, or queue a soft transition (keeps the scene) |
scene_cut | Queue a hard cut to a new scene (purges memory, fresh 48-chunk budget) |
schedule_shot | Plant a soft shot at a specific session_chunk |
schedule_scene_cut | Plant a hard cut at a specific session_chunk |
start | Begin generating video on main_video |
pause | Pause generation after the current chunk |
resume | Resume generation from a pause |
reset | Abort, clear the prompt and all scheduled beats, return to idle |
set_seed | Set the noise seed (read once at start) |
- set_shot
- scene_cut
- schedule_shot
- schedule_scene_cut
- start / pause / resume / reset
- set_seed
set_shot
Set the opening shot beforestart, or queue a soft shot change mid-stream. A shot keeps the
scene’s attention memory (the “sink tokens”) and continuity, swapping the prompt conditioning.
Use it for a new beat within the same world (a camera move, an action, a time skip). Mid-stream it
activates at the next chunk boundary and spends from the current scene’s 48-chunk budget.Acknowledged by shot_set; rejected with command_error if the prompt is empty.Parameters:| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | The shot’s prompt text |
Messages from model
The model emits these events. Subscribe withreactor.on("message", ...) (or the generated React
hooks). Every message is delivered as JSON { "type": "<name>", "data": { … } }.
| Event | When | Payload |
|---|---|---|
shot_set | A set_shot was accepted | { prompt: string } |
scene_cut | A scene_cut fired (immediate or scheduled) | { prompt: string, at_session_chunk: int } |
shot_scheduled | A schedule_shot was accepted | { prompt: string, at_session_chunk: int } |
scene_cut_scheduled | A schedule_scene_cut was accepted | { prompt: string, at_session_chunk: int } |
generation_started | start succeeded, frames begin | { prompt: string, chunk_num: int, frame_num: int } |
chunk_complete | Once per completed chunk of main_video | { chunk_index: int, session_chunk: int, frames_emitted: int, active_prompt: string } |
generation_paused | In response to pause | { chunk_index: int } |
generation_resumed | In response to resume | { chunk_index: int } |
generation_reset | In response to reset | { reason: string } |
generation_complete | A scene reached the chunk ceiling with no cut | { total_chunks: int } |
command_error | A command was rejected (bad precondition) | { command: string, reason: string } |
state | On connect, after every command, after each chunk | Full session snapshot (see below) |
state payload
state is the single source of truth for the session’s observable state. Subscribe once and treat
it as the authoritative session snapshot; you generally do not need to track individual command
acknowledgements and chunk_complete events yourself.
| Field | Type | Meaning |
|---|---|---|
running | bool | started && !paused. Equivalent to “frames are actively streaming” |
started | bool | True once start has been accepted; remains true through pauses. False on reset |
paused | bool | True while generation is paused |
current_chunk | int | Chunks since the current scene began; resets to 0 on every scene_cut |
session_chunk | int | Cumulative chunks since start; never resets. The clock scheduled beats fire against |
current_frame | int | Frames emitted on main_video so far |
current_prompt | string | null | The prompt currently driving generation, or null if none set |
has_prompt | bool | Whether an opening shot has been set this session |
seed | int | Current seed value (effective only on the next start) |
scheduled_shots | int[] | session_chunk indices of pending scheduled shots |
scheduled_scene_cuts | int[] | session_chunk indices of pending scheduled cuts |