Browse Source

code formatting

update db
pull/336/head
dr.lt.data 10 months ago
parent
commit
58a2494715
  1. 10
      custom-node-list.json
  2. 9
      extension-node-map.json
  3. 158
      js/comfyui-manager.js
  4. 8
      js/components-manager.js
  5. 60
      js/snapshot.js
  6. 10
      node_db/dev/custom-node-list.json
  7. 10
      node_db/new/custom-node-list.json
  8. 9
      node_db/new/extension-node-map.json

10
custom-node-list.json

@ -4244,6 +4244,16 @@
"install_type": "git-clone", "install_type": "git-clone",
"description": "Nodes:abyz22_Padding Image, abyz22_ImpactWildcardEncode, abyz22_setimageinfo, abyz22_SaveImage, abyz22_ImpactWildcardEncode_GetPrompt, abyz22_SetQueue, abyz22_drawmask, abyz22_FirstNonNull, abyz22_blendimages, abyz22_blend_onecolor" "description": "Nodes:abyz22_Padding Image, abyz22_ImpactWildcardEncode, abyz22_setimageinfo, abyz22_SaveImage, abyz22_ImpactWildcardEncode_GetPrompt, abyz22_SetQueue, abyz22_drawmask, abyz22_FirstNonNull, abyz22_blendimages, abyz22_blend_onecolor"
}, },
{
"author": "HAL41",
"title": "ComfyUI aichemy nodes",
"reference": "https://github.com/HAL41/ComfyUI-aichemy-nodes",
"files": [
"https://github.com/HAL41/ComfyUI-aichemy-nodes"
],
"install_type": "git-clone",
"description": "Simple node to handle scaling of YOLOv8 segmentation masks"
},
{ {

9
extension-node-map.json

@ -131,6 +131,7 @@
"VideoCut-badger", "VideoCut-badger",
"deleteDir-badger", "deleteDir-badger",
"findCenterOfMask-badger", "findCenterOfMask-badger",
"frameToVideo-badger",
"getImageSide-badger", "getImageSide-badger",
"getParentDir-badger", "getParentDir-badger",
"mkdir-badger" "mkdir-badger"
@ -840,6 +841,14 @@
"title_aux": "ReActor Node for ComfyUI" "title_aux": "ReActor Node for ComfyUI"
} }
], ],
"https://github.com/HAL41/ComfyUI-aichemy-nodes": [
[
"aichemyYOLOv8Segmentation"
],
{
"title_aux": "ComfyUI aichemy nodes"
}
],
"https://github.com/Hangover3832/ComfyUI-Hangover-Nodes": [ "https://github.com/Hangover3832/ComfyUI-Hangover-Nodes": [
[ [
"Image Scale Bounding Box", "Image Scale Bounding Box",

158
js/comfyui-manager.js vendored

@ -15,7 +15,7 @@ import { CustomNodesInstaller } from "./custom-nodes-downloader.js";
import { AlternativesInstaller } from "./a1111-alter-downloader.js"; import { AlternativesInstaller } from "./a1111-alter-downloader.js";
import { SnapshotManager } from "./snapshot.js"; import { SnapshotManager } from "./snapshot.js";
import { ModelInstaller } from "./model-downloader.js"; import { ModelInstaller } from "./model-downloader.js";
import { manager_instance, setManagerInstance, install_via_git_url, install_pip, rebootAPI, free_models } from "./common.js"; import { manager_instance, setManagerInstance, install_via_git_url, install_pip, rebootAPI, free_models } from "./common.js";
import { load_components, save_as_component } from "./components-manager.js"; import { load_components, save_as_component } from "./components-manager.js";
var docStyle = document.createElement('style'); var docStyle = document.createElement('style');
@ -925,12 +925,12 @@ class ManagerMenuDialog extends ComfyDialog {
]), ]),
$el("button", { $el("button", {
id: 'workflowgallery-button', id: 'workflowgallery-button',
type: "button", type: "button",
style: { style: {
...(localStorage.getItem("wg_last_visited") ? {height: '50px'} : {}) ...(localStorage.getItem("wg_last_visited") ? {height: '50px'} : {})
}, },
onclick: (e) => { onclick: (e) => {
const last_visited_site = localStorage.getItem("wg_last_visited") const last_visited_site = localStorage.getItem("wg_last_visited")
if (!!last_visited_site) { if (!!last_visited_site) {
window.open(last_visited_site, "comfyui-workflow-gallery"); window.open(last_visited_site, "comfyui-workflow-gallery");
@ -940,15 +940,15 @@ class ManagerMenuDialog extends ComfyDialog {
}, },
}, [ }, [
$el("p", { $el("p", {
textContent: 'Workflow Gallery', textContent: 'Workflow Gallery',
style: { style: {
'text-align': 'center', 'text-align': 'center',
'color': 'white', 'color': 'white',
'font-size': '18px', 'font-size': '18px',
'margin': 0, 'margin': 0,
'padding': 0, 'padding': 0,
} }
}, [ }, [
$el("p", { $el("p", {
id: 'workflowgallery-button-last-visited-label', id: 'workflowgallery-button-last-visited-label',
textContent: `(${localStorage.getItem("wg_last_visited") ? localStorage.getItem("wg_last_visited").split('/')[2] : ''})`, textContent: `(${localStorage.getItem("wg_last_visited") ? localStorage.getItem("wg_last_visited").split('/')[2] : ''})`,
@ -961,10 +961,10 @@ class ManagerMenuDialog extends ComfyDialog {
} }
}) })
]), ]),
$el("div.pysssss-workflow-arrow-2", { $el("div.pysssss-workflow-arrow-2", {
id: `comfyworkflows-button-arrow`, id: `comfyworkflows-button-arrow`,
onclick: this.handleWorkflowGalleryButtonClick onclick: this.handleWorkflowGalleryButtonClick
}) })
]), ]),
$el("button.cm-button", { $el("button.cm-button", {
@ -1019,10 +1019,10 @@ class ManagerMenuDialog extends ComfyDialog {
this.element.style.display = "block"; this.element.style.display = "block";
} }
handleWorkflowGalleryButtonClick(e) { handleWorkflowGalleryButtonClick(e) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
LiteGraph.closeAllContextMenus(); LiteGraph.closeAllContextMenus();
// Modify the style of the button so that the UI can indicate the last // Modify the style of the button so that the UI can indicate the last
// visited site right away. // visited site right away.
@ -1033,72 +1033,72 @@ class ManagerMenuDialog extends ComfyDialog {
lastVisitedLabel.textContent = `(${url.split('/')[2]})`; lastVisitedLabel.textContent = `(${url.split('/')[2]})`;
} }
const menu = new LiteGraph.ContextMenu( const menu = new LiteGraph.ContextMenu(
[ [
{ {
title: "Share your art", title: "Share your art",
callback: () => { callback: () => {
if (share_option === 'openart') { if (share_option === 'openart') {
showOpenArtShareDialog(); showOpenArtShareDialog();
return; return;
} else if (share_option === 'matrix' || share_option === 'comfyworkflows') { } else if (share_option === 'matrix' || share_option === 'comfyworkflows') {
showShareDialog(share_option); showShareDialog(share_option);
return; return;
} else if (share_option === 'youml') { } else if (share_option === 'youml') {
showYouMLShareDialog(); showYouMLShareDialog();
return; return;
} }
if (!ShareDialogChooser.instance) { if (!ShareDialogChooser.instance) {
ShareDialogChooser.instance = new ShareDialogChooser(); ShareDialogChooser.instance = new ShareDialogChooser();
} }
ShareDialogChooser.instance.show(); ShareDialogChooser.instance.show();
}, },
}, },
{ {
title: "Open 'openart.ai'", title: "Open 'openart.ai'",
callback: () => { callback: () => {
const url = "https://openart.ai/workflows/dev"; const url = "https://openart.ai/workflows/dev";
localStorage.setItem("wg_last_visited", url); localStorage.setItem("wg_last_visited", url);
window.open(url, "comfyui-workflow-gallery"); window.open(url, "comfyui-workflow-gallery");
modifyButtonStyle(url); modifyButtonStyle(url);
}, },
}, },
{ {
title: "Open 'youml.com'", title: "Open 'youml.com'",
callback: () => { callback: () => {
const url = "https://youml.com/?from=comfyui-share"; const url = "https://youml.com/?from=comfyui-share";
localStorage.setItem("wg_last_visited", url); localStorage.setItem("wg_last_visited", url);
window.open(url, "comfyui-workflow-gallery"); window.open(url, "comfyui-workflow-gallery");
modifyButtonStyle(url); modifyButtonStyle(url);
}, },
}, },
{ {
title: "Open 'comfyworkflows.com'", title: "Open 'comfyworkflows.com'",
callback: () => { callback: () => {
const url = "https://comfyworkflows.com/"; const url = "https://comfyworkflows.com/";
localStorage.setItem("wg_last_visited", url); localStorage.setItem("wg_last_visited", url);
window.open(url, "comfyui-workflow-gallery"); window.open(url, "comfyui-workflow-gallery");
modifyButtonStyle(url); modifyButtonStyle(url);
}, },
}, },
{ {
title: "Close", title: "Close",
callback: () => { callback: () => {
LiteGraph.closeAllContextMenus(); LiteGraph.closeAllContextMenus();
}, },
} }
], ],
{ {
event: e, event: e,
scale: 1.3, scale: 1.3,
}, },
window window
); );
// set the id so that we can override the context menu's z-index to be above the comfyui manager menu // set the id so that we can override the context menu's z-index to be above the comfyui manager menu
menu.root.id = "workflowgallery-button-menu"; menu.root.id = "workflowgallery-button-menu";
menu.root.classList.add("pysssss-workflow-popup-2"); menu.root.classList.add("pysssss-workflow-popup-2");
} }
} }

8
js/components-manager.js

@ -15,10 +15,6 @@ export async function load_components() {
let data = await api.fetchApi('/manager/component/loads', {method: "POST"}); let data = await api.fetchApi('/manager/component/loads', {method: "POST"});
let components = await data.json(); let components = await data.json();
// while(!app.graph) {
// await sleep(100);
// }
let start_time = Date.now(); let start_time = Date.now();
let failed = []; let failed = [];
let failed2 = []; let failed2 = [];
@ -250,4 +246,6 @@ function handlePaste(e) {
} }
} }
document.addEventListener("paste", handlePaste); document.addEventListener("paste", handlePaste);

60
js/snapshot.js

@ -6,7 +6,7 @@ import { manager_instance, rebootAPI } from "./common.js";
async function restore_snapshot(target) { async function restore_snapshot(target) {
if(SnapshotManager.instance) { if(SnapshotManager.instance) {
try { try {
const response = await api.fetchApi(`/snapshot/restore?target=${target}`, { cache: "no-store" }); const response = await api.fetchApi(`/snapshot/restore?target=${target}`, { cache: "no-store" });
if(response.status == 400) { if(response.status == 400) {
app.ui.dialog.show(`Restore snapshot failed: ${target.title} / ${exception}`); app.ui.dialog.show(`Restore snapshot failed: ${target.title} / ${exception}`);
@ -30,7 +30,7 @@ async function restore_snapshot(target) {
async function remove_snapshot(target) { async function remove_snapshot(target) {
if(SnapshotManager.instance) { if(SnapshotManager.instance) {
try { try {
const response = await api.fetchApi(`/snapshot/remove?target=${target}`, { cache: "no-store" }); const response = await api.fetchApi(`/snapshot/remove?target=${target}`, { cache: "no-store" });
if(response.status == 400) { if(response.status == 400) {
app.ui.dialog.show(`Remove snapshot failed: ${target.title} / ${exception}`); app.ui.dialog.show(`Remove snapshot failed: ${target.title} / ${exception}`);
@ -52,20 +52,20 @@ async function remove_snapshot(target) {
} }
async function save_current_snapshot() { async function save_current_snapshot() {
try { try {
const response = await api.fetchApi('/snapshot/save', { cache: "no-store" }); const response = await api.fetchApi('/snapshot/save', { cache: "no-store" });
app.ui.dialog.close(); app.ui.dialog.close();
return true; return true;
} }
catch(exception) { catch(exception) {
app.ui.dialog.show(`Backup snapshot failed: ${exception}`); app.ui.dialog.show(`Backup snapshot failed: ${exception}`);
app.ui.dialog.element.style.zIndex = 10010; app.ui.dialog.element.style.zIndex = 10010;
return false; return false;
} }
finally { finally {
await SnapshotManager.instance.invalidateControl(); await SnapshotManager.instance.invalidateControl();
SnapshotManager.instance.updateMessage("<BR>Current snapshot saved."); SnapshotManager.instance.updateMessage("<BR>Current snapshot saved.");
} }
} }
async function getSnapshotList() { async function getSnapshotList() {
@ -97,7 +97,7 @@ export class SnapshotManager extends ComfyDialog {
async remove_item() { async remove_item() {
caller.disableButtons(); caller.disableButtons();
await caller.invalidateControl(); await caller.invalidateControl();
} }
createControls() { createControls() {
@ -151,14 +151,14 @@ export class SnapshotManager extends ComfyDialog {
var grid = document.createElement('table'); var grid = document.createElement('table');
grid.setAttribute('id', 'snapshot-list-grid'); grid.setAttribute('id', 'snapshot-list-grid');
var thead = document.createElement('thead'); var thead = document.createElement('thead');
var tbody = document.createElement('tbody'); var tbody = document.createElement('tbody');
var headerRow = document.createElement('tr'); var headerRow = document.createElement('tr');
thead.style.position = "sticky"; thead.style.position = "sticky";
thead.style.top = "0px"; thead.style.top = "0px";
thead.style.borderCollapse = "collapse"; thead.style.borderCollapse = "collapse";
thead.style.tableLayout = "fixed"; thead.style.tableLayout = "fixed";
var header1 = document.createElement('th'); var header1 = document.createElement('th');
header1.innerHTML = '&nbsp;&nbsp;ID&nbsp;&nbsp;'; header1.innerHTML = '&nbsp;&nbsp;ID&nbsp;&nbsp;';
@ -170,7 +170,7 @@ export class SnapshotManager extends ComfyDialog {
header_button.innerHTML = 'Action'; header_button.innerHTML = 'Action';
header_button.style.width = "100px"; header_button.style.width = "100px";
thead.appendChild(headerRow); thead.appendChild(headerRow);
headerRow.appendChild(header1); headerRow.appendChild(header1);
headerRow.appendChild(header2); headerRow.appendChild(header2);
headerRow.appendChild(header_button); headerRow.appendChild(header_button);
@ -231,17 +231,17 @@ export class SnapshotManager extends ComfyDialog {
this.grid_rows[i] = {data:data, control:dataRow}; this.grid_rows[i] = {data:data, control:dataRow};
} }
let self = this; let self = this;
const panel = document.createElement('div'); const panel = document.createElement('div');
panel.style.width = "100%"; panel.style.width = "100%";
panel.appendChild(grid); panel.appendChild(grid);
function handleResize() { function handleResize() {
const parentHeight = self.element.clientHeight; const parentHeight = self.element.clientHeight;
const gridHeight = parentHeight - 200; const gridHeight = parentHeight - 200;
grid.style.height = gridHeight + "px"; grid.style.height = gridHeight + "px";
} }
window.addEventListener("resize", handleResize); window.addEventListener("resize", handleResize);
grid.style.position = "relative"; grid.style.position = "relative";
@ -253,7 +253,7 @@ export class SnapshotManager extends ComfyDialog {
this.element.style.width = "80%"; this.element.style.width = "80%";
this.element.appendChild(panel); this.element.appendChild(panel);
handleResize(); handleResize();
} }
async createBottomControls() { async createBottomControls() {

10
node_db/dev/custom-node-list.json

@ -10,6 +10,16 @@
}, },
{
"author": "ZHO-ZHO-ZHO",
"title": "ComfyUI PhotoMaker (WIP)",
"reference": "https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker",
"files": [
"https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker"
],
"install_type": "git-clone",
"description": "Unofficial implementation of [a/PhotoMaker](https://github.com/TencentARC/PhotoMaker) for ComfyUI(WIP) Testing……"
},
{ {
"author": "poisenbery", "author": "poisenbery",
"title": "NudeNet-Detector-Provider [WIP]", "title": "NudeNet-Detector-Provider [WIP]",

10
node_db/new/custom-node-list.json

@ -10,6 +10,16 @@
}, },
{
"author": "HAL41",
"title": "ComfyUI aichemy nodes",
"reference": "https://github.com/HAL41/ComfyUI-aichemy-nodes",
"files": [
"https://github.com/HAL41/ComfyUI-aichemy-nodes"
],
"install_type": "git-clone",
"description": "Simple node to handle scaling of YOLOv8 segmentation masks"
},
{ {
"author": "abyz22", "author": "abyz22",
"title": "image_control", "title": "image_control",

9
node_db/new/extension-node-map.json

@ -131,6 +131,7 @@
"VideoCut-badger", "VideoCut-badger",
"deleteDir-badger", "deleteDir-badger",
"findCenterOfMask-badger", "findCenterOfMask-badger",
"frameToVideo-badger",
"getImageSide-badger", "getImageSide-badger",
"getParentDir-badger", "getParentDir-badger",
"mkdir-badger" "mkdir-badger"
@ -840,6 +841,14 @@
"title_aux": "ReActor Node for ComfyUI" "title_aux": "ReActor Node for ComfyUI"
} }
], ],
"https://github.com/HAL41/ComfyUI-aichemy-nodes": [
[
"aichemyYOLOv8Segmentation"
],
{
"title_aux": "ComfyUI aichemy nodes"
}
],
"https://github.com/Hangover3832/ComfyUI-Hangover-Nodes": [ "https://github.com/Hangover3832/ComfyUI-Hangover-Nodes": [
[ [
"Image Scale Bounding Box", "Image Scale Bounding Box",

Loading…
Cancel
Save