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

Method __init__

diffsynth/models/flux_ipadapter.py:51–55  ·  view source on GitHub ↗
(self, num_attention_heads=24, attention_head_dim=128, cross_attention_dim=4096, num_tokens=128, num_blocks=57)

Source from the content-addressed store, hash-verified

49
50class FluxIpAdapter(torch.nn.Module):
51 def __init__(self, num_attention_heads=24, attention_head_dim=128, cross_attention_dim=4096, num_tokens=128, num_blocks=57):
52 super().__init__()
53 self.ipadapter_modules = torch.nn.ModuleList([IpAdapterModule(num_attention_heads, attention_head_dim, cross_attention_dim) for _ in range(num_blocks)])
54 self.image_proj = MLPProjModel(cross_attention_dim=cross_attention_dim, id_embeddings_dim=1152, num_tokens=num_tokens)
55 self.set_adapter()
56
57 def set_adapter(self):
58 self.call_block_id = {i:i for i in range(len(self.ipadapter_modules))}

Callers

nothing calls this directly

Calls 4

set_adapterMethod · 0.95
MLPProjModelClass · 0.85
IpAdapterModuleClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected