(self)
| 17 | |
| 18 | class 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] |
no test coverage detected