---
title: V1 API
---

<div class="python-reference">
<a id="v1-api"></a>
<a id="video-generator"></a>
<a id="configuring-fastvideo"></a>
<a id="pipelineconfig"></a>
<a id="samplingparam"></a>
<a id="returning-samples-without-previews"></a>
<a id="fastvideo.entrypoints.video_generator.VideoGenerator-functions"></a>
<a id="fastvideo.configs.pipelines.base.PipelineConfig-functions"></a>
<a id="fastvideo.api.sampling_param.SamplingParam-functions"></a>
<p>FastVideo's V1 API provides a streamlined interface for video generation tasks with powerful customization options. This page documents the primary components of the API.</p>
<h2>Video Generator</h2>
<p>This class will be the primary Python API for generating videos and images.</p>
<h3 id="fastvideo.entrypoints.video_generator.VideoGenerator"><code>fastvideo.entrypoints.video_generator.VideoGenerator</code></h3>
<pre class="doc-signature"><code>VideoGenerator(fastvideo_args: FastVideoArgs, executor_class: type&#91;Executor&#93;, log_stats: bool, *, log_queue = None)</code></pre>
<p>A unified class for generating videos using diffusion models.</p>
<p>This class provides a simple interface for video generation with rich
customization options, similar to popular frameworks like HF Diffusers.</p>
<p>Initialize the video generator.</p>
<h4>Parameters</h4>
<dl>
<dt><code>fastvideo_args: FastVideoArgs</code></dt><dd><p>The inference arguments</p></dd>
<dt><code>executor_class: type[Executor]</code></dt><dd><p>The executor class to use for inference</p></dd>
<dt><code>log_stats: bool</code></dt><dd><p>Whether to log statistics</p></dd>
<dt><code>log_queue</code></dt><dd><p>Optional multiprocessing.Queue to forward worker logs to</p></dd>
</dl>
<h4 id="fastvideo.entrypoints.video_generator.VideoGenerator.from_pretrained"><code>fastvideo.entrypoints.video_generator.VideoGenerator.from_pretrained</code></h4>
<pre class="doc-signature"><code>from_pretrained(model_path: str | GeneratorConfig | Mapping&#91;str, Any&#93; | None = None, **kwargs) -&gt; VideoGenerator</code></pre>
<p>Create a video generator from a pretrained model.</p>
<h5>Parameters</h5>
<dl>
<dt><code>model_path: str | GeneratorConfig | Mapping[str, Any] | None</code></dt><dd><p>Path or identifier for the pretrained model</p></dd>
<dt><code>pipeline_config</code></dt><dd><p>Pipeline config to use for inference</p></dd>
<dt><code>**kwargs</code></dt><dd><p>Additional arguments to customize model loading, set any FastVideoArgs or PipelineConfig attributes here.</p></dd>
</dl>
<h5>Returns</h5>
<dl>
<dt><code>VideoGenerator</code></dt><dd><p>The created video generator</p></dd>
</dl>
<p>Priority level: Default pipeline config &lt; User's pipeline config &lt; User's kwargs</p>
<p>Stable convenience kwargs remain supported here for common engine and
offload settings. Advanced model- or pipeline-specific options should
move to VideoGenerator.from_config(...).</p>

<p><code>VideoGenerator.from_pretrained()</code> should be the primary way of creating a new video generator.</p>
<h2>Configuring FastVideo</h2>
<p>The following two classes <code>PipelineConfig</code> and <code>SamplingParam</code> are used to configure initialization and sampling parameters, respectively.</p>
<h3>PipelineConfig</h3>
<h4 id="fastvideo.configs.pipelines.base.PipelineConfig"><code>fastvideo.configs.pipelines.base.PipelineConfig</code></h4>
<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, output_channels: int = 3, 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>

<h5 id="fastvideo.configs.pipelines.base.PipelineConfig.from_pretrained"><code>fastvideo.configs.pipelines.base.PipelineConfig.from_pretrained</code></h5>
<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>
<h5 id="fastvideo.configs.pipelines.base.PipelineConfig.dump_to_json"><code>fastvideo.configs.pipelines.base.PipelineConfig.dump_to_json</code></h5>
<pre class="doc-signature"><code>dump_to_json(file_path: str)</code></pre>

<h3>SamplingParam</h3>
<h4 id="fastvideo.api.sampling_param.SamplingParam"><code>fastvideo.api.sampling_param.SamplingParam</code></h4>
<pre class="doc-signature"><code>SamplingParam(data_type: str = &#x27;video&#x27;, image_path: str | None = None, pil_image: Any | None = None, last_image: Any | None = None, references: list&#91;Any&#93; | None = None, video_path: str | None = None, pose_video_path: str | None = None, face_video_path: str | None = None, background_video_path: str | None = None, mask_video_path: str | None = None, animate_mode: str | None = None, audio_path: str | None = None, latents: Any | None = None, audio_latents: Any | None = None, mouse_cond: Any | None = None, keyboard_cond: Any | None = None, grid_sizes: Any | None = None, pose: str | None = None, prompt_attention_mask: list = list(), negative_attention_mask: list = list(), c2ws_plucker_emb: Any | None = None, action_path: str | None = None, t_thresh: float = 0.5, num_cond_frames: int = 0, prompt: str | list&#91;str&#93; | None = None, negative_prompt: str = &#x27;Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards&#x27;, max_sequence_length: int | None = None, prompt_path: str | None = None, output_path: str = &#x27;outputs/&#x27;, output_video_name: str | None = None, num_videos_per_prompt: int = 1, seed: int = 1024, num_frames: int = 125, height: int = 720, width: int = 1280, height_sr: int = 1072, width_sr: int = 1920, fps: int = 24, num_inference_steps: int = 50, num_inference_steps_sr: int = 50, guidance_scale: float = 1.0, batch_cfg: bool = False, guidance_scale_2: float | None = None, use_embedded_guidance: bool = False, true_cfg_scale: float = 1.0, guidance_rescale: float = 0.0, boundary_ratio: float | None = None, sigmas: list&#91;float&#93; | None = None, pyramid_num_inference_steps_list: list&#91;int&#93; | None = None, history_sizes: list&#91;int&#93; | None = None, num_latent_frames_per_chunk: int = 9, keep_first_frame: bool = True, is_skip_first_chunk: bool = False, use_zero_init: bool = True, zero_steps: int = 1, is_amplify_first_chunk: bool = False, enable_teacache: bool = False, trajectory_type: str | None = None, movement_distance: float | None = None, camera_rotation: str | None = None, ltx2_cfg_scale_video: float = 1.0, ltx2_cfg_scale_audio: float = 1.0, ltx2_modality_scale_video: float = 1.0, ltx2_modality_scale_audio: float = 1.0, ltx2_rescale_scale: float = 0.0, ltx2_stg_scale_video: float = 0.0, ltx2_stg_scale_audio: float = 0.0, ltx2_stg_blocks_video: list&#91;int&#93; = (lambda: &#91;29&#93;)(), ltx2_stg_blocks_audio: list&#91;int&#93; = (lambda: &#91;29&#93;)(), ltx2_use_ancestral_sampler: bool = False, ltx2_images: list&#91;tuple&#91;str, int, float&#93;&#93; | None = None, ltx2_image_crf: float = 33.0, ltx2_conditioning_latent_stage1: Any | None = None, ltx2_conditioning_latent_stage2: Any | None = None, ltx2_video_conditions: list&#91;tuple&#91;list&#91;str&#93;, int, float&#93;&#93; | None = None, audio_start_in_s: float | None = None, audio_end_in_s: float | None = None, init_audio: Any = None, init_audio_strength: float | None = None, init_noise_level: float | None = None, inpaint_audio: Any = None, inpaint_mask: Any = None, continuation_state: ContinuationState | None = None, return_continuation_state: bool = False, save_video: bool = True, return_frames: bool = True, return_trajectory_latents: bool = False, return_trajectory_decoded: bool = False, *, return_samples: bool = False)</code></pre>
<p>Sampling parameters for video generation.</p>

<h5 id="fastvideo.api.sampling_param.SamplingParam.from_pretrained"><code>fastvideo.api.sampling_param.SamplingParam.from_pretrained</code></h5>
<pre class="doc-signature"><code>from_pretrained(model_path: str) -&gt; SamplingParam</code></pre>

<h3>Returning samples without previews</h3>
<p>Set <code>OutputConfig(return_samples=True, return_frames=False, save_video=False)</code>
to receive the decoded CPU tensor in <code>GenerationResult.samples</code> without building
preview grids or writing media. Pixel samples retain the existing float <code>[0, 1]</code>
contract. <code>return_frames=True</code> continues to return both samples and preview frames.
The legacy sampling/keyword interface accepts the same <code>return_samples</code> option.</p>
</div>
