mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-09 04:44:30 +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": {
|
||||
"input": (any, {}),
|
||||
},
|
||||
"optional": {
|
||||
"prefix": ("STRING", {"default": ""}),
|
||||
"suffix": ("STRING", {"default": ""}),
|
||||
}
|
||||
}
|
||||
RETURN_TYPES = ("STRING",)
|
||||
FUNCTION = "stringify"
|
||||
CATEGORY = "KJNodes"
|
||||
|
||||
def stringify(self, input):
|
||||
def stringify(self, input, prefix="", suffix=""):
|
||||
if isinstance(input, (int, float, bool)):
|
||||
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:
|
||||
return
|
||||
return (stringified,)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user