mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-24 12:14:35 +08:00
Merge branch 'main' of https://github.com/kijai/ComfyUI-KJNodes
This commit is contained in:
commit
057a9b968a
11
nodes.py
11
nodes.py
@ -1185,15 +1185,22 @@ class SomethingToString:
|
|||||||
"required": {
|
"required": {
|
||||||
"input": (any, {}),
|
"input": (any, {}),
|
||||||
},
|
},
|
||||||
|
"optional": {
|
||||||
|
"prefix": ("STRING", {"default": ""}),
|
||||||
|
"suffix": ("STRING", {"default": ""}),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
RETURN_TYPES = ("STRING",)
|
RETURN_TYPES = ("STRING",)
|
||||||
FUNCTION = "stringify"
|
FUNCTION = "stringify"
|
||||||
CATEGORY = "KJNodes"
|
CATEGORY = "KJNodes"
|
||||||
|
|
||||||
def stringify(self, input):
|
def stringify(self, input, prefix="", suffix=""):
|
||||||
if isinstance(input, (int, float, bool)):
|
if isinstance(input, (int, float, bool)):
|
||||||
stringified = str(input)
|
stringified = str(input)
|
||||||
print(stringified)
|
if prefix: # Check if prefix is not empty
|
||||||
|
stringified = prefix + stringified # Add the prefix
|
||||||
|
if suffix: # Check if suffix is not empty
|
||||||
|
stringified = stringified + suffix # Add the suffix
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
return (stringified,)
|
return (stringified,)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user