blib-la / blibla-comfyui-extensions

Extensions for ComfyUI
GNU Affero General Public License v3.0
138 stars 11 forks source link

Color Title only #27

Open PrometheusDante opened 2 weeks ago

PrometheusDante commented 2 weeks ago

Hello there, I'm a huge fan of customization and thus of your work, so thank you already! I am a workflow creator on civitai with a passion for structure and every now and again some update breaks my theme and color settings somewhat.

My issue is that custom coloring a node colors title as well as background of the node, which is a problem when a strong color would look good on the title bar, but at the same time obnoxious for a text box. Whereas selecting a subtle color to work with looks obnoxiously bland on the title. irrefutable_evidence

It'd be amazing if you could add the option to only color the title while leaving the bgcolor as is, or a little choice menu like: example

My current workaround is using pythongossss' Widget & Property Defaults: to force a specific bgcolor for a node, so I can choose whichever color I like in the dropdown menu "Colors/Custom" and by alt-duplicating the node get the bgcolor reset while keeping the bright title. That's a whole lot of tedium for a task so simple :D

Thank you very much for your time and considering the feature!

pixelass commented 2 weeks ago

Hi, and thank you for using our extensions. AFAIK it is not possible to apply color to the title only as the underlying library (Litegraph) does not offer an API for that. I will have to check though, so, I'm keeping this open until I can either implement it or confirm this as a limitation given by the library.

PrometheusDante commented 2 weeks ago

I have found a way through some crude hacky change in the colors.js file Those are the only edits I made and it works fine. I did not look into the rainbow gradient functions and such as I only use the basic manual custom coloring usually.

colors_js_edits

Copying the entire function and mirroring the change I made to only affect the bgcolor would probably work. Only thing left would be to add that to the context menu.

PrometheusDante commented 1 week ago

Alright, I've done some more amateurish hackery, but I got it working.

example_node example_group

• Group coloring is still a bit weird since the group color seems to work the same as a node's title bar color, but a group has no separate background, so the "Color All BG" group option does not affect the group's color, whereas the other options do.

• Selecting multiple nodes and simply coloring all at once would be a very nice feature, too. For now I'm bulk coloring nodes by dragging them off into a group to color them at once that way and put them back where they belong afterwards :D

• I did not however fiddle around with the rainbowify stuff and auto-coloring, so that might behave weirdly.

• The changes I posted above are pretty much what I did again, with the addition of copy-pasting the respective blocks and renaming the labels.

This is the edited colors.js file, found in ComfyUI\custom_nodes\failfast-comfyui-extensions\extensions\ colors.js.zip

Please look into it to see if there's anything I've done wrong. It works perfectly fine on my end and I use it a lot.

For anyone reading and considering trying this. Please make sure to back up your original colors.js file in case of weird behaviour caused by modifications.

pixelass commented 3 days ago

@PrometheusDante If you feel comfortable, feel free to open a Pull Request for this.

PrometheusDante commented 3 days ago

Alright, I've checked again and nothing is affected negatively. Rainbow, plain and type options still behave exactly the same and I've not found any potential pitfalls. This is my first pull request ever and I hope I'm doing it right. I forked your repository, edited the colors.js directly on the page by copy/pasting my local changes into it and it looks alright. Also tried to replicate your indent style etc. so it wouldn't show up all red.