MCPcopy
hub / github.com/cubiq/ComfyUI_InstantID / get_image_embeds

Method get_image_embeds

InstantID.py:87–93  ·  view source on GitHub ↗
(self, clip_embed, clip_embed_zeroed)

Source from the content-addressed store, hash-verified

85
86 @torch.inference_mode()
87 def get_image_embeds(self, clip_embed, clip_embed_zeroed):
88 #image_prompt_embeds = clip_embed.clone().detach()
89 image_prompt_embeds = self.image_proj_model(clip_embed)
90 #uncond_image_prompt_embeds = clip_embed_zeroed.clone().detach()
91 uncond_image_prompt_embeds = self.image_proj_model(clip_embed_zeroed)
92
93 return image_prompt_embeds, uncond_image_prompt_embeds
94
95class ImageProjModel(torch.nn.Module):
96 def __init__(self, cross_attention_dim=1024, clip_embeddings_dim=1024, clip_extra_context_tokens=4):

Callers 2

apply_instantidMethod · 0.80
patch_attentionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected