Skip to content

lingbot_video

Dense LingBot-Video T2V pipeline configuration.

Classes

fastvideo.configs.pipelines.lingbot_video.LingBotVideoT2VConfig dataclass

LingBotVideoT2VConfig(model_path: str = '', pipeline_config_path: str | None = None, embedded_cfg_scale: float | None = None, flow_shift: float | None = 3.0, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = True, is_causal: bool = False, dit_config: DiTConfig = LingBotVideoConfig(), dit_precision: str = 'bf16', upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = 'fp32', vae_config: VAEConfig = WanVAEConfig(), vae_precision: str = 'fp32', vae_decode_precision: str | None = 'fp32', vae_tiling: bool = False, vae_sp: bool = False, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = 'fp32', text_encoder_configs: tuple[EncoderConfig, ...] = (lambda: (LingBotVideoQwen3VLTextConfig(),))(), text_encoder_precisions: tuple[str, ...] = (lambda: ('bf16',))(), preprocess_text_funcs: tuple[Callable, ...] = (lambda: (preprocess_lingbot_video_prompt,))(), postprocess_text_funcs: tuple[Callable, ...] = (lambda: (postprocess_lingbot_video_text,))(), dmd_denoising_steps: list[int] | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None)

Bases: PipelineConfig

Released Dense T2V component wiring and numerical precision policy.

Methods:

fastvideo.configs.pipelines.lingbot_video.LingBotVideoT2VConfig.__post_init__
__post_init__() -> None

Load only the VAE decoder for the T2V workload.

Source code in fastvideo/configs/pipelines/lingbot_video.py
def __post_init__(self) -> None:
    """Load only the VAE decoder for the T2V workload."""
    self.vae_config.load_encoder = False
    self.vae_config.load_decoder = True

Functions:

fastvideo.configs.pipelines.lingbot_video.postprocess_lingbot_video_text

postprocess_lingbot_video_text(outputs: BaseEncoderOutput, attention_mask: Tensor) -> tuple[Tensor, Tensor]

Select the final hidden state, crop the template, and trim batch-one padding.

Source code in fastvideo/configs/pipelines/lingbot_video.py
def postprocess_lingbot_video_text(
    outputs: BaseEncoderOutput,
    attention_mask: torch.Tensor,
) -> tuple[torch.Tensor, torch.Tensor]:
    """Select the final hidden state, crop the template, and trim batch-one padding."""
    if outputs.hidden_states is None:
        raise ValueError("LingBot-Video requires text-encoder hidden states")
    prompt_embeds = outputs.hidden_states[-1][:, PROMPT_CROP_START:]
    prompt_mask = attention_mask[:, PROMPT_CROP_START:]
    if prompt_embeds.shape[0] == 1:
        true_length = int(prompt_mask[0].sum().item())
        prompt_embeds = prompt_embeds[:, :true_length]
        prompt_mask = prompt_mask[:, :true_length]
    return prompt_embeds, prompt_mask

fastvideo.configs.pipelines.lingbot_video.preprocess_lingbot_video_prompt

preprocess_lingbot_video_prompt(prompt: str) -> str

Apply the released T2V system/user/assistant prompt template.

Source code in fastvideo/configs/pipelines/lingbot_video.py
def preprocess_lingbot_video_prompt(prompt: str) -> str:
    """Apply the released T2V system/user/assistant prompt template."""
    return PROMPT_TEMPLATE.format(prompt)