Files
MdONeilsl b6a2d1dd79 Add MD Color Mod nodes, operators, and web UI
Introduce a complete GIMP/GEGL-inspired color module for ComfyUI. Adds: node declarations (nodes/*) and matching operator implementations (py/*) for many color/image operations (balance, temperature, hue/chroma, hue/saturation, saturation, exposure, levels, invert, auto adjustments, maps, posterize, desaturate, tone mapping, component extract/mix, etc.). Includes support libs (py/libs: color, process, blur), layer compositing (layers_blending), VRAM‑aware chunking, mask handling and alpha preservation. Adds web UI extension and widgets (web/*), package metadata, dynamic __init__.py loader, README update and .gitignore tweaks.
2026-07-06 08:17:05 -04:00

44 lines
1.3 KiB
JavaScript

import { app } from "../../../scripts/app.js";
import { color_balance_widget } from "./nodes/color_balance_widget.js";
import { color_hue_saturation_widget } from "./nodes/color_hue_saturation_widget.js";
//import { addRGBIntegerWidget } from "./widgets/rgb_int_widget.js";
app.registerExtension({
name: "md.color_mod.frontend_extension",
async beforeRegisterNodeDef(nodeType, nodeData, app) {
const onNodeCreated = nodeType.prototype.onNodeCreated;
if (nodeData.name === "mdColorBalance") {
nodeType.prototype.onNodeCreated = function () {
onNodeCreated?.apply(this, arguments);
this._inst = new color_balance_widget(this);
};
}
if (nodeData.name === "mdColorHueSaturation") {
nodeType.prototype.onNodeCreated = function () {
onNodeCreated?.apply(this, arguments);
this._inst = new color_hue_saturation_widget(this);
};
}
/*
if (nodeData.name === "mdPrimitiveColorRGB") {
nodeType.prototype.onNodeCreated = function () {
const result = onNodeCreated?.apply(this, arguments);
addRGBIntegerWidget(this, "rgb", 16711680);
return result;
};
}
*/
},
});