Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions IPAdapterPlus.py
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ def batch(self, embed1, method, embed2=None, embed3=None, embed4=None, embed5=No
elif method == "average":
embeds = torch.mean(embeds, dim=0).unsqueeze(0)
elif method == "norm average":
embeds = torch.mean(embeds / torch.norm(embeds, dim=0, keepdim=True), dim=0).unsqueeze(0)
embeds = torch.mean(embeds / (torch.norm(embeds, dim=0, keepdim=True) + 1e-10), dim=0).unsqueeze(0)
elif method == "max":
embeds = torch.max(embeds, dim=0).values.unsqueeze(0)
elif method == "min":
Expand Down Expand Up @@ -2036,4 +2036,4 @@ def combine(self, params_1, params_2, params_3=None, params_4=None, params_5=Non
"IPAdapterCombineWeights": "IPAdapter Combine Weights",
"IPAdapterRegionalConditioning": "IPAdapter Regional Conditioning",
"IPAdapterCombineParams": "IPAdapter Combine Params",
}
}