add batch embeds node

This commit is contained in:
matt3o
2023-12-05 20:26:02 +01:00
parent 66d2f3133b
commit 3e05e86805
+19
View File
@@ -725,6 +725,23 @@ class IPAdapterLoadEmbeds:
return (output, )
class IPAdapterBatchEmbeds:
@classmethod
def INPUT_TYPES(s):
return {"required": {
"embed1": ("EMBEDS",),
"embed2": ("EMBEDS",),
}}
RETURN_TYPES = ("EMBEDS",)
FUNCTION = "batch"
CATEGORY = "ipadapter"
def batch(self, embed1, embed2):
output = torch.cat((embed1, embed2), dim=1)
return (output, )
NODE_CLASS_MAPPINGS = {
"IPAdapterModelLoader": IPAdapterModelLoader,
"IPAdapterApply": IPAdapterApply,
@@ -733,6 +750,7 @@ NODE_CLASS_MAPPINGS = {
"IPAdapterEncoder": IPAdapterEncoder,
"IPAdapterSaveEmbeds": IPAdapterSaveEmbeds,
"IPAdapterLoadEmbeds": IPAdapterLoadEmbeds,
"IPAdapterBatchEmbeds": IPAdapterBatchEmbeds,
}
NODE_DISPLAY_NAME_MAPPINGS = {
@@ -743,4 +761,5 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"IPAdapterEncoder": "Encode IPAdapter Image",
"IPAdapterSaveEmbeds": "Save IPAdapter Embeds",
"IPAdapterLoadEmbeds": "Load IPAdapter Embeds",
"IPAdapterBatchEmbeds": "IPAdapter Batch Embeds",
}