Browse Source

fix: show #ID badge always.

improve: better support for locale extension
pull/68/head
Dr.Lt.Data 1 year ago
parent
commit
25dd77fb09
  1. 2
      __init__.py
  2. 10
      extension-node-map.json
  3. 77
      js/comfyui-manager.js

2
__init__.py

@ -55,7 +55,7 @@ sys.path.append('../..')
from torchvision.datasets.utils import download_url
# ensure .js
print("### Loading: ComfyUI-Manager (V0.22.3)")
print("### Loading: ComfyUI-Manager (V0.22.4)")
comfy_ui_required_revision = 1240
comfy_ui_revision = "Unknown"

10
extension-node-map.json

@ -1458,6 +1458,7 @@
"Date Time Format",
"Debug Extra",
"Fetch widget value",
"KSampler With Refiner (Fooocus)",
"Text Hash"
],
{
@ -1647,6 +1648,15 @@
"title_aux": "CheckpointTomeLoader"
}
],
"https://github.com/m-sokes/ComfyUI-Sokes-Nodes": [
[
"Custom Date Format | sokes \ud83e\uddac",
"Latent Switch x9 | sokes \ud83e\uddac"
],
{
"title_aux": "ComfyUI Sokes Nodes"
}
],
"https://github.com/m957ymj75urz/ComfyUI-Custom-Nodes/raw/main/clip-text-encode-split/clip_text_encode_split.py": [
[
"RawText",

77
js/comfyui-manager.js vendored

@ -144,6 +144,7 @@ async function install_custom_node(target, caller, mode) {
}
async function updateComfyUI() {
let prev_text = update_comfyui_button.innerText;
update_comfyui_button.innerText = "Updating ComfyUI...";
update_comfyui_button.disabled = true;
update_comfyui_button.style.backgroundColor = "gray";
@ -152,7 +153,7 @@ async function updateComfyUI() {
const response = await api.fetchApi('/comfyui_manager/update_comfyui');
if(response.status == 400) {
app.ui.dialog.show('Failed to update ComfyUI');
app.ui.dialog.show('Failed to update ComfyUI.');
app.ui.dialog.element.style.zIndex = 9999;
return false;
}
@ -175,12 +176,13 @@ async function updateComfyUI() {
}
finally {
update_comfyui_button.disabled = false;
update_comfyui_button.innerText = "Update ComfyUI";
update_comfyui_button.innerText = prev_text;
update_comfyui_button.style.backgroundColor = "";
}
}
async function fetchUpdates(update_check_checkbox) {
let prev_text = fetch_updates_button.innerText;
fetch_updates_button.innerText = "Fetching updates...";
fetch_updates_button.disabled = true;
fetch_updates_button.style.backgroundColor = "gray";
@ -217,7 +219,7 @@ async function fetchUpdates(update_check_checkbox) {
}
finally {
fetch_updates_button.disabled = false;
fetch_updates_button.innerText = "Fetch Updates";
fetch_updates_button.innerText = prev_text;
fetch_updates_button.style.backgroundColor = "";
}
}
@ -1553,20 +1555,27 @@ app.registerExtension({
},
async beforeRegisterNodeDef(nodeType, nodeData, app) {
if(nicknames[nodeData.name.trim()]) {
const onDrawForeground = nodeType.prototype.onDrawForeground;
nodeType.prototype.onDrawForeground = function (ctx) {
const r = onDrawForeground?.apply?.(this, arguments);
const onDrawForeground = nodeType.prototype.onDrawForeground;
nodeType.prototype.onDrawForeground = function (ctx) {
const r = onDrawForeground?.apply?.(this, arguments);
if(!this.flags.collapsed && badge_mode != 'none') {
let text = nicknames[nodeData.name.trim()];
if(text.length > 20) {
text = text.substring(0,17)+"..";
}
if(!this.flags.collapsed || badge_mode == 'none') {
let text = "";
if(badge_mode == 'id_nick')
text = `#${this.id} `;
if(badge_mode == 'id_nick')
text = `#${this.id} ${text}`;
if(nicknames[nodeData.name.trim()]) {
let nick = nicknames[nodeData.name.trim()];
if(nick.length > 25) {
text += nick.substring(0,23)+"..";
}
else {
text += nick;
}
}
if(text != "") {
let fgColor = "white";
let bgColor = "#0F1F0F";
let visible = true;
@ -1583,29 +1592,35 @@ app.registerExtension({
ctx.fillText(text, this.size[0]-sz.width-6, -LiteGraph.NODE_TITLE_HEIGHT - 6);
ctx.restore();
}
}
return r;
};
}
return r;
};
},
async loadedGraphNode(node, app) {
if(node.has_errors) {
if(nicknames[node.type.trim()]) {
const onDrawForeground = node.onDrawForeground;
node.onDrawForeground = function (ctx) {
const r = onDrawForeground?.apply?.(this, arguments);
const onDrawForeground = node.onDrawForeground;
node.onDrawForeground = function (ctx) {
const r = onDrawForeground?.apply?.(this, arguments);
if(!this.flags.collapsed && badge_mode != 'none') {
let text = nicknames[node.type.trim()];
if(!this.flags.collapsed || badge_mode == 'none') {
let text = "";
if(badge_mode == 'id_nick')
text = `#${this.id} `;
if(text.length > 20) {
text = text.substring(0,17)+"..";
}
if(nicknames[node.type.trim()]) {
let nick = nicknames[node.type.trim()];
if(badge_mode == 'id_nick')
text = `#${this.id} ${text}`;
if(nick.length > 25) {
text += nick.substring(0,23)+"..";
}
else {
text += nick;
}
}
if(text != "") {
let fgColor = "white";
let bgColor = "#0F1F0F";
let visible = true;
@ -1622,10 +1637,10 @@ app.registerExtension({
ctx.fillText(text, this.size[0]-sz.width-6, -LiteGraph.NODE_TITLE_HEIGHT - 6);
ctx.restore();
}
}
return r;
};
}
return r;
};
}
}
});

Loading…
Cancel
Save