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

Method forward

wan/models/wan_image_encoder.py:513–528  ·  view source on GitHub ↗
(self, videos)

Source from the content-addressed store, hash-verified

511 return_tokenizer=False)
512
513 def forward(self, videos):
514 # preprocess
515 size = (self.model.image_size,) * 2
516 videos = torch.cat([
517 F.interpolate(
518 u.transpose(0, 1),
519 size=size,
520 mode='bicubic',
521 align_corners=False) for u in videos
522 ])
523 videos = self.transforms.transforms[-1](videos.mul_(0.5).add_(0.5))
524
525 # forward
526 with torch.cuda.amp.autocast(dtype=self.dtype):
527 out = self.model.visual(videos, use_31_block=True)
528 return out
529
530 @classmethod
531 def from_pretrained(cls, pretrained_model_path, transformer_additional_kwargs={}):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected