MCPcopy Create free account
hub / github.com/Francis-Rings/FlashPortrait / encode_video

Method encode_video

wan/models/wan_vae_tiny.py:207–214  ·  view source on GitHub ↗
(self, x, parallel=True, show_progress_bar=True)

Source from the content-addressed store, hash-verified

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

Callers 2

encode_videoMethod · 0.45
encode_videoMethod · 0.45

Calls 1

Tested by

no test coverage detected