-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathIFJoinTextNode.py
65 lines (58 loc) · 2.04 KB
/
IFJoinTextNode.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
class IFJoinText:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"separator": ("STRING", {
"multiline": False,
"default": " ",
"placeholder": "Text to insert between joined strings"
}),
},
"optional": {
"text1": ("STRING", {
"multiline": False,
"default": "",
"forceInput": True,
"placeholder": "First text input"
}),
"text2": ("STRING", {
"multiline": False,
"default": "",
"forceInput": True,
"placeholder": "Second text input"
}),
"text3": ("STRING", {
"multiline": False,
"default": "",
"forceInput": True,
"placeholder": "Third text input"
}),
"text4": ("STRING", {
"multiline": False,
"default": "",
"forceInput": True,
"placeholder": "Fourth text input"
}),
},
}
RETURN_TYPES = ("STRING",)
FUNCTION = "join_text"
CATEGORY = "ImpactFrames💥🎞️/IF_tools"
def join_text(self, separator=" ", text1="", text2="", text3="", text4=""):
# Collect all non-empty text inputs
texts = [t for t in [text1, text2, text3, text4] if t.strip()]
# Join texts with separator
result = separator.join(texts)
# Print for debugging
print("==================")
print("IF_JoinText output:")
print("==================")
print(result)
return (result,)
NODE_CLASS_MAPPINGS = {
"IF_JoinText": IFJoinText
}
NODE_DISPLAY_NAME_MAPPINGS = {
"IF_JoinText": "IF Join Text📝"
}