---
title: pipeline_configs
---

<div class="python-reference">
<a id="fastvideo.pipelines.basic.magi_human.pipeline_configs-classes"></a>
<a id="fastvideo.pipelines.basic.magi_human.pipeline_configs-functions"></a>
<a id="fastvideo.pipelines.basic.magi_human.pipeline_configs"></a>
<p>PipelineConfig for the daVinci-MagiHuman base text-to-AV pipeline.</p>
<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.DiTConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.DiTConfig</code></h2>
<pre class="doc-signature"><code>DiTConfig(arch_config: DiTArchConfig = DiTArchConfig(), prefix: str = &#x27;&#x27;, quant_config: QuantizationConfig | None = None, *, _resolved_attention_backend: AttentionBackendEnum | None = None)</code></pre>


<h3 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.DiTConfig.add_cli_args"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.DiTConfig.add_cli_args</code></h3>
<pre class="doc-signature"><code>add_cli_args(parser: Any, prefix: str = &#x27;dit-config&#x27;) -&gt; Any</code></pre>
<p>Add CLI arguments for DiTConfig fields</p>
<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.EncoderConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.EncoderConfig</code></h2>
<pre class="doc-signature"><code>EncoderConfig(arch_config: ArchConfig = EncoderArchConfig(), prefix: str = &#x27;&#x27;, quant_config: QuantizationConfig | None = None, lora_config: Any | None = None, *, _resolved_attention_backend: AttentionBackendEnum | None = None)</code></pre>


<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.VAEConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.VAEConfig</code></h2>
<pre class="doc-signature"><code>VAEConfig(arch_config: VAEArchConfig = VAEArchConfig(), load_encoder: bool = True, load_decoder: bool = True, tile_sample_min_height: int = 256, tile_sample_min_width: int = 256, tile_sample_min_num_frames: int = 16, tile_sample_stride_height: int = 192, tile_sample_stride_width: int = 192, tile_sample_stride_num_frames: int = 12, blend_num_frames: int = 0, use_tiling: bool = True, use_temporal_tiling: bool = True, use_parallel_tiling: bool = True, use_temporal_scaling_frames: bool = True, *, _resolved_attention_backend: AttentionBackendEnum | None = None)</code></pre>


<h3 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.VAEConfig.add_cli_args"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.VAEConfig.add_cli_args</code></h3>
<pre class="doc-signature"><code>add_cli_args(parser: Any, prefix: str = &#x27;vae-config&#x27;) -&gt; Any</code></pre>
<p>Add CLI arguments for VAEConfig fields</p>
<h3 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.VAEConfig.from_cli_args"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.VAEConfig.from_cli_args</code></h3>
<pre class="doc-signature"><code>from_cli_args(args: argparse.Namespace) -&gt; VAEConfig</code></pre>

<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanVideoConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanVideoConfig</code></h2>
<pre class="doc-signature"><code>MagiHumanVideoConfig(arch_config: DiTArchConfig = MagiHumanArchConfig(), prefix: str = &#x27;magi_human&#x27;, quant_config: QuantizationConfig | None = None, *, _resolved_attention_backend: AttentionBackendEnum | None = None)</code></pre>


<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.BaseEncoderOutput"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.BaseEncoderOutput</code></h2>
<pre class="doc-signature"><code>BaseEncoderOutput(last_hidden_state: torch.FloatTensor | None = None, pooler_output: torch.FloatTensor | None = None, hidden_states: tuple&#91;torch.FloatTensor, ...&#93; | None = None, attentions: tuple&#91;torch.FloatTensor, ...&#93; | None = None, attention_mask: torch.Tensor | None = None)</code></pre>


<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.T5GemmaEncoderConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.T5GemmaEncoderConfig</code></h2>
<pre class="doc-signature"><code>T5GemmaEncoderConfig(arch_config: TextEncoderArchConfig = T5GemmaEncoderArchConfig(), prefix: str = &#x27;t5gemma&#x27;, quant_config: QuantizationConfig | None = None, lora_config: Any | None = None, is_chat_model: bool = False, treat_empty_as_dot: bool = False, *, _resolved_attention_backend: AttentionBackendEnum | None = None, chat_template_enable_thinking: bool = False)</code></pre>


<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.OobleckVAEConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.OobleckVAEConfig</code></h2>
<pre class="doc-signature"><code>OobleckVAEConfig(arch_config: VAEArchConfig = OobleckVAEArchConfig(), load_encoder: bool = True, load_decoder: bool = True, tile_sample_min_height: int = 256, tile_sample_min_width: int = 256, tile_sample_min_num_frames: int = 16, tile_sample_stride_height: int = 192, tile_sample_stride_width: int = 192, tile_sample_stride_num_frames: int = 12, blend_num_frames: int = 0, use_tiling: bool = False, use_temporal_tiling: bool = False, use_parallel_tiling: bool = False, use_temporal_scaling_frames: bool = True, pretrained_path: str = &#x27;stabilityai/stable-audio-open-1.0&#x27;, pretrained_subfolder: str = &#x27;vae&#x27;, pretrained_dtype: str = &#x27;float16&#x27;, *, _resolved_attention_backend: AttentionBackendEnum | None = None)</code></pre>
<p>FastVideo VAE config wrapping the Oobleck arch.</p>
<p>Audio VAEs don't use the temporal/spatial tiling defaults that the
base VAEConfig is shaped for (those exist for video VAEs); they are
retained but irrelevant for audio.</p>

<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.WanVAEConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.WanVAEConfig</code></h2>
<pre class="doc-signature"><code>WanVAEConfig(arch_config: WanVAEArchConfig = WanVAEArchConfig(), load_encoder: bool = True, load_decoder: bool = True, tile_sample_min_height: int = 256, tile_sample_min_width: int = 256, tile_sample_min_num_frames: int = 16, tile_sample_stride_height: int = 192, tile_sample_stride_width: int = 192, tile_sample_stride_num_frames: int = 12, blend_num_frames: int = 0, use_tiling: bool = False, use_temporal_tiling: bool = False, use_parallel_tiling: bool = False, use_temporal_scaling_frames: bool = True, use_feature_cache: bool = True, use_light_vae: bool = False, *, _resolved_attention_backend: AttentionBackendEnum | None = None)</code></pre>


<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig</code></h2>
<pre class="doc-signature"><code>PipelineConfig(model_path: str = &#x27;&#x27;, pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = None, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = DiTConfig(), dit_precision: str = &#x27;bf16&#x27;, upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = &#x27;fp32&#x27;, vae_config: VAEConfig = VAEConfig(), vae_precision: str = &#x27;fp32&#x27;, vae_decode_precision: str | None = None, vae_tiling: bool = True, vae_sp: bool = True, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = &#x27;fp32&#x27;, image_encoder_configs: tuple&#91;EncoderConfig, ...&#93; | None = None, image_encoder_precisions: tuple&#91;str, ...&#93; | None = None, text_encoder_configs: tuple&#91;EncoderConfig, ...&#93; = (lambda: (EncoderConfig(),))(), text_encoder_precisions: tuple&#91;str, ...&#93; = (lambda: (&#x27;fp32&#x27;,))(), preprocess_text_funcs: tuple&#91;Callable&#91;&#91;str&#93;, str&#93;, ...&#93; = (lambda: (preprocess_text,))(), postprocess_text_funcs: tuple&#91;Callable&#91;&#91;BaseEncoderOutput&#93;, torch.tensor&#93;, ...&#93; = (lambda: (postprocess_text,))(), dmd_denoising_steps: list&#91;int&#93; | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None)</code></pre>
<p>Base configuration for all pipeline architectures.</p>

<h3 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.add_cli_args"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.add_cli_args</code></h3>
<pre class="doc-signature"><code>add_cli_args(parser: FlexibleArgumentParser, prefix: str = &#x27;&#x27;) -&gt; FlexibleArgumentParser</code></pre>

<h3 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.update_config_from_dict"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.update_config_from_dict</code></h3>
<pre class="doc-signature"><code>update_config_from_dict(args: dict&#91;str, Any&#93;, prefix: str = &#x27;&#x27;) -&gt; None</code></pre>

<h3 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.from_pretrained"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.from_pretrained</code></h3>
<pre class="doc-signature"><code>from_pretrained(model_path: str) -&gt; PipelineConfig</code></pre>
<p>use the pipeline class setting from model_path to match the pipeline config</p>
<h3 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.from_kwargs"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.from_kwargs</code></h3>
<pre class="doc-signature"><code>from_kwargs(kwargs: dict&#91;str, Any&#93;, config_cli_prefix: str = &#x27;&#x27;) -&gt; PipelineConfig</code></pre>
<p>Load PipelineConfig from kwargs Dictionary.
kwargs: dictionary of kwargs
config_cli_prefix: prefix of CLI arguments for this PipelineConfig instance</p>
<h3 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.check_pipeline_config"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.check_pipeline_config</code></h3>
<pre class="doc-signature"><code>check_pipeline_config() -&gt; None</code></pre>

<h3 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.resolve_checkpoint_settings"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.resolve_checkpoint_settings</code></h3>
<pre class="doc-signature"><code>resolve_checkpoint_settings(fastvideo_args: FastVideoArgs) -&gt; None</code></pre>
<p>Apply the run settings that the checkpoint at <code>fastvideo_args.model_path</code> fixes.</p>
<p><code>FastVideoArgs.__post_init__</code> calls this once in the main process, before
argument validation and before any weights load. Most checkpoints fix no
run settings, so the base implementation does nothing.</p>
<h3 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.apply_request_constraints"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.apply_request_constraints</code></h3>
<pre class="doc-signature"><code>apply_request_constraints(request: GenerationRequest, sampling_param: SamplingParam) -&gt; SamplingParam</code></pre>
<p>Apply this model's constraints on a generation request to its sampling parameters.</p>
<p><code>sampling_param</code> holds the preset defaults with the request's explicit
fields applied. A model sets the values it fixes when the request leaves
them unset, and raises when the request sets a value it does not accept.
The base PipelineConfig accepts every request unchanged.</p>
<h3 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.dump_to_json"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.dump_to_json</code></h3>
<pre class="doc-signature"><code>dump_to_json(file_path: str)</code></pre>

<h3 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.load_from_json"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.load_from_json</code></h3>
<pre class="doc-signature"><code>load_from_json(file_path: str)</code></pre>

<h3 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.update_pipeline_config"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.PipelineConfig.update_pipeline_config</code></h3>
<pre class="doc-signature"><code>update_pipeline_config(source_pipeline_dict: dict&#91;str, Any&#93;) -&gt; None</code></pre>

<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.t5gemma_postprocess_text"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.t5gemma_postprocess_text</code></h2>
<pre class="doc-signature"><code>t5gemma_postprocess_text(outputs: BaseEncoderOutput) -&gt; torch.Tensor</code></pre>
<p>Return per-prompt last_hidden_state as a batched [B, L, D] tensor.</p>
<p>MagiHuman pads/trims the embedding to a fixed length in its own
<code>pad_or_trim</code> helper at pipeline time. Here we simply hand through
whatever the tokenizer produced — the latent-prep stage is responsible
for pad/trim so that the original context length can be preserved.</p>
<details><summary>Source</summary><pre><code>def t5gemma_postprocess_text(outputs: BaseEncoderOutput) -&gt; torch.Tensor:
    &quot;&quot;&quot;Return per-prompt last_hidden_state as a batched &#91;B, L, D&#93; tensor.

    MagiHuman pads/trims the embedding to a fixed length in its own
    `pad_or_trim` helper at pipeline time. Here we simply hand through
    whatever the tokenizer produced — the latent-prep stage is responsible
    for pad/trim so that the original context length can be preserved.
    &quot;&quot;&quot;
    hidden = outputs.last_hidden_state
    assert torch.isnan(hidden).sum() == 0
    # Keep the shape the tokenizer emitted; the pipeline stage handles
    # pad-or-trim to t5_gemma_target_length=640.
    return hidden</code></pre></details>
<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanBaseConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanBaseConfig</code></h2>
<pre class="doc-signature"><code>MagiHumanBaseConfig(model_path: str = &#x27;&#x27;, pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = 5.0, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = MagiHumanVideoConfig(), dit_precision: str = &#x27;bf16&#x27;, upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = &#x27;fp32&#x27;, vae_config: VAEConfig = WanVAEConfig(), vae_precision: str = &#x27;fp32&#x27;, vae_decode_precision: str | None = None, vae_tiling: bool = False, vae_sp: bool = False, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = &#x27;fp32&#x27;, image_encoder_configs: tuple&#91;EncoderConfig, ...&#93; | None = None, image_encoder_precisions: tuple&#91;str, ...&#93; | None = None, text_encoder_configs: tuple&#91;EncoderConfig, ...&#93; = (lambda: (T5GemmaEncoderConfig(),))(), text_encoder_precisions: tuple&#91;str, ...&#93; = (lambda: (&#x27;bf16&#x27;,))(), preprocess_text_funcs: tuple&#91;Callable&#91;&#91;str&#93;, str&#93;, ...&#93; = (lambda: (preprocess_text,))(), postprocess_text_funcs: tuple&#91;Callable&#91;&#91;BaseEncoderOutput&#93;, torch.Tensor&#93;, ...&#93; = (lambda: (t5gemma_postprocess_text,))(), dmd_denoising_steps: list&#91;int&#93; | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None, audio_vae_config: VAEConfig = OobleckVAEConfig(), precision: str = &#x27;bf16&#x27;, t5_gemma_target_length: int = 640, fps: int = 25, num_inference_steps: int = 32, video_txt_guidance_scale: float = 5.0, audio_txt_guidance_scale: float = 5.0, cfg_number: int = 2, vae_stride: tuple&#91;int, int, int&#93; = (4, 16, 16), z_dim: int = 48, frame_receptive_field: int = 11, coords_style: str = &#x27;v2&#x27;, ref_audio_offset: int = 1000, text_offset: int = 0, video_guidance_high_t_threshold: int = 500, video_guidance_low_t_value: float = 2.0)</code></pre>
<p>Base MagiHuman text-to-AV pipeline config (prompt → video + audio).</p>
<p>MagiHuman's base model is a joint audio-visual generator. This config
wires up both the video VAE (Wan 2.2 TI2V-5B) and the audio VAE
(Stable Audio Open 1.0); the pipeline produces an mp4 with a muxed
audio track. The framework's <code>WorkloadType</code> enum has no <code>T2AV</code>
variant yet, so the registry entry uses <code>WorkloadType.T2V</code> as a
placeholder.</p>

<details><summary>Source</summary><pre><code>@dataclass
class MagiHumanBaseConfig(PipelineConfig):
    &quot;&quot;&quot;Base MagiHuman text-to-AV pipeline config (prompt → video + audio).

    MagiHuman&#x27;s base model is a joint audio-visual generator. This config
    wires up both the video VAE (Wan 2.2 TI2V-5B) and the audio VAE
    (Stable Audio Open 1.0); the pipeline produces an mp4 with a muxed
    audio track. The framework&#x27;s `WorkloadType` enum has no `T2AV`
    variant yet, so the registry entry uses `WorkloadType.T2V` as a
    placeholder.
    &quot;&quot;&quot;

    # DiT
    dit_config: DiTConfig = field(default_factory=MagiHumanVideoConfig)
    # VAE — Wan 2.2 TI2V-5B. Diffusers `vae/config.json` drives arch_config
    # at load time, including z_dim=48 and scale_factor_temporal=4 /
    # scale_factor_spatial=16.
    vae_config: VAEConfig = field(default_factory=WanVAEConfig)
    vae_tiling: bool = False
    vae_sp: bool = False

    # Audio VAE — Stable Audio Open 1.0 (Oobleck), shared with the
    # standalone Stable Audio pipeline. Lazy-loaded from
    # `stabilityai/stable-audio-open-1.0` (HF gated, Apache 2.0).
    audio_vae_config: VAEConfig = field(default_factory=OobleckVAEConfig)

    # Denoising (flow-matching UniPC).
    flow_shift: float | None = 5.0

    # Text encoding
    text_encoder_configs: tuple&#91;EncoderConfig, ...&#93; = field(default_factory=lambda: (T5GemmaEncoderConfig(), ))
    postprocess_text_funcs: tuple&#91;Callable&#91;&#91;BaseEncoderOutput&#93;, torch.Tensor&#93;,
                                  ...&#93; = field(default_factory=lambda: (t5gemma_postprocess_text, ))

    # Precisions — the DiT runs bf16 internally, the text encoder is
    # bf16-native, and the VAE decode path benefits from fp32 for long
    # sequences.
    precision: str = &quot;bf16&quot;
    vae_precision: str = &quot;fp32&quot;
    text_encoder_precisions: tuple&#91;str, ...&#93; = field(default_factory=lambda: (&quot;bf16&quot;, ))

    # MagiHuman-specific defaults surfaced for the pipeline stages. These
    # are pipeline-level knobs sourced from the upstream
    # `EvaluationConfig` / `DataProxyConfig` (not `ModelConfig`), so they
    # belong here, NOT on `MagiHumanArchConfig`.
    t5_gemma_target_length: int = 640
    fps: int = 25
    num_inference_steps: int = 32
    video_txt_guidance_scale: float = 5.0
    audio_txt_guidance_scale: float = 5.0
    cfg_number: int = 2

    # VAE / data-proxy knobs (were on ArchConfig before; moved here).
    vae_stride: tuple&#91;int, int, int&#93; = (4, 16, 16)
    z_dim: int = 48
    frame_receptive_field: int = 11
    coords_style: str = &quot;v2&quot;
    ref_audio_offset: int = 1000
    text_offset: int = 0

    # Video CFG step-dependent guidance: low-t steps use a relaxed scale.
    # Upstream daVinci-MagiHuman/inference/pipeline/video_generate.py:426
    # uses 5.0 for high-t and 2.0 for low-t with cutoff at t=500.
    video_guidance_high_t_threshold: int = 500
    video_guidance_low_t_value: float = 2.0

    def __post_init__(self) -&gt; None:
        # Base text-to-AV does not need the VAE encoder (no reference-image
        # conditioning). Keep decoder only to save memory.
        self.vae_config.load_encoder = False
        self.vae_config.load_decoder = True</code></pre></details>
<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanBaseI2VConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanBaseI2VConfig</code></h2>
<pre class="doc-signature"><code>MagiHumanBaseI2VConfig(model_path: str = &#x27;&#x27;, pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = 5.0, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = MagiHumanVideoConfig(), dit_precision: str = &#x27;bf16&#x27;, upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = &#x27;fp32&#x27;, vae_config: VAEConfig = WanVAEConfig(), vae_precision: str = &#x27;fp32&#x27;, vae_decode_precision: str | None = None, vae_tiling: bool = False, vae_sp: bool = False, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = &#x27;fp32&#x27;, image_encoder_configs: tuple&#91;EncoderConfig, ...&#93; | None = None, image_encoder_precisions: tuple&#91;str, ...&#93; | None = None, text_encoder_configs: tuple&#91;EncoderConfig, ...&#93; = (lambda: (T5GemmaEncoderConfig(),))(), text_encoder_precisions: tuple&#91;str, ...&#93; = (lambda: (&#x27;bf16&#x27;,))(), preprocess_text_funcs: tuple&#91;Callable&#91;&#91;str&#93;, str&#93;, ...&#93; = (lambda: (preprocess_text,))(), postprocess_text_funcs: tuple&#91;Callable&#91;&#91;BaseEncoderOutput&#93;, torch.Tensor&#93;, ...&#93; = (lambda: (t5gemma_postprocess_text,))(), dmd_denoising_steps: list&#91;int&#93; | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None, audio_vae_config: VAEConfig = OobleckVAEConfig(), precision: str = &#x27;bf16&#x27;, t5_gemma_target_length: int = 640, fps: int = 25, num_inference_steps: int = 32, video_txt_guidance_scale: float = 5.0, audio_txt_guidance_scale: float = 5.0, cfg_number: int = 2, vae_stride: tuple&#91;int, int, int&#93; = (4, 16, 16), z_dim: int = 48, frame_receptive_field: int = 11, coords_style: str = &#x27;v2&#x27;, ref_audio_offset: int = 1000, text_offset: int = 0, video_guidance_high_t_threshold: int = 500, video_guidance_low_t_value: float = 2.0, image_conditioning: bool = True)</code></pre>
<p>Base MagiHuman text+image-to-AV pipeline config.</p>
<p>TI2V reuses the T2V DiT weights; the only pipeline-side difference is
that a reference image is encoded with the Wan VAE and reinserted into
the first video-latent frame before every denoise step.</p>

<details><summary>Source</summary><pre><code>@dataclass
class MagiHumanBaseI2VConfig(MagiHumanBaseConfig):
    &quot;&quot;&quot;Base MagiHuman text+image-to-AV pipeline config.

    TI2V reuses the T2V DiT weights; the only pipeline-side difference is
    that a reference image is encoded with the Wan VAE and reinserted into
    the first video-latent frame before every denoise step.
    &quot;&quot;&quot;

    image_conditioning: bool = True

    def __post_init__(self) -&gt; None:
        self.vae_config.load_encoder = True
        self.vae_config.load_decoder = True</code></pre></details>
<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanDistillConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanDistillConfig</code></h2>
<pre class="doc-signature"><code>MagiHumanDistillConfig(model_path: str = &#x27;&#x27;, pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = 5.0, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = MagiHumanVideoConfig(), dit_precision: str = &#x27;bf16&#x27;, upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = &#x27;fp32&#x27;, vae_config: VAEConfig = WanVAEConfig(), vae_precision: str = &#x27;fp32&#x27;, vae_decode_precision: str | None = None, vae_tiling: bool = False, vae_sp: bool = False, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = &#x27;fp32&#x27;, image_encoder_configs: tuple&#91;EncoderConfig, ...&#93; | None = None, image_encoder_precisions: tuple&#91;str, ...&#93; | None = None, text_encoder_configs: tuple&#91;EncoderConfig, ...&#93; = (lambda: (T5GemmaEncoderConfig(),))(), text_encoder_precisions: tuple&#91;str, ...&#93; = (lambda: (&#x27;bf16&#x27;,))(), preprocess_text_funcs: tuple&#91;Callable&#91;&#91;str&#93;, str&#93;, ...&#93; = (lambda: (preprocess_text,))(), postprocess_text_funcs: tuple&#91;Callable&#91;&#91;BaseEncoderOutput&#93;, torch.Tensor&#93;, ...&#93; = (lambda: (t5gemma_postprocess_text,))(), dmd_denoising_steps: list&#91;int&#93; | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None, audio_vae_config: VAEConfig = OobleckVAEConfig(), precision: str = &#x27;bf16&#x27;, t5_gemma_target_length: int = 640, fps: int = 25, num_inference_steps: int = 8, video_txt_guidance_scale: float = 5.0, audio_txt_guidance_scale: float = 5.0, cfg_number: int = 1, vae_stride: tuple&#91;int, int, int&#93; = (4, 16, 16), z_dim: int = 48, frame_receptive_field: int = 11, coords_style: str = &#x27;v2&#x27;, ref_audio_offset: int = 1000, text_offset: int = 0, video_guidance_high_t_threshold: int = 500, video_guidance_low_t_value: float = 2.0)</code></pre>
<p>DMD-2 distilled MagiHuman text-to-AV pipeline config.</p>
<p>Same arch as base (identical 331 keys, same shapes, same module tree),
but trained via DMD-2 for 8-step inference without classifier-free
guidance. Weights are stored in fp32 upstream; the conversion script's
<code>--cast-bf16</code> flag reduces the checkpoint to ~30 GB on disk.</p>

<details><summary>Source</summary><pre><code>@dataclass
class MagiHumanDistillConfig(MagiHumanBaseConfig):
    &quot;&quot;&quot;DMD-2 distilled MagiHuman text-to-AV pipeline config.

    Same arch as base (identical 331 keys, same shapes, same module tree),
    but trained via DMD-2 for 8-step inference without classifier-free
    guidance. Weights are stored in fp32 upstream; the conversion script&#x27;s
    `--cast-bf16` flag reduces the checkpoint to ~30 GB on disk.
    &quot;&quot;&quot;

    num_inference_steps: int = 8
    cfg_number: int = 1  # DMD distilled models skip CFG.
    # Lower flow_shift matches the distilled DMD schedule; if parity later
    # shows drift, measure against `scheduler_config.json` generated by the
    # conversion script for the distill subfolder.
    flow_shift: float | None = 5.0</code></pre></details>
<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanDistillI2VConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanDistillI2VConfig</code></h2>
<pre class="doc-signature"><code>MagiHumanDistillI2VConfig(model_path: str = &#x27;&#x27;, pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = 5.0, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = MagiHumanVideoConfig(), dit_precision: str = &#x27;bf16&#x27;, upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = &#x27;fp32&#x27;, vae_config: VAEConfig = WanVAEConfig(), vae_precision: str = &#x27;fp32&#x27;, vae_decode_precision: str | None = None, vae_tiling: bool = False, vae_sp: bool = False, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = &#x27;fp32&#x27;, image_encoder_configs: tuple&#91;EncoderConfig, ...&#93; | None = None, image_encoder_precisions: tuple&#91;str, ...&#93; | None = None, text_encoder_configs: tuple&#91;EncoderConfig, ...&#93; = (lambda: (T5GemmaEncoderConfig(),))(), text_encoder_precisions: tuple&#91;str, ...&#93; = (lambda: (&#x27;bf16&#x27;,))(), preprocess_text_funcs: tuple&#91;Callable&#91;&#91;str&#93;, str&#93;, ...&#93; = (lambda: (preprocess_text,))(), postprocess_text_funcs: tuple&#91;Callable&#91;&#91;BaseEncoderOutput&#93;, torch.Tensor&#93;, ...&#93; = (lambda: (t5gemma_postprocess_text,))(), dmd_denoising_steps: list&#91;int&#93; | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None, audio_vae_config: VAEConfig = OobleckVAEConfig(), precision: str = &#x27;bf16&#x27;, t5_gemma_target_length: int = 640, fps: int = 25, num_inference_steps: int = 8, video_txt_guidance_scale: float = 5.0, audio_txt_guidance_scale: float = 5.0, cfg_number: int = 1, vae_stride: tuple&#91;int, int, int&#93; = (4, 16, 16), z_dim: int = 48, frame_receptive_field: int = 11, coords_style: str = &#x27;v2&#x27;, ref_audio_offset: int = 1000, text_offset: int = 0, video_guidance_high_t_threshold: int = 500, video_guidance_low_t_value: float = 2.0, image_conditioning: bool = True)</code></pre>
<p>DMD-2 distilled MagiHuman text+image-to-AV pipeline config.</p>

<details><summary>Source</summary><pre><code>@dataclass
class MagiHumanDistillI2VConfig(MagiHumanDistillConfig):
    &quot;&quot;&quot;DMD-2 distilled MagiHuman text+image-to-AV pipeline config.&quot;&quot;&quot;

    image_conditioning: bool = True

    def __post_init__(self) -&gt; None:
        self.vae_config.load_encoder = True
        self.vae_config.load_decoder = True</code></pre></details>
<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanSR540pConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanSR540pConfig</code></h2>
<pre class="doc-signature"><code>MagiHumanSR540pConfig(model_path: str = &#x27;&#x27;, pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = 5.0, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = MagiHumanVideoConfig(), dit_precision: str = &#x27;bf16&#x27;, upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = &#x27;fp32&#x27;, vae_config: VAEConfig = WanVAEConfig(), vae_precision: str = &#x27;fp32&#x27;, vae_decode_precision: str | None = None, vae_tiling: bool = False, vae_sp: bool = False, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = &#x27;fp32&#x27;, image_encoder_configs: tuple&#91;EncoderConfig, ...&#93; | None = None, image_encoder_precisions: tuple&#91;str, ...&#93; | None = None, text_encoder_configs: tuple&#91;EncoderConfig, ...&#93; = (lambda: (T5GemmaEncoderConfig(),))(), text_encoder_precisions: tuple&#91;str, ...&#93; = (lambda: (&#x27;bf16&#x27;,))(), preprocess_text_funcs: tuple&#91;Callable&#91;&#91;str&#93;, str&#93;, ...&#93; = (lambda: (preprocess_text,))(), postprocess_text_funcs: tuple&#91;Callable&#91;&#91;BaseEncoderOutput&#93;, torch.Tensor&#93;, ...&#93; = (lambda: (t5gemma_postprocess_text,))(), dmd_denoising_steps: list&#91;int&#93; | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None, audio_vae_config: VAEConfig = OobleckVAEConfig(), precision: str = &#x27;bf16&#x27;, t5_gemma_target_length: int = 640, fps: int = 25, num_inference_steps: int = 32, video_txt_guidance_scale: float = 5.0, audio_txt_guidance_scale: float = 5.0, cfg_number: int = 2, vae_stride: tuple&#91;int, int, int&#93; = (4, 16, 16), z_dim: int = 48, frame_receptive_field: int = 11, coords_style: str = &#x27;v2&#x27;, ref_audio_offset: int = 1000, text_offset: int = 0, video_guidance_high_t_threshold: int = 500, video_guidance_low_t_value: float = 2.0, noise_value: int = 220, sr_audio_noise_scale: float = 0.7, sr_num_inference_steps: int = 5, sr_video_txt_guidance_scale: float = 3.5, use_cfg_trick: bool = True, cfg_trick_start_frame: int = 13, cfg_trick_value: float = 2.0, sr_height: int = 512, sr_width: int = 896, sr_local_attn_layers: tuple&#91;int, ...&#93; = ())</code></pre>
<p>Two-stage MagiHuman base + SR-540p text-to-AV pipeline config.</p>

<details><summary>Source</summary><pre><code>@dataclass
class MagiHumanSR540pConfig(MagiHumanBaseConfig):
    &quot;&quot;&quot;Two-stage MagiHuman base + SR-540p text-to-AV pipeline config.&quot;&quot;&quot;

    noise_value: int = 220
    sr_audio_noise_scale: float = 0.7
    sr_num_inference_steps: int = 5
    sr_video_txt_guidance_scale: float = 3.5
    use_cfg_trick: bool = True
    cfg_trick_start_frame: int = 13
    cfg_trick_value: float = 2.0
    # Upstream example/sr_540p uses sr_height=512, sr_width=896. Despite the
    # marketing name, these are the VAE/patch-aligned dimensions actually run.
    sr_height: int = 512
    sr_width: int = 896
    sr_local_attn_layers: tuple&#91;int, ...&#93; = ()</code></pre></details>
<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanSR540pI2VConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanSR540pI2VConfig</code></h2>
<pre class="doc-signature"><code>MagiHumanSR540pI2VConfig(model_path: str = &#x27;&#x27;, pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = 5.0, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = MagiHumanVideoConfig(), dit_precision: str = &#x27;bf16&#x27;, upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = &#x27;fp32&#x27;, vae_config: VAEConfig = WanVAEConfig(), vae_precision: str = &#x27;fp32&#x27;, vae_decode_precision: str | None = None, vae_tiling: bool = False, vae_sp: bool = False, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = &#x27;fp32&#x27;, image_encoder_configs: tuple&#91;EncoderConfig, ...&#93; | None = None, image_encoder_precisions: tuple&#91;str, ...&#93; | None = None, text_encoder_configs: tuple&#91;EncoderConfig, ...&#93; = (lambda: (T5GemmaEncoderConfig(),))(), text_encoder_precisions: tuple&#91;str, ...&#93; = (lambda: (&#x27;bf16&#x27;,))(), preprocess_text_funcs: tuple&#91;Callable&#91;&#91;str&#93;, str&#93;, ...&#93; = (lambda: (preprocess_text,))(), postprocess_text_funcs: tuple&#91;Callable&#91;&#91;BaseEncoderOutput&#93;, torch.Tensor&#93;, ...&#93; = (lambda: (t5gemma_postprocess_text,))(), dmd_denoising_steps: list&#91;int&#93; | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None, audio_vae_config: VAEConfig = OobleckVAEConfig(), precision: str = &#x27;bf16&#x27;, t5_gemma_target_length: int = 640, fps: int = 25, num_inference_steps: int = 32, video_txt_guidance_scale: float = 5.0, audio_txt_guidance_scale: float = 5.0, cfg_number: int = 2, vae_stride: tuple&#91;int, int, int&#93; = (4, 16, 16), z_dim: int = 48, frame_receptive_field: int = 11, coords_style: str = &#x27;v2&#x27;, ref_audio_offset: int = 1000, text_offset: int = 0, video_guidance_high_t_threshold: int = 500, video_guidance_low_t_value: float = 2.0, noise_value: int = 220, sr_audio_noise_scale: float = 0.7, sr_num_inference_steps: int = 5, sr_video_txt_guidance_scale: float = 3.5, use_cfg_trick: bool = True, cfg_trick_start_frame: int = 13, cfg_trick_value: float = 2.0, sr_height: int = 512, sr_width: int = 896, sr_local_attn_layers: tuple&#91;int, ...&#93; = (), image_conditioning: bool = True)</code></pre>
<p>Two-stage MagiHuman base + SR-540p text+image-to-AV config.</p>

<details><summary>Source</summary><pre><code>@dataclass
class MagiHumanSR540pI2VConfig(MagiHumanSR540pConfig):
    &quot;&quot;&quot;Two-stage MagiHuman base + SR-540p text+image-to-AV config.&quot;&quot;&quot;

    image_conditioning: bool = True

    def __post_init__(self) -&gt; None:
        self.vae_config.load_encoder = True
        self.vae_config.load_decoder = True</code></pre></details>
<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanSR1080pConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanSR1080pConfig</code></h2>
<pre class="doc-signature"><code>MagiHumanSR1080pConfig(model_path: str = &#x27;&#x27;, pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = 5.0, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = MagiHumanVideoConfig(), dit_precision: str = &#x27;bf16&#x27;, upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = &#x27;fp32&#x27;, vae_config: VAEConfig = WanVAEConfig(), vae_precision: str = &#x27;fp32&#x27;, vae_decode_precision: str | None = None, vae_tiling: bool = False, vae_sp: bool = False, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = &#x27;fp32&#x27;, image_encoder_configs: tuple&#91;EncoderConfig, ...&#93; | None = None, image_encoder_precisions: tuple&#91;str, ...&#93; | None = None, text_encoder_configs: tuple&#91;EncoderConfig, ...&#93; = (lambda: (T5GemmaEncoderConfig(),))(), text_encoder_precisions: tuple&#91;str, ...&#93; = (lambda: (&#x27;bf16&#x27;,))(), preprocess_text_funcs: tuple&#91;Callable&#91;&#91;str&#93;, str&#93;, ...&#93; = (lambda: (preprocess_text,))(), postprocess_text_funcs: tuple&#91;Callable&#91;&#91;BaseEncoderOutput&#93;, torch.Tensor&#93;, ...&#93; = (lambda: (t5gemma_postprocess_text,))(), dmd_denoising_steps: list&#91;int&#93; | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None, audio_vae_config: VAEConfig = OobleckVAEConfig(), precision: str = &#x27;bf16&#x27;, t5_gemma_target_length: int = 640, fps: int = 25, num_inference_steps: int = 32, video_txt_guidance_scale: float = 5.0, audio_txt_guidance_scale: float = 5.0, cfg_number: int = 2, vae_stride: tuple&#91;int, int, int&#93; = (4, 16, 16), z_dim: int = 48, frame_receptive_field: int = 11, coords_style: str = &#x27;v2&#x27;, ref_audio_offset: int = 1000, text_offset: int = 0, video_guidance_high_t_threshold: int = 500, video_guidance_low_t_value: float = 2.0, noise_value: int = 220, sr_audio_noise_scale: float = 0.7, sr_num_inference_steps: int = 5, sr_video_txt_guidance_scale: float = 3.5, use_cfg_trick: bool = True, cfg_trick_start_frame: int = 13, cfg_trick_value: float = 2.0, sr_height: int = 1080, sr_width: int = 1920, sr_local_attn_layers: tuple&#91;int, ...&#93; = _SR_1080P_LOCAL_ATTN_LAYERS)</code></pre>
<p>Two-stage MagiHuman base + SR-1080p text-to-AV pipeline config.</p>

<details><summary>Source</summary><pre><code>@dataclass
class MagiHumanSR1080pConfig(MagiHumanSR540pConfig):
    &quot;&quot;&quot;Two-stage MagiHuman base + SR-1080p text-to-AV pipeline config.&quot;&quot;&quot;

    sr_height: int = 1080
    sr_width: int = 1920
    sr_local_attn_layers: tuple&#91;int, ...&#93; = _SR_1080P_LOCAL_ATTN_LAYERS</code></pre></details>
<h2 id="fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanSR1080pI2VConfig"><code>fastvideo.pipelines.basic.magi_human.pipeline_configs.MagiHumanSR1080pI2VConfig</code></h2>
<pre class="doc-signature"><code>MagiHumanSR1080pI2VConfig(model_path: str = &#x27;&#x27;, pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = 5.0, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = MagiHumanVideoConfig(), dit_precision: str = &#x27;bf16&#x27;, upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = &#x27;fp32&#x27;, vae_config: VAEConfig = WanVAEConfig(), vae_precision: str = &#x27;fp32&#x27;, vae_decode_precision: str | None = None, vae_tiling: bool = False, vae_sp: bool = False, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = &#x27;fp32&#x27;, image_encoder_configs: tuple&#91;EncoderConfig, ...&#93; | None = None, image_encoder_precisions: tuple&#91;str, ...&#93; | None = None, text_encoder_configs: tuple&#91;EncoderConfig, ...&#93; = (lambda: (T5GemmaEncoderConfig(),))(), text_encoder_precisions: tuple&#91;str, ...&#93; = (lambda: (&#x27;bf16&#x27;,))(), preprocess_text_funcs: tuple&#91;Callable&#91;&#91;str&#93;, str&#93;, ...&#93; = (lambda: (preprocess_text,))(), postprocess_text_funcs: tuple&#91;Callable&#91;&#91;BaseEncoderOutput&#93;, torch.Tensor&#93;, ...&#93; = (lambda: (t5gemma_postprocess_text,))(), dmd_denoising_steps: list&#91;int&#93; | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None, audio_vae_config: VAEConfig = OobleckVAEConfig(), precision: str = &#x27;bf16&#x27;, t5_gemma_target_length: int = 640, fps: int = 25, num_inference_steps: int = 32, video_txt_guidance_scale: float = 5.0, audio_txt_guidance_scale: float = 5.0, cfg_number: int = 2, vae_stride: tuple&#91;int, int, int&#93; = (4, 16, 16), z_dim: int = 48, frame_receptive_field: int = 11, coords_style: str = &#x27;v2&#x27;, ref_audio_offset: int = 1000, text_offset: int = 0, video_guidance_high_t_threshold: int = 500, video_guidance_low_t_value: float = 2.0, noise_value: int = 220, sr_audio_noise_scale: float = 0.7, sr_num_inference_steps: int = 5, sr_video_txt_guidance_scale: float = 3.5, use_cfg_trick: bool = True, cfg_trick_start_frame: int = 13, cfg_trick_value: float = 2.0, sr_height: int = 1080, sr_width: int = 1920, sr_local_attn_layers: tuple&#91;int, ...&#93; = _SR_1080P_LOCAL_ATTN_LAYERS, image_conditioning: bool = True)</code></pre>
<p>Two-stage MagiHuman base + SR-1080p text+image-to-AV config.</p>

<details><summary>Source</summary><pre><code>@dataclass
class MagiHumanSR1080pI2VConfig(MagiHumanSR1080pConfig):
    &quot;&quot;&quot;Two-stage MagiHuman base + SR-1080p text+image-to-AV config.&quot;&quot;&quot;

    image_conditioning: bool = True

    def __post_init__(self) -&gt; None:
        self.vae_config.load_encoder = True
        self.vae_config.load_decoder = True</code></pre></details>
</div>
