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

Method forward

diffsynth/models/sd_ipadapter.py:34–48  ·  view source on GitHub ↗
(self, hidden_states, scale=1.0)

Source from the content-addressed store, hash-verified

32 self.set_full_adapter()
33
34 def forward(self, hidden_states, scale=1.0):
35 hidden_states = self.image_proj(hidden_states)
36 hidden_states = hidden_states.view(1, -1, hidden_states.shape[-1])
37 ip_kv_dict = {}
38 for (block_id, transformer_id) in self.call_block_id:
39 ipadapter_id = self.call_block_id[(block_id, transformer_id)]
40 ip_k, ip_v = self.ipadapter_modules[ipadapter_id](hidden_states)
41 if block_id not in ip_kv_dict:
42 ip_kv_dict[block_id] = {}
43 ip_kv_dict[block_id][transformer_id] = {
44 "ip_k": ip_k,
45 "ip_v": ip_v,
46 "scale": scale
47 }
48 return ip_kv_dict
49
50 @staticmethod
51 def state_dict_converter():

Callers 1

forwardMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected