blibla-comfyui-extensions icon indicating copy to clipboard operation
blibla-comfyui-extensions copied to clipboard

Allow list of autocolor values to be built from a CSV or text list

Open aegis72 opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. It isn't a problem, persay, but a function that could make the colors extension more powerful.

currently, the inclusion of auto-coloring for positive and negative works well and is very welcome.:

function colorPositiveNegative(app) {
  app.graph._nodes.forEach((node) => {
    // const onPropertyChanged = node.onPropertyChanged;
    // node.onPropertyChanged = function () {};
    if (node.title.toLowerCase().includes("positive")) {
      const bgcolor = hslToHex(120 / 360, 0.4, 0.3);
      node.bgcolor = bgcolor;
      node.color = shadeHexColor(node.bgcolor);
    } else if (node.title.toLowerCase().includes("negative")) {
      const bgcolor = hslToHex(0, 0.4, 0.3);
      node.bgcolor = bgcolor;
      node.color = shadeHexColor(node.bgcolor);
    }
    node.setDirtyCanvas(true, true);
  });
}

But is hard-coded and so adding new color rules isn't possible other than by extending the js file manually, which would make me out of sync with the original branch and require folks to get a special fork of colors.js.

One, it would be great to be able to style all nodes with a similar function exactly the same value. Two, i've recently started making HEAVY use of ChrisGoringe's "UE Nodes," which have an execution limiter based on node color.

By having the ability to title names with special regex keywords (.*sender.*/.*receiver.*/.*fromFX.*/.*fromIterate.* etc) I could improve the workflow's consistency and add a new way to limit what nodes are affected by UE node sends.

Describe the solution you'd like modify the code above in some fashion where it takes a regex value from column A of a supplied CSV or a text based dictionary based on line breaks (using [nodetitle],[rgb values format] ) and applies that color to all nodes with titles matching that regex. Example of how that would work in action (faked here; I've manually set the "toFx" and "fromFx" values to the same color ):

image

Bonus would be to have a way to edit that list from the interface, but externalizing it as a config file of sorts would work too.

Describe alternatives you've considered I was hoping to be able to feed a string value into a node to force a node to have a color that the workflow assigned, but I don't think that the UI works that way; IE the node color wouldn't get that node value until after once running.

aegis72 avatar Dec 15 '23 15:12 aegis72