MCPcopy Create free account
hub / github.com/tdrussell/diffusion-pipe / visual

Method visual

models/wan/clip.py:521–536  ·  view source on GitHub ↗
(self, videos)

Source from the content-addressed store, hash-verified

519 clean='whitespace')
520
521 def visual(self, videos):
522 # preprocess
523 size = (self.model.image_size,) * 2
524 videos = torch.cat([
525 F.interpolate(
526 u.transpose(0, 1),
527 size=size,
528 mode='bicubic',
529 align_corners=False) for u in videos
530 ])
531 videos = self.transforms.transforms[-1](videos.mul_(0.5).add_(0.5))
532
533 # forward
534 with torch.amp.autocast('cuda', dtype=self.dtype):
535 out = self.model.visual(videos, use_31_block=True)
536 return out

Callers 2

fnMethod · 0.80
forwardMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected