ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

[enhancement] String Concat Node, String List Node

Open thygrrr opened this issue 1 year ago • 2 comments

It would be extremely helpful to have a node that can concatenate input strings, and also a way to load strings from text files. image This is not the same as putting both of the strings into one conditioning input, so proper string concatenation is something I really seek in stable diffusion GUIs, because it would allow parts of the positive/negative prompts to be stored and re-used easily while editing through various prompts.

Currently, it's always a hodgepodge that encourages endless addendums.

Instead of a comma-separated fluid prompt, splitting this up into a list of strings and then concatenating them in a way that the CLIP conditioning understands it later, would also help remove duplicates, iterate on orders and weights, etc.

thygrrr avatar Mar 17 '23 14:03 thygrrr

While not core, this extension can help in the meantime : https://github.com/m957ymj75urz/ComfyUI-Custom-Nodes/tree/main/clip-text-encode-split (drop the .py file in your custom_nodes folder). This will add 4 nodes : RawText, RawTextCLIPEncode, RawTextCombine and RawTextReplace.

m957ymj75urz avatar Mar 17 '23 14:03 m957ymj75urz

While not core, this extension can help in the meantime : https://github.com/m957ymj75urz/ComfyUI-Custom-Nodes/tree/main/clip-text-encode-split (drop the .py file in your custom_nodes folder). This will add 4 nodes : RawText, RawTextCLIPEncode, RawTextCombine and RawTextReplace.

Was just thinking of adding text input to encoder and merge, replace, random, etc, but looks like you are on to it.

WASasquatch avatar Mar 18 '23 03:03 WASasquatch