MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / forward

Method forward

diffsynth/models/stepvideo_vae.py:527–541  ·  view source on GitHub ↗
(self, x, temb=None, is_init=True)

Source from the content-addressed store, hash-verified

525 self.nin_shortcut = CausalConvAfterNorm(in_channels, out_channels, kernel_size=1)
526
527 def forward(self, x, temb=None, is_init=True):
528 x = x.permute(0,2,3,4,1).contiguous()
529
530 h = self.norm1(x, zero_pad=True, act_silu=True, pad_size=2)
531 h = self.conv1(h)
532 if temb is not None:
533 h = h + self.temb_proj(nn.functional.silu(temb))[:, :, None, None]
534
535 x = self.nin_shortcut(x) if self.in_channels != self.out_channels else x
536
537 h = self.norm2(h, zero_pad=True, act_silu=True, pad_size=2)
538 x = self.conv2(h, residual=x)
539
540 x = x.permute(0,4,1,2,3)
541 return x
542
543
544class Downsample3D(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected