Update meyo_node_String.py
This commit is contained in:
+1
-102
@@ -113,55 +113,6 @@ class TextConcatenator:
|
||||
except Exception as e:
|
||||
return (f"Error: {str(e)}",)
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
#======文本拼接
|
||||
class TextConcatenator:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"text1": ("STRING", {"multiline": True, "default": ""}),
|
||||
"text2": ("STRING", {"multiline": True, "default": ""}),
|
||||
"text3": ("STRING", {"multiline": True, "default": ""}),
|
||||
"text4": ("STRING", {"multiline": True, "default": ""}),
|
||||
"combine_order": ("STRING", {"default": ""})
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("STRING",)
|
||||
FUNCTION = "combine_texts"
|
||||
CATEGORY = "Meeeyo/String"
|
||||
DESCRIPTION = "如需更多帮助或商务需求(For tech and business support)+VX/WeChat: meeeyo"
|
||||
|
||||
def combine_texts(self, text1, text2, text3, text4, combine_order):
|
||||
try:
|
||||
text_map = {
|
||||
"1": text1,
|
||||
"2": text2,
|
||||
"3": text3,
|
||||
"4": text4
|
||||
}
|
||||
if not combine_order:
|
||||
combine_order = "1+2+3+4"
|
||||
parts = combine_order.split("+")
|
||||
valid_parts = []
|
||||
for part in parts:
|
||||
if part in text_map:
|
||||
valid_parts.append(part)
|
||||
else:
|
||||
return (f"Error: Invalid input '{part}' in combine_order. Valid options are 1, 2, 3, 4.",)
|
||||
non_empty_texts = [text_map[part] for part in valid_parts if text_map[part]]
|
||||
result = ",".join(non_empty_texts)
|
||||
return (result,)
|
||||
except Exception as e:
|
||||
return (f"Error: {str(e)}",)
|
||||
|
||||
>>>>>>> 5ca49a6a21427c2123b3fa353c9270990af0b82a
|
||||
|
||||
#======多参数输入
|
||||
class MultiParamInputNode:
|
||||
@@ -179,7 +130,6 @@ class MultiParamInputNode:
|
||||
RETURN_TYPES = ("STRING", "STRING", "INT", "INT") # 返回两个字符串和两个整数
|
||||
FUNCTION = "process_inputs"
|
||||
OUTPUT_NODE = False
|
||||
<<<<<<< HEAD
|
||||
CATEGORY = "Meeeyo/String"
|
||||
DESCRIPTION = "如需更多帮助或商务需求(For tech and business support)+VX/WeChat: meeeyo"
|
||||
|
||||
@@ -188,48 +138,6 @@ class MultiParamInputNode:
|
||||
|
||||
def process_inputs(self, text1, text2, int1, int2):
|
||||
return (text1, text2, int1, int2)
|
||||
=======
|
||||
CATEGORY = "Meeeyo/String"
|
||||
DESCRIPTION = "如需更多帮助或商务需求(For tech and business support)+VX/WeChat: meeeyo"
|
||||
|
||||
def IS_CHANGED():
|
||||
return float("NaN")
|
||||
|
||||
def process_inputs(self, text1, text2, int1, int2):
|
||||
return (text1, text2, int1, int2)
|
||||
|
||||
|
||||
#======整数参数
|
||||
class NumberExtractor:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"int1": ("INT", {"default": 0, "min": -1000000, "max": 1000000}), # 第一个整数输入框
|
||||
"int2": ("INT", {"default": 0, "min": -1000000, "max": 1000000}), # 第二个整数输入框
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("INT", "INT") # 返回两个整数
|
||||
FUNCTION = "process_inputs"
|
||||
<<<<<<< HEAD
|
||||
OUTPUT_NODE = False
|
||||
CATEGORY = "Meeeyo/String"
|
||||
DESCRIPTION = "如需更多帮助或商务需求(For tech and business support)+VX/WeChat: meeeyo"
|
||||
|
||||
def IS_CHANGED():
|
||||
return float("NaN")
|
||||
|
||||
=======
|
||||
CATEGORY = "Meeeyo/String"
|
||||
DESCRIPTION = "如需更多帮助或商务需求(For tech and business support)+VX/WeChat: meeeyo"
|
||||
OUTPUT_NODE = False
|
||||
|
||||
>>>>>>> b7ed81e9e5c54e5f2fa5775e72a7718ed2b72f70
|
||||
def process_inputs(self, int1, int2):
|
||||
return (int1, int2)
|
||||
|
||||
>>>>>>> 5ca49a6a21427c2123b3fa353c9270990af0b82a
|
||||
|
||||
|
||||
#======整数参数
|
||||
@@ -1452,18 +1360,9 @@ class GenerateVideoPrompt:
|
||||
CATEGORY = "Meeeyo/String"
|
||||
DESCRIPTION = "如需更多帮助或商务需求(For tech and business support)+VX/WeChat: meeeyo"
|
||||
|
||||
<<<<<<< HEAD
|
||||
def IS_CHANGED():
|
||||
return float("NaN")
|
||||
|
||||
=======
|
||||
<<<<<<< HEAD
|
||||
def IS_CHANGED():
|
||||
return float("NaN")
|
||||
|
||||
=======
|
||||
>>>>>>> b7ed81e9e5c54e5f2fa5775e72a7718ed2b72f70
|
||||
>>>>>>> 5ca49a6a21427c2123b3fa353c9270990af0b82a
|
||||
def generate_prompt(self, input_text, mode):
|
||||
try:
|
||||
if mode == "原文本":
|
||||
@@ -1535,4 +1434,4 @@ The following is the main content of mine:
|
||||
return ("",)
|
||||
|
||||
except Exception as e:
|
||||
return (f"Error: {str(e)}",)
|
||||
return (f"Error: {str(e)}",)
|
||||
|
||||
Reference in New Issue
Block a user