Skip to content

Conversation

@LaVie024
Copy link
Contributor

#7952 was quite an interesting PR for just adding some functionalities to strings that should be in default Comfy. Curiously however, there was not a single line added pertaining to a multiline string node, which comfy lacks.

The following behaves identically to the current string primitive, with one main difference: being multiline. It's easier for larger amounts of text to be handled, and shouldn't be too big of an addition elsewise.
2025-05-13_23-37

Add multiline string node
@christian-byrne
Copy link
Collaborator

Would this also work?

class StringMultiline(ComfyNodeABC):
@classmethod
def INPUT_TYPES(cls) -> InputTypeDict:
return {
"required": {"value": (IO.STRING, {"multiline": True,},)},
}
RETURN_TYPES = (IO.STRING,)
FUNCTION = "execute"
CATEGORY = "utils/primitive"
def execute(self, value: str) -> tuple[str]:
return (value,)

I believe it was added in sneakily as part of a very large, recent PR, so you might not have it on your local version yet.

@LaVie024
Copy link
Contributor Author

Would this also work?

class StringMultiline(ComfyNodeABC):
@classmethod
def INPUT_TYPES(cls) -> InputTypeDict:
return {
"required": {"value": (IO.STRING, {"multiline": True,},)},
}
RETURN_TYPES = (IO.STRING,)
FUNCTION = "execute"
CATEGORY = "utils/primitive"
def execute(self, value: str) -> tuple[str]:
return (value,)

I believe it was added in sneakily as part of a very large, recent PR, so you might not have it on your local version yet.

Ah, guess I didn't see it. I'll git pull then, thanks.

@LaVie024 LaVie024 closed this May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants