Files
Comfyui-JSON-Manager/web/binary_index_decoder.js
Ethanfel bc61033826 feat: color output dots by type/value on execution
ProjectKey: dot color matches ComfyUI's type color map (INT/FLOAT),
or green/grey for BOOLEAN based on actual value.
BinaryIndexDecoder: same green/grey per-output based on true/false.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 13:29:10 +02:00

21 lines
809 B
JavaScript

import { app } from "../../scripts/app.js";
app.registerExtension({
name: "json.manager.binary_index_decoder",
async beforeRegisterNodeDef(nodeType, nodeData, app) {
if (nodeData.name !== "BinaryIndexDecoder") return;
nodeType.prototype.onExecuted = function (output) {
if (!output?.values) return;
for (let i = 0; i < Math.min(output.values.length, this.outputs.length); i++) {
const val = output.values[i];
this.outputs[i].label = `${val} ${this.outputs[i].name}`;
this.outputs[i].color_on = (val === "true") ? "#4caf50" : "#888888";
this.outputs[i].color_off = (val === "true") ? "#4caf50" : "#888888";
}
app.graph?.setDirtyCanvas(true, true);
};
},
});