vllm_omni.diffusion.models.dreamzero.state_dreamzero ¶
DreamZero pipeline persistent state.
DreamZeroState ¶
Pipeline persistent state across forward() calls.
Lifecycle
- Created once in DreamZeroPipeline.init()
- Mutated every forward() call (frame append, KV cache grow)
- reset() on new session / language change
- reset_inference_state() on local_attn_size exceeded (KV only)
accumulate_frames ¶
Accumulate stitched frames and return multi-frame video.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stitched | ndarray | (H, W, C) single frame or (T, H, W, C) multi-frame, already stitched by transform. | required |
Returns:
| Type | Description |
|---|---|
ndarray | (T, H, W, C) ndarray. T=1 for first call, T=FRAMES_PER_CHUNK(4) after. |
append_video_latents ¶
Append one AR chunk of normalized video latents for later decode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
video_out | Tensor |
| required |
clear_video_latents ¶
Drop accumulated video latents without resetting KV/frame state.
get_concatenated_video_latents ¶
Return all accumulated chunks concatenated along the time dimension.
reset ¶
reset(*, clear_video_latents: bool = True) -> None
Clear session state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
clear_video_latents | bool | When | True |
reset_inference_state ¶
Reset KV/frame state after local attention rolls without dropping video latents.
reset_reason ¶
reset_reason(
text_tokens: Tensor | None,
num_video_frames: int,
local_attn_size: int,
) -> str | None
Return why state should reset before the next forward(), if any.
reset_vae_encoder_stream ¶
Clear incremental Wan VAE encoder state used across AR steps.