Skip to main content
This page documents the complete LongLive-2.0 wire surface: every command you send with 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 using reactor.sendCommand(). Below are all available commands:
CommandDescription
set_shotSet the opening shot, or queue a soft transition (keeps the scene)
scene_cutQueue a hard cut to a new scene (purges memory, fresh 48-chunk budget)
schedule_shotPlant a soft shot at a specific session_chunk
schedule_scene_cutPlant a hard cut at a specific session_chunk
startBegin generating video on main_video
pausePause generation after the current chunk
resumeResume generation from a pause
resetAbort, clear the prompt and all scheduled beats, return to idle
set_seedSet the noise seed (read once at start)

set_shot

Set the opening shot before start, 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:
ParameterTypeRequiredDescription
promptstringYesThe shot’s prompt text
Example:
// Opening shot (before start)
await reactor.sendCommand("set_shot", {
  prompt: "A lone astronaut walks across a windswept red dune at golden hour",
});

// Soft transition mid-stream: same world, new beat
await reactor.sendCommand("set_shot", {
  prompt: "The camera pulls back to reveal a vast crater on the horizon",
});

Messages from model

The model emits these events. Subscribe with reactor.on("message", ...) (or the generated React hooks). Every message is delivered as JSON { "type": "<name>", "data": { … } }.
EventWhenPayload
shot_setA set_shot was accepted{ prompt: string }
scene_cutA scene_cut fired (immediate or scheduled){ prompt: string, at_session_chunk: int }
shot_scheduledA schedule_shot was accepted{ prompt: string, at_session_chunk: int }
scene_cut_scheduledA schedule_scene_cut was accepted{ prompt: string, at_session_chunk: int }
generation_startedstart succeeded, frames begin{ prompt: string, chunk_num: int, frame_num: int }
chunk_completeOnce per completed chunk of main_video{ chunk_index: int, session_chunk: int, frames_emitted: int, active_prompt: string }
generation_pausedIn response to pause{ chunk_index: int }
generation_resumedIn response to resume{ chunk_index: int }
generation_resetIn response to reset{ reason: string }
generation_completeA scene reached the chunk ceiling with no cut{ total_chunks: int }
command_errorA command was rejected (bad precondition){ command: string, reason: string }
stateOn connect, after every command, after each chunkFull 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.
FieldTypeMeaning
runningboolstarted && !paused. Equivalent to “frames are actively streaming”
startedboolTrue once start has been accepted; remains true through pauses. False on reset
pausedboolTrue while generation is paused
current_chunkintChunks since the current scene began; resets to 0 on every scene_cut
session_chunkintCumulative chunks since start; never resets. The clock scheduled beats fire against
current_frameintFrames emitted on main_video so far
current_promptstring | nullThe prompt currently driving generation, or null if none set
has_promptboolWhether an opening shot has been set this session
seedintCurrent seed value (effective only on the next start)
scheduled_shotsint[]session_chunk indices of pending scheduled shots
scheduled_scene_cutsint[]session_chunk indices of pending scheduled cuts

Complete example

import { LongliveV2Model } from "@reactor-models/longlive-v2";

const longlive = new LongliveV2Model();

longlive.onChunkComplete(({ session_chunk, active_prompt }) => {
  console.log(`chunk ${session_chunk}: ${active_prompt}`);
});
longlive.onCommandError(({ command, reason }) => {
  console.error(`${command} rejected: ${reason}`);
});

await longlive.connect(jwt);

// Compose the storyboard before starting:
await longlive.setShot({ prompt: "A lone astronaut walks across a red dune at golden hour" });
await longlive.scheduleShot({
  prompt: "The camera pulls back to reveal a vast crater",
  at_session_chunk: 20,
});
await longlive.scheduleSceneCut({
  prompt: "Hard cut: a neon-lit Tokyo street at night",
  at_session_chunk: 40,
});

await longlive.start();