Skip to content

Commit 1843ee3

Browse files
committed
attempt to fix lazy inputs
1 parent 3a55fbe commit 1843ee3

File tree

9 files changed

+19
-11
lines changed

9 files changed

+19
-11
lines changed

more_math/AudioMathNode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def define_schema(cls) -> io.Schema:
4848
)
4949
@classmethod
5050
def check_lazy_status(cls, AudioExpr, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0):
51-
return comonLazy(AudioExpr, a, b, c, d)
51+
return comonLazy(AudioExpr, a, b, c, d,w,x,y,z)
5252
@classmethod
5353
def execute(cls, a, AudioExpr, b=None, c=None, d=None, w=0.0, x=0.0, y=0.0, z=0.0):
5454

more_math/ClipMathNode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def define_schema(cls) -> io.Schema:
3232
tooltip = cleandoc(__doc__)
3333
@classmethod
3434
def check_lazy_status(cls, Model, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0):
35-
return comonLazy(Model, a, b, c, d)
35+
return comonLazy(Model, a, b, c, d,w,x,y,z)
3636

3737
@classmethod
3838
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:

more_math/FloatMathNode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class FloatMathNode(io.ComfyNode):
2626
"""
2727
def __init__(self):
2828
pass
29-
@classmethod
29+
@classmethod
3030
def check_lazy_status(cls, Model, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0):
31-
return comonLazy(Model, a, b, c, d)
31+
return comonLazy(Model, a, b, c, d,w,x,y,z)
3232
@classmethod
3333
def define_schema(cls) -> io.Schema:
3434
"""

more_math/ImageMathNode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def define_schema(cls) -> io.Schema:
5353
)
5454
@classmethod
5555
def check_lazy_status(cls, Image, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0):
56-
return comonLazy(Image, a, b, c, d)
56+
return comonLazy(Image, a, b, c, d,w,x,y,z)
5757
@classmethod
5858
def execute(scls, Image, a, b=None, c=None, d=None, w=0.0, x=0.0, y=0.0, z=0.0):
5959
b = torch.zeros_like(a) if b is None else b

more_math/LatentMathNode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def define_schema(cls) -> io.Schema:
6868
#OUTPUT_TOOLTIPS = ("",) # Tooltips for the output node
6969
@classmethod
7070
def check_lazy_status(cls, Latent, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0):
71-
return comonLazy(Latent, a, b, c, d)
71+
return comonLazy(Latent, a, b, c, d,w,x,y,z)
7272
@classmethod
7373
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:
7474
# Extract raw sample tensors (may be Tensor or NestedTensor)

more_math/ModelMathNode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def define_schema(cls) -> io.Schema:
3636

3737
@classmethod
3838
def check_lazy_status(cls, Model, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0):
39-
return comonLazy(Model, a, b, c, d)
39+
return comonLazy(Model, a, b, c, d,w,x,y,z)
4040

4141
@classmethod
4242
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:

more_math/NoiseMathNode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def define_schema(cls) -> io.Schema:
6464
CATEGORY = "More math"
6565
@classmethod
6666
def check_lazy_status(cls, Noise, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0):
67-
return comonLazy(Noise, a, b, c, d)
67+
return comonLazy(Noise, a, b, c, d,w,x,y,z)
6868
@classmethod
6969
def execute(cls, Noise, a, b=None, c=None, d=None, w=0.0, x=0.0, y=0.0, z=0.0):
7070
return (NoiseExecutor(a, b, c, d, w, x, y, z, Noise),)

more_math/VaeMathNode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def define_schema(cls) -> io.Schema:
3333
tooltip = cleandoc(__doc__)
3434
@classmethod
3535
def check_lazy_status(cls, Model, a, b=[], c=[], d=[],w=0,x=0,y=0,z=0):
36-
return comonLazy(Model, a, b, c, d)
36+
return comonLazy(Model, a, b, c, d,w,x,y,z)
3737
@classmethod
3838
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:
3939
patcher_a = a.patcher

more_math/helper_functions.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,18 @@ def syntaxError(self, recognizer, offendingSymbol, line, column, msg, e):
4040
def comonLazy(expr, a, b=None, c=None, d=None, w=0.0, x=0.0, y=0.0, z=0.0):
4141
variables = {'a':a,'b':b,'c':c,'d':d,'w':w,'x':x,'y':y,'z':z}
4242
need_eval = []
43+
print(a,b,c,d,w,x,y,z)
4344
input_stream = InputStream(expr)
45+
4446
lexer = MathExprLexer(input_stream)
4547
stream = CommonTokenStream(lexer)
48+
stream.fill()
49+
print("Tokens:", stream.tokens)
4650
for token in filter(lambda t: t.type == MathExprParser.VARIABLE, stream.tokens):
47-
if token in variables and variables[token] is None:
48-
need_eval.append(token)
51+
print("Token:", token.text)
52+
print("Variables:", variables)
53+
print("Token in variables:", token.text in variables)
54+
print("Variable is None:", variables.get(token.text) is None)
55+
if token.text in variables and variables[token.text] is None:
56+
need_eval.append(token.text)
4957
print ("Need eval:", need_eval)

0 commit comments

Comments
 (0)