Decode a sequence of frames from latents. x: NTCHW latent tensor; returns NTCHW RGB in ~[0, 1].
(self, x, parallel=True, show_progress_bar=False, cond=None)
| 252 | return sd |
| 253 | |
| 254 | def decode_video(self, x, parallel=True, show_progress_bar=False, cond=None): |
| 255 | """Decode a sequence of frames from latents. |
| 256 | x: NTCHW latent tensor; returns NTCHW RGB in ~[0, 1]. |
| 257 | """ |
| 258 | trim_flag = self.mem[-8] is None # keeps original relative check |
| 259 | |
| 260 | if cond is not None: |
| 261 | x = torch.cat([self.pixel_shuffle(cond), x], dim=2) |
| 262 | |
| 263 | x, self.mem = apply_model_with_memblocks(self.decoder, x, parallel, show_progress_bar, mem=self.mem) |
| 264 | |
| 265 | if trim_flag: |
| 266 | return x[:, self.frames_to_trim:] |
| 267 | return x |
| 268 | |
| 269 | def forward(self, *args, **kwargs): |
| 270 | raise NotImplementedError("Decoder-only model: call decode_video(...) instead.") |
no test coverage detected