|
47 | 47 | load_upsampler_weights, |
48 | 48 | adain_filter_latent, |
49 | 49 | tone_map_latents, |
| 50 | + KNOWN_UPSAMPLER_CONFIGS, |
50 | 51 | ) |
51 | 52 | from ...models.ltx2.text_encoders.text_encoders_ltx2 import LTX2AudioVideoGemmaTextEncoder |
52 | 53 | from ...video_processor import VideoProcessor |
@@ -572,17 +573,26 @@ def load_upsampler(cls, devices_array: np.array, mesh: Mesh, rngs: nnx.Rngs, con |
572 | 573 | mid_channels = upsampler_config.get("mid_channels", 1024) |
573 | 574 |
|
574 | 575 | if filename is not None: |
575 | | - if "temporal" in filename: |
576 | | - temporal_upsample = True |
577 | | - spatial_upsample = False |
578 | | - elif "spatial" in filename: |
579 | | - spatial_upsample = True |
580 | | - temporal_upsample = False |
581 | | - |
582 | | - if "x1.5" in filename: |
583 | | - rational_spatial_scale = 1.5 |
584 | | - elif "x2" in filename: |
585 | | - rational_spatial_scale = None # Force fallback for x2 |
| 576 | + if filename in KNOWN_UPSAMPLER_CONFIGS: |
| 577 | + mapped_config = KNOWN_UPSAMPLER_CONFIGS[filename] |
| 578 | + spatial_upsample = mapped_config.get("spatial_upsample", spatial_upsample) |
| 579 | + temporal_upsample = mapped_config.get("temporal_upsample", temporal_upsample) |
| 580 | + rational_spatial_scale = mapped_config.get("rational_spatial_scale", rational_spatial_scale) |
| 581 | + else: |
| 582 | + max_logging.log( |
| 583 | + f"Warning: Filename '{filename}' not in KNOWN_UPSAMPLER_CONFIGS, falling back to heuristic parsing." |
| 584 | + ) |
| 585 | + if "temporal" in filename: |
| 586 | + temporal_upsample = True |
| 587 | + spatial_upsample = False |
| 588 | + elif "spatial" in filename: |
| 589 | + spatial_upsample = True |
| 590 | + temporal_upsample = False |
| 591 | + |
| 592 | + if "x1.5" in filename: |
| 593 | + rational_spatial_scale = 1.5 |
| 594 | + elif "x2" in filename: |
| 595 | + rational_spatial_scale = None # Force fallback for x2 |
586 | 596 |
|
587 | 597 | max_logging.log( |
588 | 598 | f"Upsampler config inferred: spatial={spatial_upsample}, temporal={temporal_upsample}, scale={rational_spatial_scale}, mid_channels={mid_channels}" |
@@ -1315,7 +1325,7 @@ def __call__( |
1315 | 1325 | audio_channels = ( |
1316 | 1326 | self.audio_vae.config.latent_channels |
1317 | 1327 | if hasattr(self.audio_vae, "config") and hasattr(self.audio_vae.config, "latent_channels") |
1318 | | - else 128 |
| 1328 | + else 8 |
1319 | 1329 | ) |
1320 | 1330 |
|
1321 | 1331 | duration_s = num_frames / frame_rate |
|
0 commit comments