Skip to content

Commit b1f802e

Browse files
authored
Add files via upload
1 parent 94a6ca5 commit b1f802e

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

web/js/appearance.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { app } from "/scripts/app.js";
22

33
const COLOR_THEMES = {
44
segment: { nodeColor: "#222e40", nodeBgColor: "#364254", width: 340 },
5-
utility: { nodeColor: "#2e3e57", nodeBgColor: "#4b5b73", width: 320 },
5+
utility: { nodeColor: "#2e3e57", nodeBgColor: "#4b5b73", width: 300 },
66
};
77

88
const NODE_COLORS = {
@@ -40,9 +40,14 @@ const NODE_COLORS = {
4040
"AILab_CropObject": "utility",
4141
"AILab_ImageCompare": "utility",
4242
"AILab_ColorInput": "utility",
43-
"AILab_ImageMaskResize": "utility",
43+
"AILab_ReferenceLatentMask": "utility",
4444
"AILab_LamaRemover": "utility",
4545
"AILab_SDMatte": "utility",
46+
"AILab_ImageResize": "utility",
47+
"AILab_ImageToList": "utility",
48+
"AILab_MaskToList": "utility",
49+
"AILab_ImageMaskToList": "utility",
50+
"AILab_ColorToMask": "utility",
4651
};
4752

4853
function setNodeColors(node, theme) {

web/js/colorWidget.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ const getContrastTextColor = (hexColor) => {
2323
};
2424

2525
const AILabColorWidget = {
26-
COLOR: (key, val) => {
26+
COLORCODE: (key, val) => {
2727
const widget = {};
2828
widget.y = 0;
2929
widget.name = key;
30-
widget.type = 'COLOR';
30+
widget.type = 'COLORCODE';
3131
widget.options = { default: '#222222' };
32-
widget.value = typeof val === 'string' ? val : '#222222'; // validate incoming value
32+
widget.value = typeof val === 'string' ? val : '#222222';
3333

3434
widget.draw = function (ctx, node, widgetWidth, widgetY, height) {
35-
const hide = this.type !== 'COLOR' && app.canvas.ds.scale > 0.5;
35+
const hide = this.type !== 'COLORCODE' && app.canvas.ds.scale > 0.5;
3636
if (hide) {
3737
return;
3838
}
@@ -66,7 +66,7 @@ const AILabColorWidget = {
6666
ctx.font = '12px sans-serif';
6767
ctx.textAlign = 'center';
6868

69-
const text = `background_color (${this.value})`;
69+
const text = `${this.name} (${this.value})`;
7070
ctx.fillText(text, widgetWidth * 0.5, widgetY + height * 0.65);
7171
};
7272

@@ -112,15 +112,15 @@ app.registerExtension({
112112

113113
getCustomWidgets() {
114114
return {
115-
COLOR: (node, inputName, inputData) => {
115+
COLORCODE: (node, inputName, inputData) => {
116116
return {
117117
widget: node.addCustomWidget(
118-
AILabColorWidget.COLOR(inputName, inputData?.[1]?.default || '#222222')
118+
AILabColorWidget.COLORCODE(inputName, inputData?.[1]?.default || '#222222')
119119
),
120120
minWidth: 150,
121121
minHeight: 32,
122122
};
123123
}
124124
};
125125
}
126-
});
126+
});

0 commit comments

Comments
 (0)