(self,
model_type='i2v',
patch_size=(1, 2, 2),
text_len=512,
in_dim=16,
dim=2048,
ffn_dim=8192,
freq_dim=256,
text_dim=4096,
out_dim=16,
num_heads=16,
num_layers=32,
window_size=(-1, -1),
qk_norm=True,
cross_attn_norm=True,
eps=1e-6,
# audio params
audio_window=5,
intermediate_dim=512,
output_dim=768,
context_tokens=32,
vae_scale=4, # vae timedownsample scale
norm_input_visual=True,
norm_output_audio=True,
weight_init=True)
| 440 | |
| 441 | @register_to_config |
| 442 | def __init__(self, |
| 443 | model_type='i2v', |
| 444 | patch_size=(1, 2, 2), |
| 445 | text_len=512, |
| 446 | in_dim=16, |
| 447 | dim=2048, |
| 448 | ffn_dim=8192, |
| 449 | freq_dim=256, |
| 450 | text_dim=4096, |
| 451 | out_dim=16, |
| 452 | num_heads=16, |
| 453 | num_layers=32, |
| 454 | window_size=(-1, -1), |
| 455 | qk_norm=True, |
| 456 | cross_attn_norm=True, |
| 457 | eps=1e-6, |
| 458 | # audio params |
| 459 | audio_window=5, |
| 460 | intermediate_dim=512, |
| 461 | output_dim=768, |
| 462 | context_tokens=32, |
| 463 | vae_scale=4, # vae timedownsample scale |
| 464 | |
| 465 | norm_input_visual=True, |
| 466 | norm_output_audio=True, |
| 467 | weight_init=True): |
| 468 | super().__init__() |
| 469 | |
| 470 | assert model_type == 'i2v', 'MultiTalk model requires your model_type is i2v.' |
| 471 | self.model_type = model_type |
| 472 | |
| 473 | self.patch_size = patch_size |
| 474 | self.text_len = text_len |
| 475 | self.in_dim = in_dim |
| 476 | self.dim = dim |
| 477 | self.ffn_dim = ffn_dim |
| 478 | self.freq_dim = freq_dim |
| 479 | self.text_dim = text_dim |
| 480 | self.out_dim = out_dim |
| 481 | self.num_heads = num_heads |
| 482 | self.num_layers = num_layers |
| 483 | self.window_size = window_size |
| 484 | self.qk_norm = qk_norm |
| 485 | self.cross_attn_norm = cross_attn_norm |
| 486 | self.eps = eps |
| 487 | |
| 488 | |
| 489 | self.norm_output_audio = norm_output_audio |
| 490 | self.audio_window = audio_window |
| 491 | self.intermediate_dim = intermediate_dim |
| 492 | self.vae_scale = vae_scale |
| 493 | |
| 494 | |
| 495 | # embeddings |
| 496 | self.patch_embedding = nn.Conv3d( |
| 497 | in_dim, dim, kernel_size=patch_size, stride=patch_size) |
| 498 | self.text_embedding = nn.Sequential( |
| 499 | nn.Linear(text_dim, dim), nn.GELU(approximate='tanh'), |
nothing calls this directly
no test coverage detected