fastvideo.v1.fastvideo_args

Contents

fastvideo.v1.fastvideo_args#

The arguments of FastVideo Inference.

Module Contents#

Classes#

FastVideoArgs

TrainingArgs

Training arguments. Inherits from FastVideoArgs and adds training-specific arguments. If there are any conflicts, the training arguments will take precedence.

Functions#

clean_cli_args

Clean the arguments by removing the ones that not explicitly provided by the user.

get_current_fastvideo_args

prepare_fastvideo_args

Prepare the inference arguments from the command line arguments.

set_current_fastvideo_args

Temporarily set the current fastvideo config. Used during model initialization. We save the current fastvideo config in a global variable, so that all modules can access it, e.g. custom ops can access the fastvideo config to determine how to dispatch.

Data#

API#

class fastvideo.v1.fastvideo_args.FastVideoArgs[source]#
STA_mode: fastvideo.v1.configs.pipelines.base.STA_Mode[source]#

None

VSA_sparsity: float[source]#

0.0

static add_cli_args(parser: fastvideo.v1.utils.FlexibleArgumentParser) β†’ fastvideo.v1.utils.FlexibleArgumentParser[source]#
cache_strategy: str[source]#

β€˜none’

check_fastvideo_args() β†’ None[source]#

Validate inference arguments for consistency

disable_autocast: bool[source]#

False

dist_timeout: int | None[source]#

None

distributed_executor_backend: str[source]#

β€˜mp’

enable_stage_verification: bool[source]#

True

enable_torch_compile: bool[source]#

False

classmethod from_cli_args(args: argparse.Namespace) β†’ fastvideo.v1.fastvideo_args.FastVideoArgs[source]#
classmethod from_kwargs(kwargs: dict[str, Any]) β†’ fastvideo.v1.fastvideo_args.FastVideoArgs[source]#
hsdp_replicate_dim: int[source]#

1

hsdp_shard_dim: int[source]#

None

inference_mode: bool[source]#

True

mask_strategy_file_path: str | None[source]#

None

model_path: str[source]#

None

num_gpus: int[source]#

1

output_type: str[source]#

β€˜pil’

pin_cpu_memory: bool[source]#

True

pipeline_config: fastvideo.v1.configs.pipelines.base.PipelineConfig[source]#

β€˜field(…)’

revision: str | None[source]#

None

skip_time_steps: int[source]#

15

sp_size: int[source]#

None

text_encoder_offload: bool[source]#

True

tp_size: int[source]#

None

property training_mode: bool[source]#
trust_remote_code: bool[source]#

False

use_cpu_offload: bool[source]#

True

use_fsdp_inference: bool[source]#

True

class fastvideo.v1.fastvideo_args.TrainingArgs[source]#

Bases: fastvideo.v1.fastvideo_args.FastVideoArgs

Training arguments. Inherits from FastVideoArgs and adds training-specific arguments. If there are any conflicts, the training arguments will take precedence.

VSA_decay_interval_steps: int[source]#

1

VSA_decay_rate: float[source]#

0.01

static add_cli_args(parser: fastvideo.v1.utils.FlexibleArgumentParser) β†’ fastvideo.v1.utils.FlexibleArgumentParser[source]#
allow_tf32: bool[source]#

False

checkpointing_steps: int[source]#

0

checkpoints_total_limit: int[source]#

0

data_path: str = <Multiline-String>[source]#
dataloader_num_workers: int[source]#

0

distill_cfg: float[source]#

0.0

dit_model_name_or_path: str = <Multiline-String>[source]#
ema_decay: float[source]#

0.0

ema_start_step: int[source]#

0

enable_gradient_checkpointing_type: str | None[source]#

None

classmethod from_cli_args(args: argparse.Namespace) β†’ fastvideo.v1.fastvideo_args.TrainingArgs[source]#
fsdp_sharding_startegy: str = <Multiline-String>[source]#
gradient_accumulation_steps: int[source]#

0

group_frame: bool[source]#

False

group_resolution: bool[source]#

False

hunyuan_teacher_disable_cfg: bool[source]#

False

learning_rate: float[source]#

0.0

linear_quadratic_threshold: float[source]#

0.0

linear_range: float[source]#

0.0

log_validation: bool[source]#

False

logit_mean: float[source]#

0.0

logit_std: float[source]#

1.0

lr_num_cycles: int[source]#

0

lr_power: float[source]#

0.0

lr_scheduler: str[source]#

β€˜constant’

lr_warmup_steps: int[source]#

0

master_weight_type: str = <Multiline-String>[source]#
max_grad_norm: float[source]#

0.0

max_train_steps: int[source]#

0

mixed_precision: str = <Multiline-String>[source]#
mode_scale: float[source]#

0.0

multi_phased_distill_schedule: str = <Multiline-String>[source]#
not_apply_cfg_solver: bool[source]#

False

num_euler_timesteps: int[source]#

0

num_frames: int[source]#

0

num_height: int[source]#

0

num_latent_t: int[source]#

0

num_train_epochs: int[source]#

0

num_width: int[source]#

0

output_dir: str = <Multiline-String>[source]#
precondition_outputs: bool[source]#

False

pred_decay_type: str = <Multiline-String>[source]#
pred_decay_weight: float[source]#

0.0

pretrained_model_name_or_path: str = <Multiline-String>[source]#
resume_from_checkpoint: bool[source]#

False

scale_lr: bool[source]#

False

scheduler_type: str = <Multiline-String>[source]#
seed: int | None[source]#

None

selective_checkpointing: float[source]#

0.0

tracker_project_name: str = <Multiline-String>[source]#
train_batch_size: int[source]#

0

train_sp_batch_size: int[source]#

0

training_cfg_rate: float[source]#

0.0

use_ema: bool[source]#

False

validation_dataset_file: str = <Multiline-String>[source]#
validation_guidance_scale: str = <Multiline-String>[source]#
validation_preprocessed_path: str = <Multiline-String>[source]#
validation_sampling_steps: str = <Multiline-String>[source]#
validation_steps: float[source]#

0.0

wandb_run_name: str = <Multiline-String>[source]#
weight_decay: float[source]#

0.0

weighting_scheme: str = <Multiline-String>[source]#
fastvideo.v1.fastvideo_args.clean_cli_args(args: argparse.Namespace) β†’ dict[str, Any][source]#

Clean the arguments by removing the ones that not explicitly provided by the user.

fastvideo.v1.fastvideo_args.get_current_fastvideo_args() β†’ fastvideo.v1.fastvideo_args.FastVideoArgs[source]#
fastvideo.v1.fastvideo_args.logger[source]#

β€˜init_logger(…)’

fastvideo.v1.fastvideo_args.prepare_fastvideo_args(argv: list[str]) β†’ fastvideo.v1.fastvideo_args.FastVideoArgs[source]#

Prepare the inference arguments from the command line arguments.

Parameters:

argv – The command line arguments. Typically, it should be sys.argv[1:] to ensure compatibility with parse_args when no arguments are passed.

Returns:

The inference arguments.

fastvideo.v1.fastvideo_args.set_current_fastvideo_args(fastvideo_args: fastvideo.v1.fastvideo_args.FastVideoArgs)[source]#

Temporarily set the current fastvideo config. Used during model initialization. We save the current fastvideo config in a global variable, so that all modules can access it, e.g. custom ops can access the fastvideo config to determine how to dispatch.