Skip to content

Commit ca49c09

Browse files
committed
change IntAndIntAddOffsetLiteral node to FloatMultipleAddLiteral.
1 parent 7cc3cf0 commit ca49c09

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

py/nodes.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -884,43 +884,43 @@ def select_mask(self, mask_prior=None, mask_alternative=None, mask_third=None):
884884
return (mask,)
885885

886886

887-
class IntAndIntAddOffsetLiteral:
888-
RETURN_TYPES = ("INT", "INT",)
889-
RETURN_NAMES = ("int", "int add offset")
890-
FUNCTION = "get_int"
887+
class FloatMultipleAddLiteral:
888+
RETURN_TYPES = ("FLOAT", "FLOAT", "INT")
889+
RETURN_NAMES = ("x", "ax + b", "ax + b(int)")
890+
FUNCTION = "get_float"
891891
CATEGORY = "utils/numbers"
892892

893893
@classmethod
894894
def INPUT_TYPES(cls):
895-
return {"required": {"number": ("INT", {"default": 0, "min": 0, "max": 1000000})},
896-
"optional": {"offset": ("INT", {"default": 1, "step": 1}), }
895+
return {"required": {"number": ("FLOAT", {"default": 0, "min": 0, "max": 1000000})},
896+
"optional": {"a_aign": (["positive", "negative"], {"default": "positive"}),
897+
"a": ("FLOAT", {"default": 1.0, "step": 0.001}), "b": ("FLOAT", {"default": 1, "step": 0.001}),
898+
}
897899
}
898900

899-
def get_int(self, number, offset):
900-
if number == 0:
901-
return (0, 0)
902-
return (number, number + offset)
903-
901+
def get_float(self, number, a, b, a_aign):
902+
if a_aign == "negative":
903+
a = - a
904+
return (number, a*number + b, int(a*number + b))
904905

905906
class IntMultipleAddLiteral:
906-
RETURN_TYPES = ("INT", "INT",)
907-
RETURN_NAMES = ("x", "ax + b")
907+
RETURN_TYPES = ("INT", "INT", "FLOAT")
908+
RETURN_NAMES = ("x", "ax + b", "ax + b(float)")
908909
FUNCTION = "get_int"
909910
CATEGORY = "utils/numbers"
910911

911912
@classmethod
912913
def INPUT_TYPES(cls):
913914
return {"required": {"number": ("INT", {"default": 0, "min": 0, "max": 1000000})},
914915
"optional": {"a_aign": (["positive", "negative"], {"default": "positive"}),
915-
"a": ("FLOAT", {"default": 1.0, "step": 0.05}), "b": ("INT", {"default": 1, "step": 1}),
916+
"a": ("FLOAT", {"default": 1.0, "step": 0.001}), "b": ("INT", {"default": 1, "step": 1}),
916917
}
917918
}
918919

919920
def get_int(self, number, a, b, a_aign):
920921
if a_aign == "negative":
921922
a = - a
922-
return (number, int(a*number + b))
923-
923+
return (number, int(a*number + b), a*number + b)
924924

925925
MAX_RESOLUTION = 16384
926926

@@ -1430,7 +1430,7 @@ def fun(boolean_input, true_text, true_float, true_int, false_text, false_float,
14301430

14311431
# numbers
14321432
"MatchImageRatioToPreset": MatchImageRatioToPreset,
1433-
"IntAndIntAddOffsetLiteral": IntAndIntAddOffsetLiteral,
1433+
"FloatMultipleAddLiteral": FloatMultipleAddLiteral,
14341434
"IntMultipleAddLiteral": IntMultipleAddLiteral,
14351435

14361436
# mask
@@ -1470,7 +1470,7 @@ def fun(boolean_input, true_text, true_float, true_int, false_text, false_float,
14701470

14711471
# Number
14721472
"MatchImageRatioToPreset": "Match Image Ratio to Standard Size",
1473-
"IntAndIntAddOffsetLiteral": "Int And Int Add Offset Literal",
1473+
"FloatMultipleAddLiteral": "Float Multiple and Add Literal",
14741474
"IntMultipleAddLiteral": "Int Multiple and Add Literal",
14751475

14761476
# Mask

0 commit comments

Comments
 (0)