Fix StringListJoin treating sep as a list

StringListJoin has no INPUT_IS_LIST, so sep is a plain string;
sep[0] was taking only the first character.
This commit is contained in:
Comahar
2026-07-16 17:38:09 +03:00
parent fd37841b70
commit 9d87b8ecf6
2 changed files with 4 additions and 5 deletions
+1 -2
View File
@@ -752,8 +752,7 @@ class StringListJoin(ComfyNodeABC):
FUNCTION = "join"
def join(self, sep, strings):
separator = sep[0] # everything comes as a list, so sep is list[str]
return (separator.join(strings),)
return (sep.join(strings),)
class StringLjust(ComfyNodeABC):
+3 -3
View File
@@ -226,9 +226,9 @@ def test_join():
# Test ListJoin variant
node_list = StringListJoin()
assert node_list.join([", "], ["apple", "banana", "cherry"]) == ("apple, banana, cherry",)
assert node_list.join([""], ["a", "b", "c"]) == ("abc",)
assert node_list.join(["-"], []) == ("",) # Empty list
assert node_list.join(", ", ["apple", "banana", "cherry"]) == ("apple, banana, cherry",)
assert node_list.join("", ["a", "b", "c"]) == ("abc",)
assert node_list.join("-", []) == ("",) # Empty list
def test_ljust():
node = StringLjust()