fastvideo.fastvideo_args

Contents

fastvideo.fastvideo_args#

The arguments of FastVideo Inference.

Module Contents#

Classes#

ExecutionMode

Enumeration for different pipeline modes.

FastVideoArgs

TrainingArgs

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

WorkloadType

Enumeration for different workload types.

Functions#

get_current_fastvideo_args

parse_int_list

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.fastvideo_args.ExecutionMode[source]#

Bases: str, enum.Enum

Enumeration for different pipeline modes.

Inherits from str to allow string comparison for backward compatibility.

Initialization

Initialize self. See help(type(self)) for accurate signature.

DISTILLATION[source]#

‘distillation’

FINETUNING[source]#

‘finetuning’

INFERENCE[source]#

‘inference’

PREPROCESS[source]#

‘preprocess’

classmethod choices() list[str][source]#

Get all available choices as strings for argparse.

classmethod from_string(value: str) fastvideo.fastvideo_args.ExecutionMode[source]#

Convert string to ExecutionMode enum.

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

None

VSA_sparsity: float[source]#

0.0

static add_cli_args(parser: fastvideo.utils.FlexibleArgumentParser) fastvideo.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’

dit_cpu_offload: bool[source]#

True

enable_stage_verification: bool[source]#

True

enable_torch_compile: bool[source]#

False

classmethod from_cli_args(args: argparse.Namespace) fastvideo.fastvideo_args.FastVideoArgs[source]#
classmethod from_kwargs(**kwargs: Any) fastvideo.fastvideo_args.FastVideoArgs[source]#
hsdp_replicate_dim: int[source]#

1

hsdp_shard_dim: int[source]#

None

image_encoder_cpu_offload: bool[source]#

True

inference_mode: bool[source]#

True

lora_nickname: str[source]#

‘default’

lora_path: str | None[source]#

None

lora_target_modules: list[str] | None[source]#

None

mask_strategy_file_path: str | None[source]#

None

master_port: int | None[source]#

None

mode: fastvideo.fastvideo_args.ExecutionMode[source]#

None

model_loaded: dict[str, bool][source]#

‘field(…)’

model_path: str[source]#

None

model_paths: dict[str, str][source]#

‘field(…)’

num_gpus: int[source]#

1

output_type: str[source]#

‘pil’

pin_cpu_memory: bool[source]#

True

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

‘field(…)’

preprocess_config: fastvideo.configs.configs.PreprocessConfig | None[source]#

None

prompt_txt: str | None[source]#

None

revision: str | None[source]#

None

skip_time_steps: int[source]#

15

sp_size: int[source]#

None

text_encoder_cpu_offload: bool[source]#

True

tp_size: int[source]#

None

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

False

use_fsdp_inference: bool[source]#

True

vae_cpu_offload: bool[source]#

True

workload_type: fastvideo.fastvideo_args.WorkloadType[source]#

None

class fastvideo.fastvideo_args.TrainingArgs[source]#

Bases: fastvideo.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.utils.FlexibleArgumentParser) fastvideo.utils.FlexibleArgumentParser[source]#
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

fake_score_learning_rate: float[source]#

0.0

fake_score_lr_scheduler: str[source]#

‘constant’

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

5

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

log_visualization: bool[source]#

False

logit_mean: float[source]#

0.0

logit_std: float[source]#

1.0

lora_alpha: int | None[source]#

None

lora_rank: int | None[source]#

None

lora_training: bool[source]#

False

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_timestep_ratio: float[source]#

0.98

max_train_steps: int[source]#

0

min_lr_ratio: float[source]#

0.5

min_timestep_ratio: float[source]#

0.2

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]#
real_score_guidance_scale: float[source]#

3.5

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

False

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

None

selective_checkpointing: float[source]#

0.0

simulate_generator_forward: bool[source]#

False

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

training_state_checkpointing_steps: int[source]#

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

weight_only_checkpointing_steps: int[source]#

0

weighting_scheme: str = <Multiline-String>[source]#
class fastvideo.fastvideo_args.WorkloadType[source]#

Bases: str, enum.Enum

Enumeration for different workload types.

Inherits from str to allow string comparison for backward compatibility.

Initialization

Initialize self. See help(type(self)) for accurate signature.

I2I[source]#

‘i2i’

I2V[source]#

‘i2v’

T2I[source]#

‘t2i’

T2V[source]#

‘t2v’

classmethod choices() list[str][source]#

Get all available choices as strings for argparse.

classmethod from_string(value: str) fastvideo.fastvideo_args.WorkloadType[source]#

Convert string to WorkloadType enum.

fastvideo.fastvideo_args.get_current_fastvideo_args() fastvideo.fastvideo_args.FastVideoArgs[source]#
fastvideo.fastvideo_args.logger[source]#

‘init_logger(…)’

fastvideo.fastvideo_args.parse_int_list(value: str) list[int][source]#
fastvideo.fastvideo_args.prepare_fastvideo_args(argv: list[str]) fastvideo.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.fastvideo_args.set_current_fastvideo_args(fastvideo_args: fastvideo.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.