ComfyUI
ComfyUI copied to clipboard
Can't use multiple text inputs
If I set something up like:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"text": ("STRING", {"multiline": True}),
"key": ("STRING", {"multiline": False}),
"clip": ("CLIP",),
}
}
Only one text area will show. I want to add a new text field to a search key, additionally I have a couple other nodes in the works that will require quite a few text inputs.
I found that for some reason, non-multiline strings need to come before multiline strings, for some reason.
Edit: but it appears the values are swapped for some reason, and then ComfyUI also puts the default prompt into the key field instead of the text field. Maybe values content should target a field by name.
Edit 2: Well, seems first part holds true, multiline must come last, but the second edit seems to pertain to ComfyUI reloading the workspace and it just not knowing where to put stuff with the addition of a new field. Hopefully.
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"key": ("STRING", {"multiline": False}),
"text": ("STRING", {"multiline": True}),
"clip": ("CLIP",),
}
}
Those multiline inputs are something I added in a hackish way so the CLIPTextEncode would actually be usable. It can only be used as the last node input and you can't use two of them on the same node.
Fair enough. Probably better the short fields come before the long bracket of text anyway from a UI standpoint.
Is there any way to output text back to the node? Display what was parsed?
You can use multiple multiline text inputs on the same node now so this is fixed.
Awesome. I'll close this.