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

Method __init__

diffsynth/models/sd_ipadapter.py:19–24  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

17
18class SDIpAdapter(torch.nn.Module):
19 def __init__(self):
20 super().__init__()
21 shape_list = [(768, 320)] * 2 + [(768, 640)] * 2 + [(768, 1280)] * 5 + [(768, 640)] * 3 + [(768, 320)] * 3 + [(768, 1280)] * 1
22 self.ipadapter_modules = torch.nn.ModuleList([IpAdapterModule(*shape) for shape in shape_list])
23 self.image_proj = IpAdapterImageProjModel(cross_attention_dim=768, clip_embeddings_dim=1024, clip_extra_context_tokens=4)
24 self.set_full_adapter()
25
26 def set_full_adapter(self):
27 block_ids = [1, 4, 9, 12, 17, 20, 40, 43, 46, 50, 53, 56, 60, 63, 66, 29]

Callers 1

__init__Method · 0.45

Calls 3

set_full_adapterMethod · 0.95
IpAdapterModuleClass · 0.70

Tested by

no test coverage detected