small fix

This commit is contained in:
JerryZhou54
2026-01-28 19:10:28 +00:00
parent e42f688466
commit 8140cb4460
5 changed files with 10 additions and 11 deletions
-3
View File
@@ -5,9 +5,6 @@ from typing import Any
import torch
from fastvideo.logger import init_logger
logger = init_logger(__name__)
# TODO(PY): move it elsewhere
def auto_attributes(init_func):
@@ -84,7 +84,6 @@ class ComposedPipelineBase(ABC):
# Load modules directly in initialization
logger.info("Loading pipeline modules...")
# fastvideo_args.dit_cpu_offload = False
with self.profiler_controller.region("profiler_region_model_loading"):
self.modules = self.load_modules(fastvideo_args, loaded_modules)
+6 -4
View File
@@ -241,9 +241,12 @@ class DenoisingStage(PipelineStage):
temporal_scale = fastvideo_args.pipeline_config.vae_config.temporal_compression_ratio
spatial_scale = fastvideo_args.pipeline_config.vae_config.spatial_compression_ratio
patch_size = fastvideo_args.pipeline_config.dit_config.patch_size
seq_len = ((F - 1) // temporal_scale + 1) * (
batch.height // spatial_scale) * (
batch.width // spatial_scale) // (patch_size * patch_size)
if isinstance(patch_size, int):
patch_size = (patch_size, patch_size, patch_size)
seq_len = ((F - 1) // temporal_scale +
1) * (batch.height // spatial_scale) * (
batch.width // spatial_scale) // (patch_size[1] *
patch_size[2])
# Initialize lists for ODE trajectory
trajectory_timesteps: list[torch.Tensor] = []
@@ -414,7 +417,6 @@ class DenoisingStage(PipelineStage):
**action_kwargs,
)
assert batch.do_classifier_free_guidance, "do_classifier_free_guidance is not supported"
if batch.do_classifier_free_guidance:
batch.is_cfg_negative = True
with set_forward_context(
@@ -118,10 +118,11 @@ class InputValidationStage(PipelineStage):
oh, ow = batch.height, batch.width
img = img.resize((ow, oh), Image.LANCZOS)
else:
# Standard Wan logic
patch_size = fastvideo_args.pipeline_config.dit_config.arch_config.patch_size
if isinstance(patch_size, int):
patch_size = (patch_size, patch_size, patch_size)
vae_stride = fastvideo_args.pipeline_config.vae_config.arch_config.spatial_compression_ratio
dh, dw = patch_size * vae_stride, patch_size * vae_stride
dh, dw = patch_size[1] * vae_stride, patch_size[2] * vae_stride
max_area = 480 * 848
ow, oh = best_output_size(iw, ih, dw, dh, max_area)
@@ -67,7 +67,7 @@ class SelfForcingDistillationPipeline(DistillationPipeline):
self.noise_scheduler = SelfForcingFlowMatchScheduler(
num_inference_steps=1000,
shift=5.0,
shift=self.timestep_shift,
sigma_min=0.0,
extra_one_step=True,
training=True)