vllm_omni.diffusion.distributed.autoencoders.autoencoder_kl_wan ¶
DistributedAutoencoderKLWan ¶
Bases: OmniAutoencoderKLWan, DistributedVaeMixin
encode_tile_exec ¶
encode_tile_exec(task: TileTask) -> Tensor
Encode a single sample tile into latent space.
encode_tile_merge ¶
encode_tile_merge(
coord_tensor_map: dict[tuple[int, ...], Tensor],
grid_spec: GridSpec,
) -> Tensor
Merge encoded tiles into a full latent tensor.
tile_merge ¶
Merge decoded tiles into a full image.
tiled_encode ¶
Encode using distributed VAE executor.
Note: x is already patchified by parent's _encode() before calling this method.
OmniAutoencoderKLWan ¶
Bases: AutoencoderKLWan
decode ¶
decode(z: Tensor, return_dict: bool = True)
Decode a Wan latent using the Diffusers-compatible full-tensor API.
decode_with_chunks ¶
decode_with_chunks(
z: Tensor, *, on_chunk: DecodedChunkConsumer
) -> None
Decode z while synchronously delivering temporal chunks.
The ordinary :meth:decode contract remains the Diffusers contract. Chunk callbacks deliberately reject a sliced batch: Diffusers slices each sample before decoding, while a streaming consumer needs a stable batch ownership contract. Callers can disable use_slicing or invoke this capability once per sample.
Every rank participating in distributed VAE execution must invoke this method. Spatial-sharded execution invokes on_chunk only on the output-owning rank. Chunks have shape (B, C, T, H, W) and values clamped to [-1, 1]. After a callback failure, remaining chunks are decoded and discarded before the exception is re-raised.