reactor.sendCommand(), the events the model emits back, and three end-to-end examples. For the
conceptual model and a quick start, see the overview.
Commands
Send commands to the model usingreactor.sendCommand(). Below are all available commands:
set_prompt
Convenience wrapper around schedule_prompt that automatically picks the right chunk index so you
don’t have to track it yourself:
- Not started: schedules at chunk 0.
- Paused: schedules at the current chunk (takes effect on resume).
- Running: schedules at the next chunk (current chunk is already being processed).
set_prompt and the model figures out when to apply it.
Parameters:
Example:
schedule_prompt
Schedule a prompt to be applied at a specific chunk index during video generation.
Parameters:
Behavior:
- Scheduling a prompt at a chunk that already has a prompt overwrites it.
- At each chunk boundary the model applies the latest prompt scheduled at or before the current chunk, and discards the earlier ones it skipped past.
- Scheduling for a chunk that has already passed is not an error. The prompt is due immediately, so it applies on the next chunk.
- Schedule a prompt at chunk 0 before calling
start, so the first chunk has something to generate from. - Prompts can be scheduled while generation is running for real-time control.
set_image
Set or change the reference image for image-to-video conditioning. Can be called before or during
generation.
Upload the image first with uploadFile(), then pass the returned
FileRef as the image parameter. See
File Uploads for more details.
Parameters:
Behavior:
- Can be set before starting or while generation is running.
- Helios center-crops the image to its 5:3 aspect ratio, then resizes it to its native 640×384
generation resolution. The
image_acceptedmessage echoes the resulting dimensions. Displayed frames are larger whenever super-resolution is on. - Swapping the image mid-generation is an immediate switch on the next chunk; the previous image’s history conditioning is not blended out.
- A missing file, a non-image MIME type, or bytes that fail to decode produce
command_errorand leave the session unchanged.
set_conditioning
Set the prompt and reference image in a single atomic message (Helios SDK 0.9.0+). Use it when both
are known at once (e.g. launching a curated scene): the two ride one data-channel message, so the
first chunk is generated with the image already in place. Sending set_image and set_prompt
separately before start races, and the image can land a chunk late.
Upload the image first with uploadFile(), then pass the returned
FileRef as image. See set_image for upload
details.
Parameters:
Example:
set_image_strength
Adjust how strongly the reference image anchors generation. Ignored when no reference image is set.
Parameters:
Behavior:
- The current chunk loop snapshots
image_strengthtogether with the reference image. A new value sent on its own is stored but is not applied until the reference image is next set (viaset_imageorset_conditioning), or until generation is restarted withreset+start. - Set
image_strengthimmediately beforeset_image/set_conditioningif you want it to take effect on the next chunk.
set_sr_scale
Set the super-resolution factor applied to each emitted frame. Takes effect on the next chunk.
Parameters:
Helios generates at 640×384 and upscales from there, so the default
"2x" puts 1280×768 frames on
the main_video track. Super-resolution changes the frames you receive, not the resolution the
model reasons about.
Example:
set_seed
Set a seed for reproducible output. Using the same seed with the same prompts will produce the same
video.
Parameters:
Behavior:
- The model reads the seed once, when generation begins. Set it before
start. - Changing the seed mid-run has no effect on the current run. It applies to the next run, after
resetand a newstart.
start
Begin the video generation process.
Parameters: None.
Requirements:
- At least one prompt must be scheduled before calling this command, via
set_prompt,schedule_prompt, orset_conditioning. With an empty schedule,startemitscommand_errorwith the reasonNo prompt set. Call set_prompt first. - Schedule that prompt at chunk 0. The precondition check accepts a prompt at any chunk index, but
generation begins at chunk 0 and needs a prompt that is due there. Both
set_promptandset_conditioningtarget chunk 0 before generation starts.
pause
Pause the video generation after the current chunk finishes processing. The model retains its full
state including history buffers.
Parameters: None.
Example:
resume
Resume video generation from where it was paused.
Parameters: None.
Example:
reset
Stop generation and reset the model to its initial state.
Parameters: None.
Effects:
- Halts any ongoing generation.
- Clears all scheduled prompts, history buffers, and the active reference image.
- Empties the rewind buffer and restarts
snapshot_indexat1, so indices saved before the reset collide with indices saved after it. Discard any snapshot list your app is holding. - Returns the model to a clean state ready for new prompts. The currently configured seed is
preserved; call
set_seedafterresetif you want to change it.
save_snapshot
Capture the current world state into the rewind buffer. Saving a snapshot marks a moment you can
return to later with rewind.
Parameters:
Behavior:
- The buffer holds up to 50 snapshots. Saving beyond that evicts the oldest. There is no command for deleting a snapshot or for resizing the buffer.
- Each snapshot is assigned a
snapshot_index, a counter that starts at1and never reuses a value. Pass that value torewindto target this snapshot. An evicted index cannot be rewound to. - The new snapshot descends from whatever
current_snapshot_idnames, and becomescurrent_snapshot_iditself. Saving after arewindtherefore branches off the restored snapshot, and saving without one extends the branch already in progress. - The buffer belongs to the session. It starts empty,
resetempties it, and it is released when the session ends. - Generation must be running. Before
start, the command emitsrewind_failedwith the reasonno active generation to snapshot. - Success emits
snapshot_savedcarrying the assigned index, the chunk it captured, and the snapshot it descends from.
rewind
Restore a snapshot saved with save_snapshot. The model returns to that point in
the video and keeps generating from there.
Parameters:
Behavior:
- The restore lands at the next chunk boundary, after the in-flight chunk finishes. The stream is never torn mid-chunk.
- The prompt is not restored.
rewindrolls back the latent history, the RNG state, and the chunk index, and nothing else. Whichever prompt is active keeps steering the restored scene. To land back where you were instead, re-send thepromptthatlist_snapshotsreports for that snapshot. snapshot_index: 0never matches anything, because indices start at1.- The restored snapshot becomes
current_snapshot_id, so the nextsave_snapshotbranches off it. - Generation must be running and the buffer must hold the target, otherwise the command emits
rewind_failed. See Rewind failures for the reasons. - Success emits a
statesnapshot withcurrent_chunkmoved back and the newcurrent_snapshot_id, followed byrewind_complete. The state arrives first, so a handler awaiting the acknowledgement already holds the state it refers to.current_framedoes not move back: it counts every frame the session has emitted, so it keeps climbing across a rewind.
list_snapshots
Read the contents of the rewind buffer. The reply is a snapshot_list
message.
Parameters: None.
Behavior:
- Always succeeds. An empty buffer returns
snapshots: []. - This command is the only way to read the buffer’s contents. Call it when generation starts, then
again on every
snapshot_saved. Thestatepayload reports which snapshot the generation descends from incurrent_snapshot_id, so pair the two:list_snapshotsfor what exists,current_snapshot_idfor where you are within it. - Entries come back oldest first. An evicted snapshot drops out of the list, which makes the reply the authority on what can still be rewound to.
snapshots is an object:
Example:
The rewind buffer belongs to the live session. It holds up to 50 snapshots, evicts the oldest
without warning, is emptied by
reset, and is released when the session ends. Treat it as a way to
move around inside the take you are working on, not as session history you can store and come back
to later.Messages from model
Listen for messages withreactor.on("message", ...) (imperative) or the useReactorMessage() hook
(React). Every message is delivered as JSON { "type": "<name>", "data": { … } }.
schedule_prompt is the one exception to the conditions_ready rule. It stays silent on readiness,
because a prompt queued for a future chunk isn’t active yet.
rewind_failed covers both rewind commands, so it carries no command field. When one handler
drives both save_snapshot and rewind, track which one you sent to word the error. See
Rewind failures.
In chunk_complete, frames_emitted counts the frames in that one chunk, always 33. For the
session running total, read current_frame from the state snapshot.
state payload
state is the single source of truth for driving UI. Subscribe once and treat it as the
authoritative session snapshot; you generally do not need to track the individual messages above
yourself.
state reports which snapshot the generation descends from, not what the buffer holds. Read the
contents with list_snapshots.
Example handler:
Errors
Commands fail in two distinct ways, and each surfaces differently.Rejected by the model
A command whose preconditions fail reaches the model and comes back as acommand_error message.
Nothing mutates, and no state snapshot follows, so a UI driven off state alone shows no sign
that anything happened. Subscribe to command_error as well.
Rejected as invalid input
Three commands carry values the schema constrains. Helios rejects anything outside these bounds rather than clamping it, and the rejection arrives as an invalid-input error rather than acommand_error naming the command. Validate at the edges of your own UI, such as a slider pinned to
0–1.
Rewind failures
save_snapshot and rewind do not use command_error. They report
failures on their own rewind_failed message, which carries a reason and no command name.
Complete example: prompt sequence
Complete example: image-to-video
Use a reference image to guide generation. Upload the image first, then send it together with the prompt viaset_conditioning before starting, so the very first chunk is conditioned on both.
Complete example: save and rewind
Mark a moment worth returning to, try a direction, then back out of it and try another. The pattern to notice is the pairing at the end:rewind restores the latents, and the set_prompt
that follows supplies the prompt, because rewinding does not restore one.