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

Method __init__

diffsynth/models/flux_ipadapter.py:8–19  ·  view source on GitHub ↗
(self, cross_attention_dim=768, id_embeddings_dim=512, num_tokens=4)

Source from the content-addressed store, hash-verified

6
7class MLPProjModel(torch.nn.Module):
8 def __init__(self, cross_attention_dim=768, id_embeddings_dim=512, num_tokens=4):
9 super().__init__()
10
11 self.cross_attention_dim = cross_attention_dim
12 self.num_tokens = num_tokens
13
14 self.proj = torch.nn.Sequential(
15 torch.nn.Linear(id_embeddings_dim, id_embeddings_dim*2),
16 torch.nn.GELU(),
17 torch.nn.Linear(id_embeddings_dim*2, cross_attention_dim*num_tokens),
18 )
19 self.norm = torch.nn.LayerNorm(cross_attention_dim)
20
21 def forward(self, id_embeds):
22 x = self.proj(id_embeds)

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected