diff --git a/more_math/AudioMathNode.py b/more_math/AudioMathNode.py index ef3d1ba..35756af 100644 --- a/more_math/AudioMathNode.py +++ b/more_math/AudioMathNode.py @@ -48,7 +48,7 @@ class AudioMathNode(io.ComfyNode): ) @classmethod def check_lazy_status(cls, AudioExpr, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0): - return comonLazy(AudioExpr, a, b, c, d) + return comonLazy(AudioExpr, a, b, c, d,w,x,y,z) @classmethod def execute(cls, a, AudioExpr, b=None, c=None, d=None, w=0.0, x=0.0, y=0.0, z=0.0): diff --git a/more_math/ClipMathNode.py b/more_math/ClipMathNode.py index a5bde56..4956e80 100644 --- a/more_math/ClipMathNode.py +++ b/more_math/ClipMathNode.py @@ -32,7 +32,7 @@ class CLIPMathNode(io.ComfyNode): tooltip = cleandoc(__doc__) @classmethod def check_lazy_status(cls, Model, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0): - return comonLazy(Model, a, b, c, d) + return comonLazy(Model, a, b, c, d,w,x,y,z) @classmethod def execute(cls, Model, a, b=None, c=None, d=None, w=0.0, x=0.0, y=0.0, z=0.0) -> io.NodeOutput: diff --git a/more_math/FloatMathNode.py b/more_math/FloatMathNode.py index 4ee1e5f..11d4383 100644 --- a/more_math/FloatMathNode.py +++ b/more_math/FloatMathNode.py @@ -26,9 +26,9 @@ class FloatMathNode(io.ComfyNode): """ def __init__(self): pass - @classmethod + @classmethod def check_lazy_status(cls, Model, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0): - return comonLazy(Model, a, b, c, d) + return comonLazy(Model, a, b, c, d,w,x,y,z) @classmethod def define_schema(cls) -> io.Schema: """ diff --git a/more_math/ImageMathNode.py b/more_math/ImageMathNode.py index 53e79e0..c1e0096 100644 --- a/more_math/ImageMathNode.py +++ b/more_math/ImageMathNode.py @@ -53,7 +53,7 @@ class ImageMathNode(io.ComfyNode): ) @classmethod def check_lazy_status(cls, Image, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0): - return comonLazy(Image, a, b, c, d) + return comonLazy(Image, a, b, c, d,w,x,y,z) @classmethod def execute(scls, Image, a, b=None, c=None, d=None, w=0.0, x=0.0, y=0.0, z=0.0): b = torch.zeros_like(a) if b is None else b diff --git a/more_math/LatentMathNode.py b/more_math/LatentMathNode.py index e714149..cba526a 100644 --- a/more_math/LatentMathNode.py +++ b/more_math/LatentMathNode.py @@ -68,7 +68,7 @@ class LatentMathNode(io.ComfyNode): #OUTPUT_TOOLTIPS = ("",) # Tooltips for the output node @classmethod def check_lazy_status(cls, Latent, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0): - return comonLazy(Latent, a, b, c, d) + return comonLazy(Latent, a, b, c, d,w,x,y,z) @classmethod def execute(cls, Latent, a, b=None, c=None, d=None, w=0.0, x=0.0, y=0.0, z=0.0) -> io.NodeOutput: # Extract raw sample tensors (may be Tensor or NestedTensor) diff --git a/more_math/ModelMathNode.py b/more_math/ModelMathNode.py index 6260680..15054ca 100644 --- a/more_math/ModelMathNode.py +++ b/more_math/ModelMathNode.py @@ -36,7 +36,7 @@ class ModelMathNode(io.ComfyNode): @classmethod def check_lazy_status(cls, Model, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0): - return comonLazy(Model, a, b, c, d) + return comonLazy(Model, a, b, c, d,w,x,y,z) @classmethod def execute(cls, Model, a, b=None, c=None, d=None, w=0.0, x=0.0, y=0.0, z=0.0) -> io.NodeOutput: diff --git a/more_math/NoiseMathNode.py b/more_math/NoiseMathNode.py index 841b36d..d2856d2 100644 --- a/more_math/NoiseMathNode.py +++ b/more_math/NoiseMathNode.py @@ -64,7 +64,7 @@ class NoiseMathNode(io.ComfyNode): CATEGORY = "More math" @classmethod def check_lazy_status(cls, Noise, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0): - return comonLazy(Noise, a, b, c, d) + return comonLazy(Noise, a, b, c, d,w,x,y,z) @classmethod def execute(cls, Noise, a, b=None, c=None, d=None, w=0.0, x=0.0, y=0.0, z=0.0): return (NoiseExecutor(a, b, c, d, w, x, y, z, Noise),) diff --git a/more_math/VaeMathNode.py b/more_math/VaeMathNode.py index 450439e..eaa5808 100644 --- a/more_math/VaeMathNode.py +++ b/more_math/VaeMathNode.py @@ -33,7 +33,7 @@ class VAEMathNode(io.ComfyNode): tooltip = cleandoc(__doc__) @classmethod def check_lazy_status(cls, Model, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0): - return comonLazy(Model, a, b, c, d) + return comonLazy(Model, a, b, c, d,w,x,y,z) @classmethod def execute(cls, Model, a, b=None, c=None, d=None, w=0.0, x=0.0, y=0.0, z=0.0) -> io.NodeOutput: patcher_a = a.patcher diff --git a/more_math/helper_functions.py b/more_math/helper_functions.py index 16b1fb8..87827cb 100644 --- a/more_math/helper_functions.py +++ b/more_math/helper_functions.py @@ -40,10 +40,18 @@ class ThrowingErrorListener(ErrorListener): def comonLazy(expr, a, b=None, c=None, d=None, w=0.0, x=0.0, y=0.0, z=0.0): variables = {'a':a,'b':b,'c':c,'d':d,'w':w,'x':x,'y':y,'z':z} need_eval = [] + print(a,b,c,d,w,x,y,z) input_stream = InputStream(expr) + lexer = MathExprLexer(input_stream) stream = CommonTokenStream(lexer) + stream.fill() + print("Tokens:", stream.tokens) for token in filter(lambda t: t.type == MathExprParser.VARIABLE, stream.tokens): - if token in variables and variables[token] is None: - need_eval.append(token) + print("Token:", token.text) + print("Variables:", variables) + print("Token in variables:", token.text in variables) + print("Variable is None:", variables.get(token.text) is None) + if token.text in variables and variables[token.text] is None: + need_eval.append(token.text) print ("Need eval:", need_eval) \ No newline at end of file