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

Method __init__

diffsynth/models/flux_ipadapter.py:28–35  ·  view source on GitHub ↗
(self, num_attention_heads, attention_head_dim, input_dim)

Source from the content-addressed store, hash-verified

26
27class IpAdapterModule(torch.nn.Module):
28 def __init__(self, num_attention_heads, attention_head_dim, input_dim):
29 super().__init__()
30 self.num_heads = num_attention_heads
31 self.head_dim = attention_head_dim
32 output_dim = num_attention_heads * attention_head_dim
33 self.to_k_ip = torch.nn.Linear(input_dim, output_dim, bias=False)
34 self.to_v_ip = torch.nn.Linear(input_dim, output_dim, bias=False)
35 self.norm_added_k = RMSNorm(attention_head_dim, eps=1e-5, elementwise_affine=False)
36
37
38 def forward(self, hidden_states):

Callers

nothing calls this directly

Calls 2

RMSNormClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected