|
6 | 6 |
|
7 | 7 | from fastvideo.configs.models import DiTConfig, EncoderConfig, VAEConfig |
8 | 8 | from fastvideo.configs.models.dits import WanVideoConfig |
| 9 | +from fastvideo.configs.models.dits.wanvideo import WanVideoArchConfig |
9 | 10 | from fastvideo.configs.models.dits.matrixgame import MatrixGameWanVideoConfig |
10 | 11 | from fastvideo.configs.models.encoders import (BaseEncoderOutput, CLIPVisionConfig, T5Config, |
11 | 12 | WAN2_1ControlCLIPVisionConfig) |
12 | 13 | from fastvideo.configs.models.vaes import WanVAEConfig |
| 14 | +from fastvideo.configs.models.vaes.wanvae import WanVAEArchConfig |
13 | 15 | from fastvideo.configs.pipelines.base import PipelineConfig |
14 | 16 |
|
15 | 17 |
|
@@ -126,6 +128,60 @@ def __post_init__(self) -> None: |
126 | 128 | self.dit_config.expand_timesteps = self.expand_timesteps |
127 | 129 |
|
128 | 130 |
|
| 131 | +@dataclass |
| 132 | +class LucyEditDevConfig(Wan2_2_TI2V_5B_Config): |
| 133 | + """Configuration for Decart Lucy Edit Dev video editing.""" |
| 134 | + |
| 135 | + dit_config: DiTConfig = field(default_factory=lambda: WanVideoConfig(arch_config=WanVideoArchConfig( |
| 136 | + num_attention_heads=24, |
| 137 | + in_channels=96, |
| 138 | + out_channels=48, |
| 139 | + ffn_dim=14336, |
| 140 | + num_layers=30, |
| 141 | + ))) |
| 142 | + vae_config: VAEConfig = field(default_factory=lambda: WanVAEConfig(arch_config=WanVAEArchConfig( |
| 143 | + base_dim=160, |
| 144 | + decoder_base_dim=256, |
| 145 | + z_dim=48, |
| 146 | + in_channels=12, |
| 147 | + out_channels=12, |
| 148 | + scale_factor_spatial=16, |
| 149 | + patch_size=2, |
| 150 | + is_residual=True, |
| 151 | + clip_output=False, |
| 152 | + latents_mean=( |
| 153 | + -0.2289, -0.0052, -0.1323, -0.2339, -0.2799, 0.0174, |
| 154 | + 0.1838, 0.1557, -0.1382, 0.0542, 0.2813, 0.0891, |
| 155 | + 0.1570, -0.0098, 0.0375, -0.1825, -0.2246, -0.1207, |
| 156 | + -0.0698, 0.5109, 0.2665, -0.2108, -0.2158, 0.2502, |
| 157 | + -0.2055, -0.0322, 0.1109, 0.1567, -0.0729, 0.0899, |
| 158 | + -0.2799, -0.1230, -0.0313, -0.1649, 0.0117, 0.0723, |
| 159 | + -0.2839, -0.2083, -0.0520, 0.3748, 0.0152, 0.1957, |
| 160 | + 0.1433, -0.2944, 0.3573, -0.0548, -0.1681, -0.0667, |
| 161 | + ), |
| 162 | + latents_std=( |
| 163 | + 0.4765, 1.0364, 0.4514, 1.1677, 0.5313, 0.4990, |
| 164 | + 0.4818, 0.5013, 0.8158, 1.0344, 0.5894, 1.0901, |
| 165 | + 0.6885, 0.6165, 0.8454, 0.4978, 0.5759, 0.3523, |
| 166 | + 0.7135, 0.6804, 0.5833, 1.4146, 0.8986, 0.5659, |
| 167 | + 0.7069, 0.5338, 0.4889, 0.4917, 0.4069, 0.4999, |
| 168 | + 0.6866, 0.4093, 0.5709, 0.6065, 0.6415, 0.4944, |
| 169 | + 0.5726, 1.2042, 0.5458, 1.6887, 0.3971, 1.0600, |
| 170 | + 0.3943, 0.5537, 0.5444, 0.4089, 0.7468, 0.7744, |
| 171 | + ), |
| 172 | + ))) |
| 173 | + ti2v_task: bool = False |
| 174 | + lucy_edit_task: bool = True |
| 175 | + |
| 176 | + def __post_init__(self) -> None: |
| 177 | + # Lucy uses Wan2.2's enhanced 48-channel VAE latents. Denoising |
| 178 | + # concatenates noise + video latents, matching the 96-channel |
| 179 | + # transformer input declared above. |
| 180 | + self.vae_config.load_encoder = True |
| 181 | + self.vae_config.load_decoder = True |
| 182 | + self.dit_config.expand_timesteps = self.expand_timesteps |
| 183 | + |
| 184 | + |
129 | 185 | @dataclass |
130 | 186 | class FastWan2_2_TI2V_5B_Config(Wan2_2_TI2V_5B_Config): |
131 | 187 | flow_shift: float | None = 5.0 |
|
0 commit comments