comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
58.76k stars 6.23k forks source link

[enhancement] String Concat Node, String List Node #133

Open thygrrr opened 1 year ago

thygrrr commented 1 year ago

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.

m957ymj75urz commented 1 year ago

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.

WASasquatch commented 1 year ago

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.