mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-09-15 05:57:57 +00:00
Color palette setting
This commit is contained in:
@@ -576,27 +576,6 @@ class ComfyApp {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup slot colors for types
|
||||
*/
|
||||
setupSlotColors() {
|
||||
let colors = {
|
||||
"CLIP": "#FFD500", // bright yellow
|
||||
"CLIP_VISION": "#A8DADC", // light blue-gray
|
||||
"CLIP_VISION_OUTPUT": "#ad7452", // rusty brown-orange
|
||||
"CONDITIONING": "#FFA931", // vibrant orange-yellow
|
||||
"CONTROL_NET": "#6EE7B7", // soft mint green
|
||||
"IMAGE": "#64B5F6", // bright sky blue
|
||||
"LATENT": "#FF9CF9", // light pink-purple
|
||||
"MASK": "#81C784", // muted green
|
||||
"MODEL": "#B39DDB", // light lavender-purple
|
||||
"STYLE_MODEL": "#C2FFAE", // light green-yellow
|
||||
"VAE": "#FF6E6E", // bright red
|
||||
};
|
||||
|
||||
Object.assign(this.canvas.default_connection_color_byType, colors);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up the app on the page
|
||||
*/
|
||||
@@ -614,8 +593,6 @@ class ComfyApp {
|
||||
const canvas = (this.canvas = new LGraphCanvas(canvasEl, this.graph));
|
||||
this.ctx = canvasEl.getContext("2d");
|
||||
|
||||
this.setupSlotColors();
|
||||
|
||||
this.graph.start();
|
||||
|
||||
function resizeCanvas() {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { api } from "./api.js";
|
||||
|
||||
function $el(tag, propsOrChildren, children) {
|
||||
export function $el(tag, propsOrChildren, children) {
|
||||
const split = tag.split(".");
|
||||
const element = document.createElement(split.shift());
|
||||
element.classList.add(...split);
|
||||
@@ -114,6 +114,17 @@ class ComfySettingsDialog extends ComfyDialog {
|
||||
this.settings = [];
|
||||
}
|
||||
|
||||
getSettingValue(id, defaultValue) {
|
||||
const settingId = "Comfy.Settings." + id;
|
||||
const v = localStorage[settingId];
|
||||
return v == null ? defaultValue : JSON.parse(v);
|
||||
}
|
||||
|
||||
setSettingValue(id, value) {
|
||||
const settingId = "Comfy.Settings." + id;
|
||||
localStorage[settingId] = JSON.stringify(value);
|
||||
}
|
||||
|
||||
addSetting({ id, name, type, defaultValue, onChange }) {
|
||||
if (!id) {
|
||||
throw new Error("Settings must have an ID");
|
||||
@@ -142,7 +153,7 @@ class ComfySettingsDialog extends ComfyDialog {
|
||||
};
|
||||
|
||||
if (typeof type === "function") {
|
||||
return type(name, setter);
|
||||
return type(name, setter, value);
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
|
Reference in New Issue
Block a user