2 Commits
Author SHA1 Message Date
Sun Yi-Ran a07b2fdf91 fix afterChange may override other extensions (#15) 2024-02-25 10:16:13 +01:00
Gregor Adams e1b1729c88 Update README.md 2024-01-29 17:15:26 +01:00
2 changed files with 25 additions and 29 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
# ComfyUI Extensions by Failfa.st
# ComfyUI Extensions by Blibla
![Screenshot 2023-08-02 004936](https://github.com/failfa-st/failfast-comfyui-extensions/assets/1148334/d1530160-3c77-4aac-952f-7b9f2cf37b8f)
[![Discord](https://img.shields.io/discord/1091306623819059300?color=7289da&label=Discord&logo=discord&logoColor=fff&style=for-the-badge)](https://discord.com/invite/m3TBB9XEkb)
ComfyUI Extensions by Failfa.st is a robust suite of enhancements, designed to optimize your ComfyUI experience. It
ComfyUI Extensions by Blibla is a robust suite of enhancements, designed to optimize your ComfyUI experience. It
provides a range of features, including customizable render modes, dynamic node coloring, and versatile management
tools. Whether for individual use or team collaboration, our extensions aim to enhance productivity, readability, and
personalization in your ComfyUI environment.
+23 -27
View File
@@ -184,45 +184,40 @@ function colorPositiveNegative(app) {
* Colors
*/
let afterChange;
let colorModeValue;
function invokeAfterChange() {
switch (colorModeValue) {
case 1:
uncolor(app);
break;
case 2:
rainbowify(app);
break;
case 3:
colorByType(app);
break;
default:
break;
}
if (getPosNegValue()) {
colorPositiveNegative(app);
}
return afterChange?.apply(this, arguments);
}
function setColorMode(value, app) {
colorModeValue = value;
switch (value) {
case 1:
app.graph.afterChange = function () {
uncolor(app);
if (getPosNegValue()) {
colorPositiveNegative(app);
}
return afterChange?.apply(this, arguments);
};
uncolor(app);
break;
case 2:
app.graph.afterChange = function () {
rainbowify(app);
if (getPosNegValue()) {
colorPositiveNegative(app);
}
return afterChange?.apply(this, arguments);
};
rainbowify(app);
break;
case 3:
app.graph.afterChange = function () {
colorByType(app);
if (getPosNegValue()) {
colorPositiveNegative(app);
}
return afterChange?.apply(this, arguments);
};
colorByType(app);
break;
default:
app.graph.afterChange = function () {
if (getPosNegValue()) {
colorPositiveNegative(app);
}
return afterChange?.apply(this, arguments);
};
app.graph._nodes.forEach((node) => {
node.bgcolor = node._bgcolor ?? node.bgcolor;
node.color = node._color ?? node.color;
@@ -275,6 +270,7 @@ app.registerExtension({
},
async init(app) {
afterChange = app.graph.afterChange;
app.graph.afterChange = invokeAfterChange;
const onMenuNodeColors = LGraphCanvas.onMenuNodeColors;
LGraphCanvas.onMenuNodeColors = function (value, options, e, menu, node) {
const response = onMenuNodeColors.apply(this, arguments);