Remove loras for now, there seems to be a memory leak and idk how to fix it

Remove allowed strings, they don't seem very useful
This commit is contained in:
Zuellni
2023-10-27 15:51:15 +02:00
parent 2b3ddde76b
commit dcaade09c2
3 changed files with 24 additions and 177 deletions
-50
View File
@@ -1,51 +1,3 @@
from comfy.model_management import InterruptProcessingException
class Condition:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"a": ("STRING", {"forceInput": True}),
"condition": (["==", "!=", ">", ">=", "<", "<=", "in", "sw", "ew"],),
"b": ("STRING", {"default": ""}),
},
"optional": {
"text": ("STRING", {"forceInput": True, "multiline": True}),
},
}
CATEGORY = "Zuellni/Text"
FUNCTION = "condition"
OUTPUT_Node = True
RETURN_NAMES = ("TEXT",)
RETURN_TYPES = ("STRING",)
def condition(self, a, condition, b, text=None):
try:
a = float(a)
b = float(b)
except:
pass
conditions = {
"==": lambda: a == b,
"!=": lambda: a != b,
">": lambda: a > b,
">=": lambda: a >= b,
"<": lambda: a < b,
"<=": lambda: a <= b,
"in": lambda: str(a) in str(b),
"sw": lambda: str(a).startswith(str(b)),
"ew": lambda: str(a).endswith(str(b)),
}
if not conditions[condition]():
raise InterruptProcessingException()
return (text,)
class Format:
@classmethod
def INPUT_TYPES(cls):
@@ -89,13 +41,11 @@ class Preview:
NODE_CLASS_MAPPINGS = {
"ZuellniTextCondition": Condition,
"ZuellniTextFormat": Format,
"ZuellniTextPreview": Preview,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"ZuellniTextCondition": "Condition",
"ZuellniTextFormat": "Format",
"ZuellniTextPreview": "Preview",
}