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

Method __init__

diffsynth/models/omnigen.py:239–246  ·  view source on GitHub ↗
(self, hidden_size, patch_size, out_channels)

Source from the content-addressed store, hash-verified

237 The final layer of DiT.
238 """
239 def __init__(self, hidden_size, patch_size, out_channels):
240 super().__init__()
241 self.norm_final = nn.LayerNorm(hidden_size, elementwise_affine=False, eps=1e-6)
242 self.linear = nn.Linear(hidden_size, patch_size * patch_size * out_channels, bias=True)
243 self.adaLN_modulation = nn.Sequential(
244 nn.SiLU(),
245 nn.Linear(hidden_size, 2 * hidden_size, bias=True)
246 )
247
248 def forward(self, x, c):
249 shift, scale = self.adaLN_modulation(c).chunk(2, dim=1)

Callers 4

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected