String nodes with multiline true seem to modify the actual string
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 155
Description
Hello, when trying to use any node with a multiline string, it seems to mutate the actual string, specifically for my case, it is stripping out the curly braces.
# Background:
I'm trying to setup a node that takes in some headers. Headers have the JSON format ie: {"foo": "bar"}
If I use a primitive (or Simple String from Use Everywhere, the output is as expected: {"foo": "bar"}
I want to the node to display a bigger text, in a way that is readable to go through and edit the potentially long json string, so I think using string with multiline will be better suited. But if I try to use a node that has the multiline set to true, it seems to strip out all the curly braces, which results in the following: "foo": "bar"
This is rather odd as a string is a string, no need to modify it in any way. I tried multiple custom nodes, even set one up myself, thinking they were changing the format, but it turns out it must be ComfyUI, since the code is simply returning the string, and not doing anything to it:
```
class SimpleStringBox(Base):
OUTPUT_NODE = False
@classmethod
def INPUT_TYPES(s):
return {"required":{ "string": ("STRING", {"default": "",
"multiline": True
}) }}
RETURN_TYPES = ("STRING",)
def func(self,string):
return (string,)
```
See the following setup:

# Solution
I would like to see the multiline: true string output exactly as is, such as when the option is set to false.
# Reproduction
To be absolutely sure, I made the following:
```
class SimpleStringBoxTrue(Base):
OUTPUT_NODE = False
@classmethod
def INPUT_TYPES(s):
return {"required":{ "string": ("STRING", {"default": "",
"multiline": True
}) }}
RETURN_TYPES = ("STRING",)
def func(self,string):
return (string,)
class SimpleStringBoxFalse(Base):
OUTPUT_NODE = False
@classmethod
def INPUT_TYPES(s):
return {"required":{ "string": ("STRING", {"default": "",
"multiline": False
}) }}
RETURN_TYPES = ("STRING",)
def func(self,string):
return (string,)
# A dictionary that contains all nodes you want to export with their names
# NOTE: names should be globally unique
NODE_CLASS_MAPPINGS = {
"SimpleStringBoxTrue": SimpleStringBoxTrue,
"SimpleStringBoxFalse": SimpleStringBoxFalse
}
# A dictionary that contains the friendly/humanly readable titles for the nodes
NODE_DISPLAY_NAME_MAPPINGS = {
"SimpleStringBoxTrue": "Simple String Multiline Box",
"SimpleStringBoxFalse": "Simple String Multiline Box",
}
```
And got the same result:

Thank you.
Contributor guide
Assessment
This issue has not been assessed yet.