diff --git a/more_math/ConditioningMathNode.py b/more_math/ConditioningMathNode.py index 601d708..db752c7 100644 --- a/more_math/ConditioningMathNode.py +++ b/more_math/ConditioningMathNode.py @@ -7,6 +7,7 @@ from antlr4 import InputStream, CommonTokenStream from .Parser.MathExprLexer import MathExprLexer from .Parser.MathExprParser import MathExprParser import re +import copy class ConditioningMathNode(io.ComfyNode): """ @@ -177,24 +178,30 @@ class ConditioningMathNode(io.ComfyNode): rtensor = torch.zeros([1]) if rpooled is None: rpooled = torch.zeros([1]) - if(batching>0): - res = torch.split(rtensor,batching) if batching>0 else [rtensor] - rpld = torch.split(rpooled,batching) if batching>0 else [rpooled] + + # batching = size of each chunk -> use torch.split(tensor, batching, dim=0) + if batching and batching > 0: + rt_chunks = torch.split(rtensor, batching, dim=0) + rp_chunks = torch.split(rpooled, batching, dim=0) res_list = [] - for i in range(max(len(res),len(rpld))): - result_tensor = res[i] if i