|
|
@ -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"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|