(self, x, parallel=True, show_progress_bar=True)
| 205 | return sd |
| 206 | |
| 207 | def encode_video(self, x, parallel=True, show_progress_bar=True): |
| 208 | if self.patch_size > 1: |
| 209 | x = F.pixel_unshuffle(x, self.patch_size) |
| 210 | if x.shape[1] % 4 != 0: |
| 211 | n_pad = 4 - x.shape[1] % 4 |
| 212 | padding = x[:, -1:].repeat_interleave(n_pad, dim=1) |
| 213 | x = torch.cat([x, padding], 1) |
| 214 | return apply_model_with_memblocks(self.encoder, x, parallel, show_progress_bar) |
| 215 | |
| 216 | def decode_video(self, x, parallel=True, show_progress_bar=True): |
| 217 | skip_trim = self.is_cogvideox and x.shape[1] % 2 == 0 |
no test coverage detected