| 61 | latent_format = HunyuanVideo |
| 62 | |
| 63 | class WanVideoModel(torch.nn.Module): |
| 64 | def __init__(self, model_config, transformer, device=None): |
| 65 | super().__init__() |
| 66 | self.latent_format = model_config.latent_format |
| 67 | self.model_config = model_config |
| 68 | self.device = device |
| 69 | self.current_patcher = None |
| 70 | self.diffusion_model = transformer |
| 71 | self.pipeline = {} |
| 72 | |
| 73 | def __getitem__(self, k): |
| 74 | return self.pipeline[k] |
| 75 | |
| 76 | def __setitem__(self, k, v): |
| 77 | self.pipeline[k] = v |
| 78 | |
| 79 | class WanVideoModelConfig: |
| 80 | def __init__(self, latent_format=latent_format): |