pub struct ChainRequest {Show 17 fields
pub model: String,
pub stages: Vec<ChainStage>,
pub motion_tail_frames: u32,
pub width: u32,
pub height: u32,
pub fps: u32,
pub seed: Option<u64>,
pub steps: u32,
pub guidance: f64,
pub strength: f64,
pub output_format: OutputFormat,
pub placement: Option<DevicePlacement>,
pub prompt: Option<String>,
pub total_frames: Option<u32>,
pub clip_frames: Option<u32>,
pub source_image: Option<Vec<u8>>,
pub enable_audio: Option<bool>,
}Expand description
Chained generation request. Server accepts either the canonical form
(stages non-empty) or the auto-expand form (prompt + total_frames +
clip_frames); ChainRequest::normalise collapses the latter into the
former so downstream code only deals with stages.
Fields§
§model: String§stages: Vec<ChainStage>Canonical stages list. Empty triggers auto-expand from
prompt/total_frames/clip_frames.
motion_tail_frames: u32Pixel frames of motion-tail overlap between consecutive stages.
0 = no overlap (simple concat). >0 = the final K pixel frames of
stage N’s latents are threaded into stage N+1’s conditioning, and
stage N+1’s leading K output frames are dropped at stitch time.
Defaults to 17 (matches the CLI --motion-tail and SPA defaults):
1 + 16 lands on the LTX-2 VAE’s 1 + 8k causal-grid for a clean
re-encode of the carryover RGB frames. Values that do not satisfy
1 + 8k will fail the receiving stage’s tail re-encode at the VAE.
Must be strictly less than each stage’s frames.
width: u32§height: u32§fps: u32§seed: Option<u64>Chain base seed. Per-stage seeds are derived as
base_seed ^ ((stage_idx as u64) << 32) by the orchestrator so the
whole chain is reproducible from a single seed value.
steps: u32§guidance: f64§strength: f64Denoising strength for stages[0].source_image. Ignored when the
first stage has no source image. Continuation stages are always
full-strength conditioned via motion-tail latents.
output_format: OutputFormat§placement: Option<DevicePlacement>§prompt: Option<String>Auto-expand: single prompt replicated across all stages.
total_frames: Option<u32>Auto-expand: total pixel frames the stitched output should cover.
clip_frames: Option<u32>Auto-expand: per-clip frame count. Defaults to 97 (LTX-2 19B/22B
distilled cap). Must be 8k+1.
source_image: Option<Vec<u8>>Auto-expand: starting image for stages[0].
enable_audio: Option<bool>Generate per-stage audio and mux it into the final stitched output.
Only meaningful for AV-capable families (LTX-2 / LTX-2.3); the server
rejects Some(true) for non-AV models. None means “no preference”
and resolves to off — chains opt in to audio explicitly so existing
callers don’t suddenly start producing audio they didn’t ask for.
Implementations§
Source§impl ChainRequest
impl ChainRequest
Sourcepub fn normalise(self) -> Result<Self>
pub fn normalise(self) -> Result<Self>
Collapse the auto-expand form into a canonical Vec<ChainStage> and
validate the result. Called once on the server side immediately after
JSON parsing, before any engine work kicks off.
Post-conditions on a successful return:
self.stagesis non-empty.- Each stage’s
framesis8k+1and> 0. self.stages.len() <= MAX_CHAIN_STAGES.- All auto-expand fields are
None(caller must useself.stages).
Sourcepub fn estimated_total_frames(&self) -> u32
pub fn estimated_total_frames(&self) -> u32
Predicted stitched frame count before any top-level total_frames
trim. Used by UIs for the footer summary and by the server to size
the final buffer.
Per-boundary rule:
- smooth: drop leading
motion_tail_framesof the incoming clip - cut: no trim
- fade: replace
2 * fade_lenframes (trailing of prior + leading of next) withfade_lenblended frames → net-fade_len
Trait Implementations§
Source§impl Clone for ChainRequest
impl Clone for ChainRequest
Source§fn clone(&self) -> ChainRequest
fn clone(&self) -> ChainRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more