mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-06-12 00:47:34 +08:00
Merge branch 'Comfy-Org:main' into main
This commit is contained in:
commit
53924366e1
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
22184
github-stats-cache.json
22184
github-stats-cache.json
File diff suppressed because it is too large
Load Diff
14029
github-stats.json
14029
github-stats.json
File diff suppressed because it is too large
Load Diff
@ -44,7 +44,7 @@ import manager_migration
|
||||
from node_package import InstalledNodePackage
|
||||
|
||||
|
||||
version_code = [3, 38, 3]
|
||||
version_code = [3, 39, 2]
|
||||
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
|
||||
|
||||
|
||||
@ -1701,6 +1701,11 @@ def write_config():
|
||||
'db_mode': get_config()['db_mode'],
|
||||
}
|
||||
|
||||
# Sanitize all string values to prevent CRLF injection attacks
|
||||
for key, value in config['default'].items():
|
||||
if isinstance(value, str):
|
||||
config['default'][key] = value.replace('\r', '').replace('\n', '').replace('\x00', '')
|
||||
|
||||
directory = os.path.dirname(manager_config_path)
|
||||
if not os.path.exists(directory):
|
||||
os.makedirs(directory)
|
||||
|
||||
@ -38,6 +38,25 @@ SECURITY_MESSAGE_NORMAL_MINUS_MODEL = "ERROR: Downloading models that are not in
|
||||
|
||||
routes = PromptServer.instance.routes
|
||||
|
||||
|
||||
def has_per_queue_preview():
|
||||
"""
|
||||
Check if ComfyUI PR #11261 (per-queue live preview override) is merged
|
||||
|
||||
Returns:
|
||||
bool: True if ComfyUI has per-queue preview feature
|
||||
"""
|
||||
try:
|
||||
import latent_preview
|
||||
return hasattr(latent_preview, 'set_preview_method')
|
||||
except ImportError:
|
||||
return False
|
||||
|
||||
|
||||
# Detect ComfyUI per-queue preview override feature (PR #11261)
|
||||
COMFYUI_HAS_PER_QUEUE_PREVIEW = has_per_queue_preview()
|
||||
|
||||
|
||||
def handle_stream(stream, prefix):
|
||||
stream.reconfigure(encoding=locale.getpreferredencoding(), errors='replace')
|
||||
for msg in stream:
|
||||
@ -182,10 +201,19 @@ def set_preview_method(method):
|
||||
core.get_config()['preview_method'] = method
|
||||
|
||||
|
||||
if args.preview_method == latent_preview.LatentPreviewMethod.NoPreviews:
|
||||
if COMFYUI_HAS_PER_QUEUE_PREVIEW:
|
||||
logging.info(
|
||||
"[ComfyUI-Manager] ComfyUI per-queue preview override detected (PR #11261). "
|
||||
"Manager's preview method feature is disabled. "
|
||||
"Use ComfyUI's --preview-method CLI option or 'Settings > Execution > Live preview method'."
|
||||
)
|
||||
elif args.preview_method == latent_preview.LatentPreviewMethod.NoPreviews:
|
||||
set_preview_method(core.get_config()['preview_method'])
|
||||
else:
|
||||
logging.warning("[ComfyUI-Manager] Since --preview-method is set, ComfyUI-Manager's preview method feature will be ignored.")
|
||||
logging.warning(
|
||||
"[ComfyUI-Manager] Since --preview-method is set, "
|
||||
"ComfyUI-Manager's preview method feature will be ignored."
|
||||
)
|
||||
|
||||
|
||||
def set_component_policy(mode):
|
||||
@ -969,6 +997,15 @@ async def get_snapshot_list(request):
|
||||
return web.json_response({'items': items}, content_type='application/json')
|
||||
|
||||
|
||||
def get_safe_snapshot_path(target):
|
||||
"""
|
||||
Safely construct a snapshot file path, preventing path traversal attacks.
|
||||
"""
|
||||
if '/' in target or '\\' in target or '..' in target or '\x00' in target:
|
||||
return None
|
||||
return os.path.join(core.manager_snapshot_path, f"{target}.json")
|
||||
|
||||
|
||||
@routes.get("/snapshot/remove")
|
||||
async def remove_snapshot(request):
|
||||
if not is_allowed_security_level('middle'):
|
||||
@ -977,8 +1014,12 @@ async def remove_snapshot(request):
|
||||
|
||||
try:
|
||||
target = request.rel_url.query["target"]
|
||||
path = get_safe_snapshot_path(target)
|
||||
|
||||
if path is None:
|
||||
logging.error(f"[ComfyUI-Manager] Invalid snapshot target: {target}")
|
||||
return web.Response(text="Invalid snapshot target", status=400)
|
||||
|
||||
path = os.path.join(core.manager_snapshot_path, f"{target}.json")
|
||||
if os.path.exists(path):
|
||||
os.remove(path)
|
||||
|
||||
@ -995,8 +1036,12 @@ async def restore_snapshot(request):
|
||||
|
||||
try:
|
||||
target = request.rel_url.query["target"]
|
||||
path = get_safe_snapshot_path(target)
|
||||
|
||||
if path is None:
|
||||
logging.error(f"[ComfyUI-Manager] Invalid snapshot target: {target}")
|
||||
return web.Response(text="Invalid snapshot target", status=400)
|
||||
|
||||
path = os.path.join(core.manager_snapshot_path, f"{target}.json")
|
||||
if os.path.exists(path):
|
||||
if not os.path.exists(core.manager_startup_script_path):
|
||||
os.makedirs(core.manager_startup_script_path)
|
||||
@ -1482,13 +1527,25 @@ async def install_model(request):
|
||||
|
||||
@routes.get("/manager/preview_method")
|
||||
async def preview_method(request):
|
||||
# Setting change request
|
||||
if "value" in request.rel_url.query:
|
||||
# Reject setting change if per-queue preview feature is available
|
||||
if COMFYUI_HAS_PER_QUEUE_PREVIEW:
|
||||
return web.Response(text="DISABLED", status=403)
|
||||
|
||||
# Process normally if not available
|
||||
set_preview_method(request.rel_url.query['value'])
|
||||
core.write_config()
|
||||
else:
|
||||
return web.Response(text=core.manager_funcs.get_current_preview_method(), status=200)
|
||||
return web.Response(status=200)
|
||||
|
||||
return web.Response(status=200)
|
||||
# Status query request
|
||||
else:
|
||||
# Return DISABLED if per-queue preview feature is available
|
||||
if COMFYUI_HAS_PER_QUEUE_PREVIEW:
|
||||
return web.Response(text="DISABLED", status=200)
|
||||
|
||||
# Return current value if not available
|
||||
return web.Response(text=core.manager_funcs.get_current_preview_method(), status=200)
|
||||
|
||||
|
||||
@routes.get("/manager/db_mode")
|
||||
|
||||
227
js/comfyui-gui-builder.js
Normal file
227
js/comfyui-gui-builder.js
Normal file
@ -0,0 +1,227 @@
|
||||
import { $el } from "../../scripts/ui.js";
|
||||
|
||||
function normalizeContent(content) {
|
||||
const tmp = document.createElement('div');
|
||||
if (typeof content === 'string') {
|
||||
tmp.innerHTML = content;
|
||||
return Array.from(tmp.childNodes);
|
||||
}
|
||||
if (content instanceof Node) {
|
||||
return content;
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
export function createSettingsCombo(label, content) {
|
||||
const settingItem = $el("div.setting-item", {}, [
|
||||
$el("div.flex.flex-row.items-center.gap-2",[
|
||||
$el("div.form-label.flex.grow.items-center", [
|
||||
$el("span.text-muted", { textContent: label },)
|
||||
]),
|
||||
$el("div.form-input.flex.justify-end",
|
||||
[content]
|
||||
)
|
||||
]
|
||||
)
|
||||
]);
|
||||
return settingItem;
|
||||
}
|
||||
|
||||
export function buildGuiFrame(dialogId, title, iconClass, content, owner) {
|
||||
const dialog_mask = $el("div.p-dialog-mask.p-overlay-mask.p-overlay-mask-enter", {
|
||||
parent: document.body,
|
||||
style: {
|
||||
position: "fixed",
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
left: "0px",
|
||||
top: "0px",
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
pointerEvents: "auto",
|
||||
zIndex: "1000"
|
||||
},
|
||||
onclick: (e) => {
|
||||
if (e.target === dialog_mask) {
|
||||
owner.close();
|
||||
}
|
||||
}
|
||||
// data-pc-section="mask"
|
||||
});
|
||||
|
||||
const header_actions = $el("div.p-dialog-header-actions", {
|
||||
// [TODO]
|
||||
// data-pc-section="headeractions"
|
||||
}
|
||||
);
|
||||
|
||||
const close_button = $el("button.p-button.p-component.p-button-icon-only.p-button-secondary.p-button-rounded.p-button-text.p-dialog-close-button", {
|
||||
parent: header_actions,
|
||||
type: "button",
|
||||
ariaLabel: "Close",
|
||||
onclick: () => owner.close(),
|
||||
// "data-pc-name": "pcclosebutton",
|
||||
// "data-p-disabled": "false",
|
||||
// "data-p-severity": "secondary",
|
||||
// "data-pc-group-section": "headericon",
|
||||
// "data-pc-extend": "button",
|
||||
// "data-pc-section": "root",
|
||||
// [FIXME] Not sure how to do most of the SVG using $el
|
||||
innerHTML: '<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="p-icon p-button-icon" aria-hidden="true"><path d="M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z" fill="currentColor"></path></svg><span class="p-button-label" data-pc-section="label"> </span><!---->'
|
||||
}
|
||||
);
|
||||
|
||||
const dialog_header = $el("div.p-dialog-header",
|
||||
[
|
||||
$el("div", [
|
||||
$el("div",
|
||||
{
|
||||
id: "frame-title-container",
|
||||
},
|
||||
[
|
||||
$el("h2.px-4", [
|
||||
$el(iconClass, {
|
||||
style: {
|
||||
"font-size": "1.25rem",
|
||||
"margin-right": ".5rem"
|
||||
}
|
||||
}),
|
||||
$el("span", { textContent: title })
|
||||
])
|
||||
]
|
||||
)
|
||||
]),
|
||||
header_actions
|
||||
]
|
||||
);
|
||||
|
||||
const contentFrame = $el("div.p-dialog-content", {}, normalizeContent(content));
|
||||
const manager_dialog = $el("div.p-dialog.p-component.global-dialog", {
|
||||
id: dialogId,
|
||||
parent: dialog_mask,
|
||||
style: {
|
||||
'display': 'flex',
|
||||
'flex-direction': 'column',
|
||||
'pointer-events': 'auto',
|
||||
'margin': '0px',
|
||||
},
|
||||
role: 'dialog',
|
||||
ariaModal: 'true',
|
||||
// [TODO]
|
||||
// ariaLabbelledby: 'cm-title',
|
||||
// maximized: 'false',
|
||||
// data-pc-name: 'dialog',
|
||||
// data-pc-section: 'root',
|
||||
// data-pd-focustrap: 'true'
|
||||
},
|
||||
[ dialog_header, contentFrame ]
|
||||
);
|
||||
|
||||
const hidden_accessible = $el("span.p-hidden-accessible.p-hidden-focusable", {
|
||||
parent: manager_dialog,
|
||||
tabindex: "0",
|
||||
role: "presentation",
|
||||
ariaHidden: "true",
|
||||
"data-p-hidden-accessible": "true",
|
||||
"data-p-hidden-focusable": "true",
|
||||
"data-pc-section": "firstfocusableelement"
|
||||
});
|
||||
|
||||
return dialog_mask;
|
||||
}
|
||||
|
||||
export function buildGuiFrameCustomHeader(dialogId, customHeader, content, owner) {
|
||||
const dialog_mask = $el("div.p-dialog-mask.p-overlay-mask.p-overlay-mask-enter", {
|
||||
parent: document.body,
|
||||
style: {
|
||||
position: "fixed",
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
left: "0px",
|
||||
top: "0px",
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
pointerEvents: "auto",
|
||||
zIndex: "1000"
|
||||
},
|
||||
onclick: (e) => {
|
||||
if (e.target === dialog_mask) {
|
||||
owner.close();
|
||||
}
|
||||
}
|
||||
// data-pc-section="mask"
|
||||
});
|
||||
|
||||
const header_actions = $el("div.p-dialog-header-actions", {
|
||||
// [TODO]
|
||||
// data-pc-section="headeractions"
|
||||
}
|
||||
);
|
||||
|
||||
const close_button = $el("button.p-button.p-component.p-button-icon-only.p-button-secondary.p-button-rounded.p-button-text.p-dialog-close-button", {
|
||||
parent: header_actions,
|
||||
type: "button",
|
||||
ariaLabel: "Close",
|
||||
onclick: () => owner.close(),
|
||||
// "data-pc-name": "pcclosebutton",
|
||||
// "data-p-disabled": "false",
|
||||
// "data-p-severity": "secondary",
|
||||
// "data-pc-group-section": "headericon",
|
||||
// "data-pc-extend": "button",
|
||||
// "data-pc-section": "root",
|
||||
// [FIXME] Not sure how to do most of the SVG using $el
|
||||
innerHTML: '<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="p-icon p-button-icon" aria-hidden="true"><path d="M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z" fill="currentColor"></path></svg><span class="p-button-label" data-pc-section="label"> </span><!---->'
|
||||
}
|
||||
);
|
||||
|
||||
const _customHeader = normalizeContent(customHeader);
|
||||
const dialog_header = $el("div.p-dialog-header",
|
||||
[
|
||||
$el("div", [
|
||||
$el("div",
|
||||
{
|
||||
id: "frame-title-container",
|
||||
},
|
||||
Array.isArray(_customHeader) ? _customHeader : [_customHeader]
|
||||
)
|
||||
]),
|
||||
header_actions
|
||||
]
|
||||
);
|
||||
|
||||
const contentFrame = $el("div.p-dialog-content", {}, normalizeContent(content));
|
||||
const manager_dialog = $el("div.p-dialog.p-component.global-dialog", {
|
||||
id: dialogId,
|
||||
parent: dialog_mask,
|
||||
style: {
|
||||
'display': 'flex',
|
||||
'flex-direction': 'column',
|
||||
'pointer-events': 'auto',
|
||||
'margin': '0px',
|
||||
},
|
||||
role: 'dialog',
|
||||
ariaModal: 'true',
|
||||
// [TODO]
|
||||
// ariaLabbelledby: 'cm-title',
|
||||
// maximized: 'false',
|
||||
// data-pc-name: 'dialog',
|
||||
// data-pc-section: 'root',
|
||||
// data-pd-focustrap: 'true'
|
||||
},
|
||||
[ dialog_header, contentFrame ]
|
||||
);
|
||||
|
||||
const hidden_accessible = $el("span.p-hidden-accessible.p-hidden-focusable", {
|
||||
parent: manager_dialog,
|
||||
tabindex: "0",
|
||||
role: "presentation",
|
||||
ariaHidden: "true",
|
||||
"data-p-hidden-accessible": "true",
|
||||
"data-p-hidden-focusable": "true",
|
||||
"data-pc-section": "firstfocusableelement"
|
||||
});
|
||||
|
||||
return dialog_mask;
|
||||
}
|
||||
@ -20,6 +20,7 @@ import { ComponentBuilderDialog, getPureName, load_components, set_component_pol
|
||||
import { CustomNodesManager } from "./custom-nodes-manager.js";
|
||||
import { ModelManager } from "./model-manager.js";
|
||||
import { SnapshotManager } from "./snapshot.js";
|
||||
import { buildGuiFrame, createSettingsCombo } from "./comfyui-gui-builder.js";
|
||||
|
||||
let manager_version = await getVersion();
|
||||
|
||||
@ -44,12 +45,16 @@ docStyle.innerHTML = `
|
||||
|
||||
#cm-manager-dialog {
|
||||
width: 1000px;
|
||||
height: 455px;
|
||||
height: auto;
|
||||
box-sizing: content-box;
|
||||
z-index: 1000;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
#cm-manager-dialog br {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.cb-widget {
|
||||
width: 400px;
|
||||
height: 25px;
|
||||
@ -80,6 +85,7 @@ docStyle.innerHTML = `
|
||||
}
|
||||
|
||||
.cm-menu-container {
|
||||
padding : calc(var(--spacing)*2);
|
||||
column-gap: 20px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@ -140,8 +146,8 @@ docStyle.innerHTML = `
|
||||
}
|
||||
|
||||
.cm-notice-board {
|
||||
width: 290px;
|
||||
height: 230px;
|
||||
width: auto;
|
||||
height: 280px;
|
||||
overflow: auto;
|
||||
color: var(--input-text);
|
||||
border: 1px solid var(--descrip-text);
|
||||
@ -238,68 +244,50 @@ var is_updating = false;
|
||||
// copied style from https://github.com/pythongosssss/ComfyUI-Custom-Scripts
|
||||
const style = `
|
||||
#workflowgallery-button {
|
||||
width: 310px;
|
||||
height: 27px;
|
||||
height: 50px;
|
||||
padding: 0px !important;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
font-size: 17px !important;
|
||||
}
|
||||
#cm-nodeinfo-button {
|
||||
width: 310px;
|
||||
height: 27px;
|
||||
padding: 0px !important;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
font-size: 17px !important;
|
||||
|
||||
}
|
||||
#cm-manual-button {
|
||||
width: 310px;
|
||||
height: 27px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
}
|
||||
|
||||
.cm-button {
|
||||
width: 310px;
|
||||
height: 30px;
|
||||
width: auto;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
font-size: 17px !important;
|
||||
background-color: var(--comfy-menu-secondary-bg);
|
||||
border-color: var(--border-color);
|
||||
color: var(--input-text);
|
||||
}
|
||||
|
||||
.cm-button:hover {
|
||||
filter: brightness(125%);
|
||||
}
|
||||
|
||||
.cm-button-red {
|
||||
width: 310px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
font-size: 17px !important;
|
||||
background-color: #500000 !important;
|
||||
border-color: #88181b !important;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.cm-button-red:hover {
|
||||
background-color: #88181b !important;
|
||||
}
|
||||
|
||||
.cm-button-orange {
|
||||
width: 310px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
font-size: 17px !important;
|
||||
font-weight: bold;
|
||||
background-color: orange !important;
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
.cm-experimental-button {
|
||||
width: 290px;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
font-size: 17px !important;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.cm-experimental {
|
||||
width: 310px;
|
||||
border: 1px solid #555;
|
||||
border-radius: 5px;
|
||||
padding: 10px;
|
||||
@ -326,8 +314,14 @@ const style = `
|
||||
|
||||
.cm-menu-combo {
|
||||
cursor: pointer;
|
||||
width: 310px;
|
||||
box-sizing: border-box;
|
||||
padding: 0.5em 0.5em;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 6px;
|
||||
background: var(--comfy-menu-secondary-bg);
|
||||
}
|
||||
|
||||
.cm-menu-combo:hover {
|
||||
filter: brightness(125%);
|
||||
}
|
||||
|
||||
.cm-small-button {
|
||||
@ -831,7 +825,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
const isElectron = 'electronAPI' in window;
|
||||
|
||||
update_comfyui_button =
|
||||
$el("button.cm-button", {
|
||||
$el("button.p-button.p-component.cm-button", {
|
||||
type: "button",
|
||||
textContent: "Update ComfyUI",
|
||||
style: {
|
||||
@ -842,7 +836,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
});
|
||||
|
||||
switch_comfyui_button =
|
||||
$el("button.cm-button", {
|
||||
$el("button.p-button.p-component.cm-button", {
|
||||
type: "button",
|
||||
textContent: "Switch ComfyUI",
|
||||
style: {
|
||||
@ -853,7 +847,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
});
|
||||
|
||||
restart_stop_button =
|
||||
$el("button.cm-button-red", {
|
||||
$el("button.p-button.p-component.cm-button-red", {
|
||||
type: "button",
|
||||
textContent: "Restart",
|
||||
onclick: () => restartOrStop()
|
||||
@ -861,7 +855,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
|
||||
if(isElectron) {
|
||||
update_all_button =
|
||||
$el("button.cm-button", {
|
||||
$el("button.p-button.p-component.cm-button", {
|
||||
type: "button",
|
||||
textContent: "Update All Custom Nodes",
|
||||
onclick:
|
||||
@ -870,7 +864,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
}
|
||||
else {
|
||||
update_all_button =
|
||||
$el("button.cm-button", {
|
||||
$el("button.p-button.p-component.cm-button", {
|
||||
type: "button",
|
||||
textContent: "Update All",
|
||||
onclick:
|
||||
@ -880,7 +874,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
|
||||
const res =
|
||||
[
|
||||
$el("button.cm-button", {
|
||||
$el("button.p-button.p-component.cm-button", {
|
||||
type: "button",
|
||||
textContent: "Custom Nodes Manager",
|
||||
onclick:
|
||||
@ -892,7 +886,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
}
|
||||
}),
|
||||
|
||||
$el("button.cm-button", {
|
||||
$el("button.p-button.p-component.cm-button", {
|
||||
type: "button",
|
||||
textContent: "Install Missing Custom Nodes",
|
||||
onclick:
|
||||
@ -904,7 +898,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
}
|
||||
}),
|
||||
|
||||
$el("button.cm-button", {
|
||||
$el("button.p-button.p-component.cm-button", {
|
||||
type: "button",
|
||||
textContent: "Custom Nodes In Workflow",
|
||||
onclick:
|
||||
@ -916,8 +910,8 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
}
|
||||
}),
|
||||
|
||||
$el("br", {}, []),
|
||||
$el("button.cm-button", {
|
||||
$el("div", {}, []),
|
||||
$el("button.p-button.p-component.cm-button", {
|
||||
type: "button",
|
||||
textContent: "Model Manager",
|
||||
onclick:
|
||||
@ -929,7 +923,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
}
|
||||
}),
|
||||
|
||||
$el("button.cm-button", {
|
||||
$el("button.p-button.p-component.cm-button", {
|
||||
type: "button",
|
||||
textContent: "Install via Git URL",
|
||||
onclick: async () => {
|
||||
@ -941,13 +935,13 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
}
|
||||
}),
|
||||
|
||||
$el("br", {}, []),
|
||||
$el("div", {}, []),
|
||||
update_all_button,
|
||||
update_comfyui_button,
|
||||
switch_comfyui_button,
|
||||
// fetch_updates_button,
|
||||
|
||||
$el("br", {}, []),
|
||||
$el("div", {}, []),
|
||||
restart_stop_button,
|
||||
];
|
||||
|
||||
@ -960,12 +954,13 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
let self = this;
|
||||
|
||||
// db mode
|
||||
|
||||
this.datasrc_combo = document.createElement("select");
|
||||
this.datasrc_combo.setAttribute("title", "Configure where to retrieve node/model information. If set to 'local,' the channel is ignored, and if set to 'channel (remote),' it fetches the latest information each time the list is opened.");
|
||||
this.datasrc_combo.className = "cm-menu-combo";
|
||||
this.datasrc_combo.appendChild($el('option', { value: 'cache', text: 'DB: Channel (1day cache)' }, []));
|
||||
this.datasrc_combo.appendChild($el('option', { value: 'local', text: 'DB: Local' }, []));
|
||||
this.datasrc_combo.appendChild($el('option', { value: 'remote', text: 'DB: Channel (remote)' }, []));
|
||||
this.datasrc_combo.className = "cm-menu-combo p-select p-component p-inputwrapper p-inputwrapper-filled ";
|
||||
this.datasrc_combo.appendChild($el('option', { value: 'cache', text: 'Channel (1day cache)' }, []));
|
||||
this.datasrc_combo.appendChild($el('option', { value: 'local', text: 'Local' }, []));
|
||||
this.datasrc_combo.appendChild($el('option', { value: 'remote', text: 'Channel (remote)' }, []));
|
||||
|
||||
api.fetchApi('/manager/db_mode')
|
||||
.then(response => response.text())
|
||||
@ -975,27 +970,110 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
api.fetchApi(`/manager/db_mode?value=${event.target.value}`);
|
||||
});
|
||||
|
||||
const dbRetrievalSetttingItem = createSettingsCombo("DB", this.datasrc_combo);
|
||||
|
||||
// preview method
|
||||
let preview_combo = document.createElement("select");
|
||||
preview_combo.setAttribute("title", "Configure how latent variables will be decoded during preview in the sampling process.");
|
||||
preview_combo.className = "cm-menu-combo";
|
||||
preview_combo.appendChild($el('option', { value: 'auto', text: 'Preview method: Auto' }, []));
|
||||
preview_combo.appendChild($el('option', { value: 'taesd', text: 'Preview method: TAESD (slow)' }, []));
|
||||
preview_combo.appendChild($el('option', { value: 'latent2rgb', text: 'Preview method: Latent2RGB (fast)' }, []));
|
||||
preview_combo.appendChild($el('option', { value: 'none', text: 'Preview method: None (very fast)' }, []));
|
||||
preview_combo.className = "cm-menu-combo p-select p-component p-inputwrapper p-inputwrapper-filled";
|
||||
|
||||
// Loading state to prevent flash of enabled state
|
||||
preview_combo.appendChild($el('option', { value: '', text: 'Loading...', disabled: true }, []));
|
||||
preview_combo.appendChild($el('option', { value: 'auto', text: 'Auto' }, []));
|
||||
preview_combo.appendChild($el('option', { value: 'taesd', text: 'TAESD (slow)' }, []));
|
||||
preview_combo.appendChild($el('option', { value: 'latent2rgb', text: 'Latent2RGB (fast)' }, []));
|
||||
preview_combo.appendChild($el('option', { value: 'none', text: 'None (very fast)' }, []));
|
||||
|
||||
// Start disabled to prevent flash
|
||||
preview_combo.disabled = true;
|
||||
preview_combo.value = '';
|
||||
|
||||
// Fetch current state
|
||||
api.fetchApi('/manager/preview_method')
|
||||
.then(response => response.text())
|
||||
.then(data => { preview_combo.value = data; });
|
||||
.then(data => {
|
||||
// Remove loading option
|
||||
preview_combo.querySelector('option[value=""]')?.remove();
|
||||
|
||||
if (data === "DISABLED") {
|
||||
// ComfyUI per-queue preview feature is active
|
||||
preview_combo.disabled = true;
|
||||
preview_combo.value = 'auto';
|
||||
|
||||
// Accessibility attributes
|
||||
preview_combo.setAttribute("aria-disabled", "true");
|
||||
preview_combo.setAttribute("aria-label",
|
||||
"Preview method setting (disabled - managed by ComfyUI). " +
|
||||
"Use Settings > Execution > Live preview method instead."
|
||||
);
|
||||
|
||||
// Tooltip for mouse users
|
||||
preview_combo.setAttribute("title",
|
||||
"This feature is now provided natively by ComfyUI. " +
|
||||
"Please use 'Settings > Execution > Live preview method' instead."
|
||||
);
|
||||
|
||||
// Visual feedback
|
||||
preview_combo.style.opacity = '0.6';
|
||||
preview_combo.style.cursor = 'not-allowed';
|
||||
} else {
|
||||
// Manager feature is active
|
||||
preview_combo.disabled = false;
|
||||
preview_combo.value = data;
|
||||
|
||||
// Accessibility for enabled state
|
||||
preview_combo.setAttribute("aria-label",
|
||||
"Preview method setting. Select how latent variables are decoded during preview."
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('[ComfyUI-Manager] Failed to fetch preview method status:', error);
|
||||
// Error recovery: fallback to enabled
|
||||
preview_combo.querySelector('option[value=""]')?.remove();
|
||||
preview_combo.disabled = false;
|
||||
preview_combo.value = 'auto';
|
||||
});
|
||||
|
||||
preview_combo.addEventListener('change', function (event) {
|
||||
api.fetchApi(`/manager/preview_method?value=${event.target.value}`);
|
||||
// Ignore if disabled
|
||||
if (preview_combo.disabled) {
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
// Normal operation
|
||||
api.fetchApi(`/manager/preview_method?value=${event.target.value}`)
|
||||
.then(response => {
|
||||
if (response.status === 403) {
|
||||
// Feature transitioned to native
|
||||
alert(
|
||||
'This feature is now provided natively by ComfyUI.\n' +
|
||||
'Please use \'Settings > Execution > Live preview method\' instead.'
|
||||
);
|
||||
preview_combo.disabled = true;
|
||||
preview_combo.style.opacity = '0.6';
|
||||
preview_combo.style.cursor = 'not-allowed';
|
||||
|
||||
// Update aria attributes
|
||||
preview_combo.setAttribute("aria-disabled", "true");
|
||||
preview_combo.setAttribute("aria-label",
|
||||
"Preview method setting (disabled - managed by ComfyUI). " +
|
||||
"Use Settings > Execution > Live preview method instead."
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('[ComfyUI-Manager] Preview method update failed:', error);
|
||||
});
|
||||
});
|
||||
|
||||
const previewSetttingItem = createSettingsCombo("Preview method", preview_combo);
|
||||
|
||||
// channel
|
||||
let channel_combo = document.createElement("select");
|
||||
channel_combo.setAttribute("title", "Configure the channel for retrieving data from the Custom Node list (including missing nodes) or the Model list.");
|
||||
channel_combo.className = "cm-menu-combo";
|
||||
channel_combo.className = "cm-menu-combo p-select p-component p-inputwrapper p-inputwrapper-filled";
|
||||
api.fetchApi('/manager/channel_url_list')
|
||||
.then(response => response.json())
|
||||
.then(async data => {
|
||||
@ -1004,7 +1082,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
for (let i in urls) {
|
||||
if (urls[i] != '') {
|
||||
let name_url = urls[i].split('::');
|
||||
channel_combo.appendChild($el('option', { value: name_url[0], text: `Channel: ${name_url[0]}` }, []));
|
||||
channel_combo.appendChild($el('option', { value: name_url[0], text: `${name_url[0]}` }, []));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1019,11 +1097,13 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
}
|
||||
});
|
||||
|
||||
const channelSetttingItem = createSettingsCombo("Channel", channel_combo);
|
||||
|
||||
|
||||
// share
|
||||
let share_combo = document.createElement("select");
|
||||
share_combo.setAttribute("title", "Hide the share button in the main menu or set the default action upon clicking it. Additionally, configure the default share site when sharing via the context menu's share button.");
|
||||
share_combo.className = "cm-menu-combo";
|
||||
share_combo.className = "cm-menu-combo p-select p-component p-inputwrapper p-inputwrapper-filled";
|
||||
const share_options = [
|
||||
['none', 'None'],
|
||||
['openart', 'OpenArt AI'],
|
||||
@ -1034,7 +1114,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
['all', 'All'],
|
||||
];
|
||||
for (const option of share_options) {
|
||||
share_combo.appendChild($el('option', { value: option[0], text: `Share: ${option[1]}` }, []));
|
||||
share_combo.appendChild($el('option', { value: option[0], text: `${option[1]}` }, []));
|
||||
}
|
||||
|
||||
api.fetchApi('/manager/share_option')
|
||||
@ -1056,12 +1136,14 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
}
|
||||
});
|
||||
|
||||
const shareSetttingItem = createSettingsCombo("Share", share_combo);
|
||||
|
||||
let component_policy_combo = document.createElement("select");
|
||||
component_policy_combo.setAttribute("title", "When loading the workflow, configure which version of the component to use.");
|
||||
component_policy_combo.className = "cm-menu-combo";
|
||||
component_policy_combo.appendChild($el('option', { value: 'workflow', text: 'Component: Use workflow version' }, []));
|
||||
component_policy_combo.appendChild($el('option', { value: 'higher', text: 'Component: Use higher version' }, []));
|
||||
component_policy_combo.appendChild($el('option', { value: 'mine', text: 'Component: Use my version' }, []));
|
||||
component_policy_combo.className = "cm-menu-combo p-select p-component p-inputwrapper p-inputwrapper-filled";
|
||||
component_policy_combo.appendChild($el('option', { value: 'workflow', text: 'Use workflow version' }, []));
|
||||
component_policy_combo.appendChild($el('option', { value: 'higher', text: 'Use higher version' }, []));
|
||||
component_policy_combo.appendChild($el('option', { value: 'mine', text: 'Use my version' }, []));
|
||||
api.fetchApi('/manager/policy/component')
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
@ -1074,15 +1156,14 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
set_component_policy(event.target.value);
|
||||
});
|
||||
|
||||
update_policy_combo = document.createElement("select");
|
||||
const componentSetttingItem = createSettingsCombo("Component", component_policy_combo);
|
||||
|
||||
if(isElectron)
|
||||
update_policy_combo.style.display = 'none';
|
||||
update_policy_combo = document.createElement("select");
|
||||
|
||||
update_policy_combo.setAttribute("title", "Sets the policy to be applied when performing an update.");
|
||||
update_policy_combo.className = "cm-menu-combo";
|
||||
update_policy_combo.appendChild($el('option', { value: 'stable-comfyui', text: 'Update: ComfyUI Stable Version' }, []));
|
||||
update_policy_combo.appendChild($el('option', { value: 'nightly-comfyui', text: 'Update: ComfyUI Nightly Version' }, []));
|
||||
update_policy_combo.className = "cm-menu-combo p-select p-component p-inputwrapper p-inputwrapper-filled";
|
||||
update_policy_combo.appendChild($el('option', { value: 'stable-comfyui', text: 'ComfyUI Stable Version' }, []));
|
||||
update_policy_combo.appendChild($el('option', { value: 'nightly-comfyui', text: 'ComfyUI Nightly Version' }, []));
|
||||
api.fetchApi('/manager/policy/update')
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
@ -1093,20 +1174,22 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
api.fetchApi(`/manager/policy/update?value=${event.target.value}`);
|
||||
});
|
||||
|
||||
return [
|
||||
$el("br", {}, []),
|
||||
this.datasrc_combo,
|
||||
channel_combo,
|
||||
preview_combo,
|
||||
share_combo,
|
||||
component_policy_combo,
|
||||
update_policy_combo,
|
||||
$el("br", {}, []),
|
||||
const updateSetttingItem = createSettingsCombo("Update", update_policy_combo);
|
||||
|
||||
if(isElectron)
|
||||
updateSetttingItem.style.display = 'none';
|
||||
|
||||
$el("br", {}, []),
|
||||
$el("filedset.cm-experimental", {}, [
|
||||
return [
|
||||
dbRetrievalSetttingItem,
|
||||
channelSetttingItem,
|
||||
previewSetttingItem,
|
||||
shareSetttingItem,
|
||||
componentSetttingItem,
|
||||
updateSetttingItem,
|
||||
//[TODO] replace mt-2 with wrapper div with flex column gap
|
||||
$el("filedset.cm-experimental.mt-auto", {}, [
|
||||
$el("legend.cm-experimental-legend", {}, ["EXPERIMENTAL"]),
|
||||
$el("button.cm-experimental-button", {
|
||||
$el("button.p-button.p-component.cm-button.cm-experimental-button", {
|
||||
type: "button",
|
||||
textContent: "Snapshot Manager",
|
||||
onclick:
|
||||
@ -1116,7 +1199,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
SnapshotManager.instance.show();
|
||||
}
|
||||
}),
|
||||
$el("button.cm-experimental-button", {
|
||||
$el("button.p-button.p-component.cm-button.cm-experimental-button.mt-2", {
|
||||
type: "button",
|
||||
textContent: "Install PIP packages",
|
||||
onclick:
|
||||
@ -1134,7 +1217,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
|
||||
createControlsRight() {
|
||||
const elts = [
|
||||
$el("button.cm-button", {
|
||||
$el("button.p-button.p-component.cm-button", {
|
||||
id: 'cm-manual-button',
|
||||
type: "button",
|
||||
textContent: "Community Manual",
|
||||
@ -1185,11 +1268,11 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
})
|
||||
]),
|
||||
|
||||
$el("button", {
|
||||
$el("button.p-button.p-component.cm-button", {
|
||||
id: 'workflowgallery-button',
|
||||
type: "button",
|
||||
style: {
|
||||
...(localStorage.getItem("wg_last_visited") ? {height: '50px'} : {})
|
||||
// ...(localStorage.getItem("wg_last_visited") ? {height: '50px'} : {})
|
||||
},
|
||||
onclick: (e) => {
|
||||
const last_visited_site = localStorage.getItem("wg_last_visited")
|
||||
@ -1212,7 +1295,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
}, [
|
||||
$el("p", {
|
||||
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] : 'none selected'})`,
|
||||
style: {
|
||||
'text-align': 'center',
|
||||
'color': 'var(--input-text)',
|
||||
@ -1228,13 +1311,12 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
})
|
||||
]),
|
||||
|
||||
$el("button.cm-button", {
|
||||
$el("button.p-button.p-component.cm-button", {
|
||||
id: 'cm-nodeinfo-button',
|
||||
type: "button",
|
||||
textContent: "Nodes Info",
|
||||
onclick: () => { window.open("https://ltdrdata.github.io/", "comfyui-node-info"); }
|
||||
}),
|
||||
$el("br", {}, []),
|
||||
];
|
||||
|
||||
var textarea = document.createElement("div");
|
||||
@ -1249,31 +1331,23 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
const close_button = $el("button", { id: "cm-close-button", type: "button", textContent: "Close", onclick: () => this.close() });
|
||||
const content = $el("div.cm-menu-container",
|
||||
[
|
||||
$el("div.cm-menu-column.gap-2", [...this.createControlsLeft()]),
|
||||
$el("div.cm-menu-column.gap-2", [...this.createControlsMid()]),
|
||||
$el("div.cm-menu-column.gap-2", [...this.createControlsRight()])
|
||||
]
|
||||
);
|
||||
|
||||
const content =
|
||||
$el("div.comfy-modal-content",
|
||||
[
|
||||
$el("tr.cm-title", {}, [
|
||||
$el("font", {size:6, color:"white"}, [`ComfyUI Manager ${manager_version}`])]
|
||||
),
|
||||
$el("br", {}, []),
|
||||
$el("div.cm-menu-container",
|
||||
[
|
||||
$el("div.cm-menu-column", [...this.createControlsLeft()]),
|
||||
$el("div.cm-menu-column", [...this.createControlsMid()]),
|
||||
$el("div.cm-menu-column", [...this.createControlsRight()])
|
||||
]),
|
||||
const frame = buildGuiFrame(
|
||||
'cm-manager-dialog', // dialog id
|
||||
`ComfyUI Manager ${manager_version}`, // dialog title
|
||||
"i.mdi.mdi-puzzle", // dialog icon class to show before title
|
||||
content, // dialog content element
|
||||
this
|
||||
); // send this so we can attach close functions
|
||||
|
||||
$el("br", {}, []),
|
||||
close_button,
|
||||
]
|
||||
);
|
||||
|
||||
content.style.width = '100%';
|
||||
content.style.height = '100%';
|
||||
|
||||
this.element = $el("div.comfy-modal", { id:'cm-manager-dialog', parent: document.body }, [ content ]);
|
||||
this.element = frame;
|
||||
}
|
||||
|
||||
get isVisible() {
|
||||
@ -1281,7 +1355,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
}
|
||||
|
||||
show() {
|
||||
this.element.style.display = "block";
|
||||
this.element.style.display = "flex";
|
||||
}
|
||||
|
||||
toggleVisibility() {
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
.cn-manager {
|
||||
--grid-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
|
||||
z-index: 1099;
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
width: 80vw;
|
||||
height: 75vh;
|
||||
min-height: 30em;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
@ -10,6 +11,7 @@
|
||||
font-family: arial, sans-serif;
|
||||
text-underline-offset: 3px;
|
||||
outline: none;
|
||||
margin: calc(var(--spacing)*2);
|
||||
}
|
||||
|
||||
.cn-manager .cn-flex-auto {
|
||||
@ -17,17 +19,21 @@
|
||||
}
|
||||
|
||||
.cn-manager button {
|
||||
width: auto;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
font-size: 16px;
|
||||
color: var(--input-text);
|
||||
background-color: var(--comfy-input-bg);
|
||||
border-radius: 8px;
|
||||
border-color: var(--border-color);
|
||||
border-style: solid;
|
||||
margin: 0;
|
||||
padding: 4px 8px;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.cn-manager button:hover {
|
||||
filter: brightness(125%);
|
||||
}
|
||||
|
||||
.cn-manager button:disabled,
|
||||
.cn-manager input:disabled,
|
||||
.cn-manager select:disabled {
|
||||
@ -40,8 +46,13 @@
|
||||
|
||||
.cn-manager .cn-manager-restart {
|
||||
display: none;
|
||||
background-color: #500000;
|
||||
color: white;
|
||||
background-color: #500000 !important;
|
||||
border-color: #88181b !important;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.cn-manager .cn-manager-restart:hover {
|
||||
background-color: #88181b !important;
|
||||
}
|
||||
|
||||
.cn-manager .cn-manager-stop {
|
||||
@ -79,7 +90,6 @@
|
||||
flex-wrap: wrap;
|
||||
gap: 5px;
|
||||
align-items: center;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.cn-manager-header label {
|
||||
@ -91,16 +101,32 @@
|
||||
.cn-manager-filter {
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
|
||||
cursor: pointer;
|
||||
padding: 0.5em 0.5em;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 6px;
|
||||
background: var(--comfy-input-bg);
|
||||
}
|
||||
|
||||
.cn-manager-filter:hover {
|
||||
filter: brightness(125%);
|
||||
}
|
||||
|
||||
.cn-manager-keywords {
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
padding: 0 5px 0 26px;
|
||||
background: var(--comfy-input-bg);
|
||||
background-size: 16px;
|
||||
background-position: 5px center;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20pointer-events%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23888%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22m21%2021-4.486-4.494M19%2010.5a8.5%208.5%200%201%201-17%200%208.5%208.5%200%200%201%2017%200%22%2F%3E%3C%2Fsvg%3E");
|
||||
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 6px;
|
||||
|
||||
outline-color: transparent;
|
||||
}
|
||||
|
||||
.cn-manager-status {
|
||||
@ -588,6 +614,10 @@
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.cn-install-buttons button {
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.cn-selected-buttons {
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { app } from "../../scripts/app.js";
|
||||
import { ComfyDialog, $el } from "../../scripts/ui.js";
|
||||
import { api } from "../../scripts/api.js";
|
||||
import { buildGuiFrameCustomHeader, createSettingsCombo } from "./comfyui-gui-builder.js";
|
||||
|
||||
import {
|
||||
manager_instance, rebootAPI, install_via_git_url,
|
||||
@ -18,32 +19,19 @@ loadCss("./custom-nodes-manager.css");
|
||||
const gridId = "node";
|
||||
|
||||
const pageHtml = `
|
||||
<div class="cn-manager-header">
|
||||
<label>Filter
|
||||
<select class="cn-manager-filter"></select>
|
||||
</label>
|
||||
<input class="cn-manager-keywords" type="search" placeholder="Search" />
|
||||
<div class="cn-manager-status"></div>
|
||||
<div class="cn-flex-auto"></div>
|
||||
<div class="cn-manager-channel"></div>
|
||||
</div>
|
||||
<div class="cn-manager-grid"></div>
|
||||
<div class="cn-manager-selection"></div>
|
||||
<div class="cn-manager-message"></div>
|
||||
<div class="cn-manager-footer">
|
||||
<button class="cn-manager-back">
|
||||
<svg class="arrow-icon" width="14" height="14" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2 8H18M2 8L8 2M2 8L8 14" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
Back
|
||||
</button>
|
||||
<button class="cn-manager-restart">Restart</button>
|
||||
<button class="cn-manager-stop">Stop</button>
|
||||
<div class="cn-flex-auto"></div>
|
||||
<button class="cn-manager-used-in-workflow">Used In Workflow</button>
|
||||
<button class="cn-manager-check-update">Check Update</button>
|
||||
<button class="cn-manager-check-missing">Check Missing</button>
|
||||
<button class="cn-manager-install-url">Install via Git URL</button>
|
||||
<div class="cn-manager cn-manager-dark">
|
||||
<div class="cn-manager-grid"></div>
|
||||
<div class="cn-manager-selection"></div>
|
||||
<div class="cn-manager-message"></div>
|
||||
<div class="cn-manager-footer">
|
||||
<button class="cn-manager-restart p-button p-component">Restart</button>
|
||||
<button class="cn-manager-stop p-button p-component">Stop</button>
|
||||
<div class="cn-flex-auto"></div>
|
||||
<button class="cn-manager-used-in-workflow p-button p-component">Used In Workflow</button>
|
||||
<button class="cn-manager-check-update p-button p-component">Check Update</button>
|
||||
<button class="cn-manager-check-missing p-button p-component">Check Missing</button>
|
||||
<button class="cn-manager-install-url p-button p-component">Install via Git URL</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@ -89,11 +77,26 @@ export class CustomNodesManager {
|
||||
}
|
||||
|
||||
init() {
|
||||
this.element = $el("div", {
|
||||
parent: document.body,
|
||||
className: "comfy-modal cn-manager"
|
||||
});
|
||||
this.element.innerHTML = pageHtml;
|
||||
const header = $el("div.cn-manager-header.px-2", {}, [
|
||||
// $el("label", {}, [
|
||||
// $el("span", { textContent: "Filter" }),
|
||||
// $el("select.cn-manager-filter")
|
||||
// ]),
|
||||
createSettingsCombo("Filter", $el("select.cn-manager-filter")),
|
||||
$el("input.cn-manager-keywords.p-inputtext.p-component", { type: "search", placeholder: "Search" }),
|
||||
$el("div.cn-manager-status"),
|
||||
$el("div.cn-flex-auto"),
|
||||
$el("div.cn-manager-channel")
|
||||
]);
|
||||
|
||||
const frame = buildGuiFrameCustomHeader(
|
||||
'cn-manager-dialog', // dialog id
|
||||
header, // custom header element
|
||||
pageHtml, // dialog content element
|
||||
this
|
||||
); // send this so we can attach close functions
|
||||
|
||||
this.element = frame;
|
||||
this.element.setAttribute("tabindex", 0);
|
||||
this.element.focus();
|
||||
|
||||
@ -372,7 +375,7 @@ export class CustomNodesManager {
|
||||
|
||||
return list.map(id => {
|
||||
const bt = buttons[id];
|
||||
return `<button class="cn-btn-${id}" group="${action}" mode="${bt.mode}">${bt.label}</button>`;
|
||||
return `<button class="cn-btn-${id} p-button p-component" group="${action}" mode="${bt.mode}">${bt.label}</button>`;
|
||||
}).join("");
|
||||
}
|
||||
|
||||
@ -655,7 +658,6 @@ export class CustomNodesManager {
|
||||
}
|
||||
|
||||
renderGrid() {
|
||||
|
||||
// update theme
|
||||
const globalStyle = window.getComputedStyle(document.body);
|
||||
this.colorVars = {
|
||||
|
||||
@ -1,13 +1,15 @@
|
||||
.cmm-manager {
|
||||
--grid-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
|
||||
z-index: 1099;
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
width: 80vw;
|
||||
height: 75vh;
|
||||
min-height: 30em;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
color: var(--fg-color);
|
||||
font-family: arial, sans-serif;
|
||||
margin: calc(var(--spacing)*2);
|
||||
}
|
||||
|
||||
.cmm-manager .cmm-flex-auto {
|
||||
@ -18,14 +20,15 @@
|
||||
font-size: 16px;
|
||||
color: var(--input-text);
|
||||
background-color: var(--comfy-input-bg);
|
||||
border-radius: 8px;
|
||||
border-color: var(--border-color);
|
||||
border-style: solid;
|
||||
margin: 0;
|
||||
padding: 4px 8px;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.cmm-manager button:hover {
|
||||
filter: brightness(125%);
|
||||
}
|
||||
|
||||
.cmm-manager button:disabled,
|
||||
.cmm-manager input:disabled,
|
||||
.cmm-manager select:disabled {
|
||||
@ -38,7 +41,7 @@
|
||||
|
||||
.cmm-manager .cmm-manager-refresh {
|
||||
display: none;
|
||||
background-color: #000080;
|
||||
background-color: #000080 !important;
|
||||
color: white;
|
||||
}
|
||||
|
||||
@ -53,7 +56,6 @@
|
||||
flex-wrap: wrap;
|
||||
gap: 5px;
|
||||
align-items: center;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.cmm-manager-header label {
|
||||
@ -67,16 +69,34 @@
|
||||
.cmm-manager-filter {
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
|
||||
cursor: pointer;
|
||||
padding: 0.5em 0.5em;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 6px;
|
||||
background: var(--comfy-input-bg);
|
||||
}
|
||||
|
||||
.cmm-manager-type:hover,
|
||||
.cmm-manager-base:hover,
|
||||
.cmm-manager-filter:hover {
|
||||
filter: brightness(125%);
|
||||
}
|
||||
|
||||
.cmm-manager-keywords {
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
padding: 0 5px 0 26px;
|
||||
background: var(--comfy-input-bg);
|
||||
background-size: 16px;
|
||||
background-position: 5px center;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20pointer-events%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23888%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22m21%2021-4.486-4.494M19%2010.5a8.5%208.5%200%201%201-17%200%208.5%208.5%200%200%201%2017%200%22%2F%3E%3C%2Fsvg%3E");
|
||||
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 6px;
|
||||
|
||||
outline-color: transparent;
|
||||
}
|
||||
|
||||
.cmm-manager-status {
|
||||
@ -148,6 +168,10 @@
|
||||
color: white;
|
||||
}
|
||||
|
||||
.cmm-btn-install {
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.cmm-btn-download {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
|
||||
@ -9,39 +9,22 @@ import { api } from "../../scripts/api.js";
|
||||
|
||||
// https://cenfun.github.io/turbogrid/api.html
|
||||
import TG from "./turbogrid.esm.js";
|
||||
import { buildGuiFrameCustomHeader, createSettingsCombo } from "./comfyui-gui-builder.js";
|
||||
|
||||
loadCss("./model-manager.css");
|
||||
|
||||
const gridId = "model";
|
||||
|
||||
const pageHtml = `
|
||||
<div class="cmm-manager-header">
|
||||
<label>Filter
|
||||
<select class="cmm-manager-filter"></select>
|
||||
</label>
|
||||
<label>Type
|
||||
<select class="cmm-manager-type"></select>
|
||||
</label>
|
||||
<label>Base
|
||||
<select class="cmm-manager-base"></select>
|
||||
</label>
|
||||
<input class="cmm-manager-keywords" type="search" placeholder="Search" />
|
||||
<div class="cmm-manager-status"></div>
|
||||
<div class="cmm-flex-auto"></div>
|
||||
</div>
|
||||
<div class="cmm-manager-grid"></div>
|
||||
<div class="cmm-manager-selection"></div>
|
||||
<div class="cmm-manager-message"></div>
|
||||
<div class="cmm-manager-footer">
|
||||
<button class="cmm-manager-back">
|
||||
<svg class="arrow-icon" width="14" height="14" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2 8H18M2 8L8 2M2 8L8 14" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
Back
|
||||
</button>
|
||||
<button class="cmm-manager-refresh">Refresh</button>
|
||||
<button class="cmm-manager-stop">Stop</button>
|
||||
<div class="cmm-flex-auto"></div>
|
||||
<div class="cmm-manager cmm-manager-dark">
|
||||
<div class="cmm-manager-grid"></div>
|
||||
<div class="cmm-manager-selection"></div>
|
||||
<div class="cmm-manager-message"></div>
|
||||
<div class="cmm-manager-footer">
|
||||
<button class="cmm-manager-refresh p-button p-component">Refresh</button>
|
||||
<button class="cmm-manager-stop p-button p-component">Stop</button>
|
||||
<div class="cmm-flex-auto"></div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@ -64,11 +47,23 @@ export class ModelManager {
|
||||
}
|
||||
|
||||
init() {
|
||||
this.element = $el("div", {
|
||||
parent: document.body,
|
||||
className: "comfy-modal cmm-manager"
|
||||
});
|
||||
this.element.innerHTML = pageHtml;
|
||||
const header = $el("div.cmm-manager-header", {}, [
|
||||
createSettingsCombo("Filter", $el("select.cmm-manager-filter")),
|
||||
createSettingsCombo("Type", $el("select.cmm-manager-type")),
|
||||
createSettingsCombo("Base", $el("select.cmm-manager-base")),
|
||||
$el("input.cmm-manager-keywords.p-inputtext.p-component", { type: "search", placeholder: "Search" }),
|
||||
$el("div.cmm-manager-status"),
|
||||
$el("div.cmm-flex-auto")
|
||||
]);
|
||||
|
||||
const frame = buildGuiFrameCustomHeader(
|
||||
'cmm-manager-dialog', // dialog id
|
||||
header, // custom header element
|
||||
pageHtml, // dialog content element
|
||||
this
|
||||
); // send this so we can attach close functions
|
||||
|
||||
this.element = frame;
|
||||
this.initFilter();
|
||||
this.bindEvents();
|
||||
this.initGrid();
|
||||
@ -347,7 +342,7 @@ export class ModelManager {
|
||||
if (installed === "True") {
|
||||
return `<div class="cmm-icon-passed">${icons.passed}</div>`;
|
||||
}
|
||||
return `<button class="cmm-btn-install" mode="install">Install</button>`;
|
||||
return `<button class="cmm-btn-install p-button p-component" mode="install">Install</button>`;
|
||||
}
|
||||
}, {
|
||||
id: 'url',
|
||||
@ -420,7 +415,7 @@ export class ModelManager {
|
||||
}
|
||||
|
||||
this.selectedModels = selectedList;
|
||||
this.showSelection(`<span>Selected <b>${selectedList.length}</b> models <button class="cmm-btn-install" mode="install">Install</button>`);
|
||||
this.showSelection(`<span>Selected <b>${selectedList.length}</b> models <button class="cmm-btn-install p-button p-component" mode="install">Install</button>`);
|
||||
}
|
||||
|
||||
focusInstall(item) {
|
||||
|
||||
65
js/snapshot.css
Normal file
65
js/snapshot.css
Normal file
@ -0,0 +1,65 @@
|
||||
.snapshot-manager {
|
||||
--grid-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
|
||||
z-index: 1099;
|
||||
width: 80vw;
|
||||
height: 75vh;
|
||||
min-height: 30em;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
color: var(--fg-color);
|
||||
font-family: arial, sans-serif;
|
||||
text-underline-offset: 3px;
|
||||
outline: none;
|
||||
margin: calc(var(--spacing)*2);
|
||||
}
|
||||
|
||||
.snapshot-manager button {
|
||||
width: auto;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
font-size: 16px;
|
||||
color: var(--input-text);
|
||||
background-color: var(--comfy-input-bg);
|
||||
border-color: var(--border-color);
|
||||
margin: 0;
|
||||
min-width: 100px;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.snapshot-manager .snapshot-restore-btn {
|
||||
background-color: #00158f !important;
|
||||
border-color: #2025b9 !important;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.snapshot-manager .snapshot-remove-btn {
|
||||
background-color: #970000 !important;
|
||||
border-color: #be2127 !important;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.snapshot-manager button:hover {
|
||||
filter: brightness(125%);
|
||||
}
|
||||
|
||||
.snapshot-manager .data-btns {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: calc(var(--spacing)*2);
|
||||
padding: calc(var(--spacing)*2);
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.snapshot-footer {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.snapshot-manager .cn-flex-auto {
|
||||
flex: auto;
|
||||
}
|
||||
@ -1,8 +1,10 @@
|
||||
import { app } from "../../scripts/app.js";
|
||||
import { api } from "../../scripts/api.js"
|
||||
import { ComfyDialog, $el } from "../../scripts/ui.js";
|
||||
import { manager_instance, rebootAPI, show_message, handle403Response } from "./common.js";
|
||||
import { manager_instance, rebootAPI, show_message, handle403Response, loadCss } from "./common.js";
|
||||
import { buildGuiFrame } from "./comfyui-gui-builder.js";
|
||||
|
||||
loadCss("./snapshot.css");
|
||||
|
||||
async function restore_snapshot(target) {
|
||||
if(SnapshotManager.instance) {
|
||||
@ -27,7 +29,7 @@ async function restore_snapshot(target) {
|
||||
}
|
||||
finally {
|
||||
await SnapshotManager.instance.invalidateControl();
|
||||
SnapshotManager.instance.updateMessage("<BR>To apply the snapshot, please <button id='cm-reboot-button2' class='cm-small-button'>RESTART</button> ComfyUI. And refresh browser.", 'cm-reboot-button2');
|
||||
SnapshotManager.instance.updateMessage("<BR>To apply the snapshot, please <button id='cm-reboot-button2' class='p-button p-component'>RESTART</button> ComfyUI. And refresh browser.", 'cm-reboot-button2');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -88,6 +90,8 @@ export class SnapshotManager extends ComfyDialog {
|
||||
message_box = null;
|
||||
data = null;
|
||||
|
||||
content = $el("div.snapshot-manager");
|
||||
|
||||
clear() {
|
||||
this.restore_buttons = [];
|
||||
this.message_box = null;
|
||||
@ -96,9 +100,18 @@ export class SnapshotManager extends ComfyDialog {
|
||||
|
||||
constructor(app, manager_dialog) {
|
||||
super();
|
||||
this.manager_dialog = manager_dialog;
|
||||
// this.manager_dialog = manager_dialog;
|
||||
this.search_keyword = '';
|
||||
this.element = $el("div.comfy-modal", { parent: document.body }, []);
|
||||
|
||||
const frame = buildGuiFrame(
|
||||
'snapshot-manager-dialog', // dialog id
|
||||
'Snapshot Manager', // title
|
||||
'i.mdi.mdi-puzzle', // icon class
|
||||
this.content, // dialog content element
|
||||
this
|
||||
); // send this so we can attach close functions
|
||||
|
||||
this.element = frame;
|
||||
}
|
||||
|
||||
async remove_item() {
|
||||
@ -109,7 +122,7 @@ export class SnapshotManager extends ComfyDialog {
|
||||
|
||||
createControls() {
|
||||
return [
|
||||
$el("button.cm-small-button", {
|
||||
$el("button.p-button.p-component", {
|
||||
type: "button",
|
||||
textContent: "Close",
|
||||
onclick: () => { this.close(); }
|
||||
@ -132,8 +145,8 @@ export class SnapshotManager extends ComfyDialog {
|
||||
this.clear();
|
||||
this.data = (await getSnapshotList()).items;
|
||||
|
||||
while (this.element.children.length) {
|
||||
this.element.removeChild(this.element.children[0]);
|
||||
while (this.content.children.length) {
|
||||
this.content.removeChild(this.content.children[0]);
|
||||
}
|
||||
|
||||
await this.createGrid();
|
||||
@ -204,20 +217,21 @@ export class SnapshotManager extends ComfyDialog {
|
||||
data2.innerHTML = ` ${data}`;
|
||||
var data_button = document.createElement('td');
|
||||
data_button.style.textAlign = "center";
|
||||
data_button.className = "data-btns";
|
||||
|
||||
var restoreBtn = document.createElement('button');
|
||||
restoreBtn.className = "snapshot-restore-btn p-button p-component";
|
||||
restoreBtn.innerHTML = 'Restore';
|
||||
restoreBtn.style.width = "100px";
|
||||
restoreBtn.style.backgroundColor = 'blue';
|
||||
|
||||
restoreBtn.addEventListener('click', function() {
|
||||
restore_snapshot(data);
|
||||
});
|
||||
|
||||
var removeBtn = document.createElement('button');
|
||||
removeBtn.className = "snapshot-remove-btn p-button p-component";
|
||||
removeBtn.innerHTML = 'Remove';
|
||||
removeBtn.style.width = "100px";
|
||||
removeBtn.style.backgroundColor = 'red';
|
||||
|
||||
removeBtn.addEventListener('click', function() {
|
||||
remove_snapshot(data);
|
||||
@ -241,13 +255,14 @@ export class SnapshotManager extends ComfyDialog {
|
||||
let self = this;
|
||||
const panel = document.createElement('div');
|
||||
panel.style.width = "100%";
|
||||
panel.style.height = "100%";
|
||||
panel.appendChild(grid);
|
||||
|
||||
function handleResize() {
|
||||
const parentHeight = self.element.clientHeight;
|
||||
const gridHeight = parentHeight - 200;
|
||||
|
||||
grid.style.height = gridHeight + "px";
|
||||
// grid.style.height = gridHeight + "px";
|
||||
}
|
||||
window.addEventListener("resize", handleResize);
|
||||
|
||||
@ -256,25 +271,17 @@ export class SnapshotManager extends ComfyDialog {
|
||||
grid.style.width = "100%";
|
||||
grid.style.height = "100%";
|
||||
grid.style.overflowY = "scroll";
|
||||
this.element.style.height = "85%";
|
||||
this.element.style.width = "80%";
|
||||
this.element.appendChild(panel);
|
||||
|
||||
this.content.appendChild(panel);
|
||||
|
||||
handleResize();
|
||||
}
|
||||
|
||||
async createBottomControls() {
|
||||
var close_button = document.createElement("button");
|
||||
close_button.className = "cm-small-button";
|
||||
close_button.innerHTML = "Close";
|
||||
close_button.onclick = () => { this.close(); }
|
||||
close_button.style.display = "inline-block";
|
||||
|
||||
var save_button = document.createElement("button");
|
||||
save_button.className = "cm-small-button";
|
||||
save_button.className = "p-button p-component";
|
||||
save_button.innerHTML = "Save snapshot";
|
||||
save_button.onclick = () => { save_current_snapshot(); }
|
||||
save_button.style.display = "inline-block";
|
||||
save_button.style.horizontalAlign = "right";
|
||||
save_button.style.width = "170px";
|
||||
|
||||
@ -282,15 +289,19 @@ export class SnapshotManager extends ComfyDialog {
|
||||
this.message_box.style.height = '60px';
|
||||
this.message_box.style.verticalAlign = 'middle';
|
||||
|
||||
this.element.appendChild(this.message_box);
|
||||
this.element.appendChild(close_button);
|
||||
this.element.appendChild(save_button);
|
||||
const footer = $el("div.snapshot-footer");
|
||||
const spacer = $el("div.cn-flex-auto");
|
||||
footer.appendChild(spacer);
|
||||
footer.appendChild(save_button);
|
||||
|
||||
this.content.appendChild(this.message_box);
|
||||
this.content.appendChild(footer);
|
||||
}
|
||||
|
||||
async show() {
|
||||
try {
|
||||
this.invalidateControl();
|
||||
this.element.style.display = "block";
|
||||
this.element.style.display = "flex";
|
||||
this.element.style.zIndex = 1099;
|
||||
}
|
||||
catch(exception) {
|
||||
|
||||
198
model-list.json
198
model-list.json
@ -5180,6 +5180,204 @@
|
||||
"size": "25.75GB"
|
||||
},
|
||||
|
||||
{
|
||||
"name": "LTX-2 19B Dev FP8",
|
||||
"type": "checkpoint",
|
||||
"base": "LTX-2",
|
||||
"save_path": "checkpoints/LTX-2",
|
||||
"description": "LTX-2 19B Dev FP8 model.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2",
|
||||
"filename": "ltx-2-19b-dev-fp8.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2/resolve/main/ltx-2-19b-dev-fp8.safetensors",
|
||||
"size": "27.1GB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B Distilled FP8",
|
||||
"type": "checkpoint",
|
||||
"base": "LTX-2",
|
||||
"save_path": "checkpoints/LTX-2",
|
||||
"description": "LTX-2 19B Distilled FP8 model.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2",
|
||||
"filename": "ltx-2-19b-distilled-fp8.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2/resolve/main/ltx-2-19b-distilled-fp8.safetensors",
|
||||
"size": "27.1GB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B Dev",
|
||||
"type": "checkpoint",
|
||||
"base": "LTX-2",
|
||||
"save_path": "checkpoints/LTX-2",
|
||||
"description": "LTX-2 19B Dev model.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2",
|
||||
"filename": "ltx-2-19b-dev.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2/resolve/main/ltx-2-19b-dev.safetensors",
|
||||
"size": "43.3GB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B Distilled",
|
||||
"type": "checkpoint",
|
||||
"base": "LTX-2",
|
||||
"save_path": "checkpoints/LTX-2",
|
||||
"description": "LTX-2 19B Distilled model.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2",
|
||||
"filename": "ltx-2-19b-distilled.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2/resolve/main/ltx-2-19b-distilled.safetensors",
|
||||
"size": "43.3GB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 Spatial Upscaler",
|
||||
"type": "upscale",
|
||||
"base": "upscale",
|
||||
"save_path": "default",
|
||||
"description": "Spatial upscaler model for LTX-2. This model enhances the spatial resolution of generated videos.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2",
|
||||
"filename": "ltx-2-spatial-upscaler-x2-1.0.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2/resolve/main/ltx-2-spatial-upscaler-x2-1.0.safetensors",
|
||||
"size": "996MB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 Temporal Upscaler",
|
||||
"type": "upscale",
|
||||
"base": "upscale",
|
||||
"save_path": "default",
|
||||
"description": "Temporal upscaler model for LTX-2. This model enhances the temporal resolution of generated videos.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2",
|
||||
"filename": "ltx-2-temporal-upscaler-x2-1.0.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2/resolve/main/ltx-2-temporal-upscaler-x2-1.0.safetensors",
|
||||
"size": "262MB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B Distilled LoRA",
|
||||
"type": "lora",
|
||||
"base": "LTX-2",
|
||||
"save_path": "loras",
|
||||
"description": "A LoRA adapter that transforms the standard LTX-2 19B model into a distilled version when loaded.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2",
|
||||
"filename": "ltx-2-19b-distilled-lora-384.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2/resolve/main/ltx-2-19b-distilled-lora-384.safetensors",
|
||||
"size": "7.67GB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B IC LoRA - Canny Control",
|
||||
"type": "lora",
|
||||
"base": "LTX-2",
|
||||
"save_path": "loras/LTX-2",
|
||||
"description": "LoRA for canny control on LTX-2 19B IC model. Intended for advanced edge control and guided generation.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2-19b-IC-LoRA-Canny-Control",
|
||||
"filename": "ltx-2-19b-ic-lora-canny-control.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2-19b-IC-LoRA-Canny-Control/resolve/main/ltx-2-19b-ic-lora-canny-control.safetensors",
|
||||
"size": "654MB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B IC LoRA - Depth Control",
|
||||
"type": "lora",
|
||||
"base": "LTX-2",
|
||||
"save_path": "loras/LTX-2",
|
||||
"description": "LoRA for depth control on LTX-2 19B IC model. Adds depth-aware generation guidance.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2-19b-IC-LoRA-Depth-Control",
|
||||
"filename": "ltx-2-19b-ic-lora-depth-control.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2-19b-IC-LoRA-Depth-Control/resolve/main/ltx-2-19b-ic-lora-depth-control.safetensors",
|
||||
"size": "654MB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B IC LoRA - Detailer",
|
||||
"type": "lora",
|
||||
"base": "LTX-2",
|
||||
"save_path": "loras/LTX-2",
|
||||
"description": "LoRA detailer for LTX-2 19B IC. Improves fine details and sharpness in generated outputs.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2-19b-IC-LoRA-Detailer",
|
||||
"filename": "ltx-2-19b-ic-lora-detailer.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2-19b-IC-LoRA-Detailer/resolve/main/ltx-2-19b-ic-lora-detailer.safetensors",
|
||||
"size": "2.62GB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B IC LoRA - Pose Control",
|
||||
"type": "lora",
|
||||
"base": "LTX-2",
|
||||
"save_path": "loras/LTX-2",
|
||||
"description": "LoRA for pose control on LTX-2 19B IC model. Enables pose-guided image/video generation.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2-19b-IC-LoRA-Pose-Control",
|
||||
"filename": "ltx-2-19b-ic-lora-pose-control.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2-19b-IC-LoRA-Pose-Control/resolve/main/ltx-2-19b-ic-lora-pose-control.safetensors",
|
||||
"size": "654MB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B LoRA - Camera Control Dolly In",
|
||||
"type": "lora",
|
||||
"base": "LTX-2",
|
||||
"save_path": "loras/LTX-2",
|
||||
"description": "LoRA for dolly-in camera control with LTX-2 19B. Simulates camera moving closer to subject.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-In",
|
||||
"filename": "ltx-2-19b-lora-camera-control-dolly-in.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-In/resolve/main/ltx-2-19b-lora-camera-control-dolly-in.safetensors",
|
||||
"size": "327MB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B LoRA - Camera Control Dolly Left",
|
||||
"type": "lora",
|
||||
"base": "LTX-2",
|
||||
"save_path": "loras/LTX-2",
|
||||
"description": "LoRA for dolly-left camera control with LTX-2 19B. Simulates camera moving left.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-Left",
|
||||
"filename": "ltx-2-19b-lora-camera-control-dolly-left.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-Left/resolve/main/ltx-2-19b-lora-camera-control-dolly-left.safetensors",
|
||||
"size": "327MB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B LoRA - Camera Control Dolly Out",
|
||||
"type": "lora",
|
||||
"base": "LTX-2",
|
||||
"save_path": "loras/LTX-2",
|
||||
"description": "LoRA for dolly-out camera control with LTX-2 19B. Simulates camera moving away from subject.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-Out",
|
||||
"filename": "ltx-2-19b-lora-camera-control-dolly-out.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-Out/resolve/main/ltx-2-19b-lora-camera-control-dolly-out.safetensors",
|
||||
"size": "327MB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B LoRA - Camera Control Dolly Right",
|
||||
"type": "lora",
|
||||
"base": "LTX-2",
|
||||
"save_path": "loras/LTX-2",
|
||||
"description": "LoRA for dolly-right camera control with LTX-2 19B. Simulates camera moving right.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-Right",
|
||||
"filename": "ltx-2-19b-lora-camera-control-dolly-right.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-Right/resolve/main/ltx-2-19b-lora-camera-control-dolly-right.safetensors",
|
||||
"size": "327MB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B LoRA - Camera Control Jib Down",
|
||||
"type": "lora",
|
||||
"base": "LTX-2",
|
||||
"save_path": "loras/LTX-2",
|
||||
"description": "LoRA for jib-down camera control with LTX-2 19B. Simulates vertical camera movement downwards.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Jib-Down",
|
||||
"filename": "ltx-2-19b-lora-camera-control-jib-down.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Jib-Down/resolve/main/ltx-2-19b-lora-camera-control-jib-down.safetensors",
|
||||
"size": "2.21GB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B LoRA - Camera Control Jib Up",
|
||||
"type": "lora",
|
||||
"base": "LTX-2",
|
||||
"save_path": "loras/LTX-2",
|
||||
"description": "LoRA for jib-up camera control with LTX-2 19B. Simulates vertical camera movement upwards.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Jib-Up",
|
||||
"filename": "ltx-2-19b-lora-camera-control-jib-up.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Jib-Up/resolve/main/ltx-2-19b-lora-camera-control-jib-up.safetensors",
|
||||
"size": "2.21GB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-2 19B LoRA - Camera Control Static",
|
||||
"type": "lora",
|
||||
"base": "LTX-2",
|
||||
"save_path": "loras/LTX-2",
|
||||
"description": "LoRA for static camera control with LTX-2 19B. Simulates stationary/static camera view.",
|
||||
"reference": "https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Static",
|
||||
"filename": "ltx-2-19b-lora-camera-control-static.safetensors",
|
||||
"url": "https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Static/resolve/main/ltx-2-19b-lora-camera-control-static.safetensors",
|
||||
"size": "2.21GB"
|
||||
},
|
||||
{
|
||||
"name": "LTX-Video Spatial Upscaler v0.9.7",
|
||||
"type": "upscale",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,15 @@
|
||||
{
|
||||
"custom_nodes": [
|
||||
{
|
||||
"author": "Fossiel",
|
||||
"title": "ComfyUI-MultiGPU-Patched",
|
||||
"reference": "https://github.com/Fossiel/ComfyUI-MultiGPU-Patched",
|
||||
"files": [
|
||||
"https://github.com/Fossiel/ComfyUI-MultiGPU-Patched"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Patched fork of ComfyUI-MultiGPU providing universal .safetensors and GGUF multi-GPU distribution with DisTorch 2.0 engine, model-driven allocation options (bytes/ratio modes), WanVideoWrapper integration, and up to 10% faster GGUF inference. (Description by CC)"
|
||||
},
|
||||
{
|
||||
"author": "synchronicity-labs",
|
||||
"title": "ComfyUI Sync Lipsync Node",
|
||||
|
||||
@ -1,5 +1,548 @@
|
||||
{
|
||||
"custom_nodes": [
|
||||
{
|
||||
"author": "patientx",
|
||||
"title": "CFZ-SwitchMenu [REMOVED]",
|
||||
"reference": "https://github.com/patientx/CFZ-SwitchMenu",
|
||||
"files": [
|
||||
"https://github.com/patientx/CFZ-SwitchMenu"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Adds a menu button that switches between old and new style ComfyUI menus."
|
||||
},
|
||||
{
|
||||
"author": "ved-gaur",
|
||||
"title": "ComfyUI-Sink-Nodes [REMOVED]",
|
||||
"reference": "https://github.com/ved-gaur/ComfyUI-Sink-Nodes",
|
||||
"files": [
|
||||
"https://github.com/ved-gaur/ComfyUI-Sink-Nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "ComfyUI sink nodes that accept inputs and intentionally do nothing, forcing models to load into memory without running inference. (Description by CC)"
|
||||
},
|
||||
{
|
||||
"author": "A043-studios",
|
||||
"title": "ComfyUI Deforum-X-Flux Nodes [REMOVED]",
|
||||
"reference": "https://github.com/A043-studios/comfyui-deforum-x-flux-nodes",
|
||||
"files": [
|
||||
"https://github.com/A043-studios/comfyui-deforum-x-flux-nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Professional video animation nodes for ComfyUI based on Deforum-X-Flux research"
|
||||
},
|
||||
{
|
||||
"author": "linksluckytime",
|
||||
"title": "comfyui_snacknodes [REMOVED]",
|
||||
"reference": "https://github.com/linksluckytime/comfyui_snacknodes",
|
||||
"files": [
|
||||
"https://github.com/linksluckytime/comfyui_snacknodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A comprehensive collection of ComfyUI nodes designed to reduce reliance on multiple third-party node packages."
|
||||
},
|
||||
{
|
||||
"author": "Nynxz",
|
||||
"title": "ComfyUI_DiffsynthPause [REMOVED]",
|
||||
"reference": "https://github.com/Nynxz/ComfyUI_DiffsynthPause",
|
||||
"files": [
|
||||
"https://github.com/Nynxz/ComfyUI_DiffsynthPause"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "ComfyUI custom node for controlling Diffsynth checkpoint pausing behavior during image generation workflows. (Description by CC)"
|
||||
},
|
||||
{
|
||||
"author": "Angelsan720",
|
||||
"title": "attention_bench [REMOVED]",
|
||||
"reference": "https://github.com/Angelsan720/attention_bench",
|
||||
"files": [
|
||||
"https://github.com/Angelsan720/attention_bench"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A simple ComfyUI node example project to help beginners learn how to develop ComfyUI nodes."
|
||||
},
|
||||
{
|
||||
"author": "balu112121",
|
||||
"title": "Comfyui_Hivision_ID_photo_layout [REMOVED]",
|
||||
"reference": "https://github.com/balu112121/Comfyui_Hivision_ID_photo_layout",
|
||||
"files": [
|
||||
"https://github.com/balu112121/Comfyui_Hivision_ID_photo_layout"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "ComfyUI custom node for ID photo layout with support for custom paper sizes, orientation, rows/columns, spacing, margins, and grid display. (Description by CC)"
|
||||
},
|
||||
{
|
||||
"author": "ainewsto",
|
||||
"title": "Comfyui_Comfly_v2 [REMOVED]",
|
||||
"reference": "https://github.com/ainewsto/Comfyui_Comfly_v2",
|
||||
"files": [
|
||||
"https://github.com/ainewsto/Comfyui_Comfly_v2"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: Comfly_Mj, Comfly_mjstyle, Comfly_upload, Comfly_Mju, Comfly_Mjv, Comfly_kling_text2video, Comfly_kling_image2video, Comfly_video_extend, Comfly_lip_sync, Comfly_kling_videoPreview, Comfly Gemini API, Comfly Doubao SeedEdit, Comfly ChatGPT Api,Comfly Jimeng API, Comfly_gpt_image_1_edit, Comfly_gpt_image_1"
|
||||
},
|
||||
{
|
||||
"author": "thoddnn",
|
||||
"title": "ComfyUI MLX Nodes [REMOVED]",
|
||||
"reference": "https://github.com/thoddnn/ComfyUI-MLX",
|
||||
"files": [
|
||||
"https://github.com/thoddnn/ComfyUI-MLX"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Faster workflows for ComfyUI users on Mac with Apple silicon"
|
||||
},
|
||||
{
|
||||
"author": "90cube",
|
||||
"title": "CBCanvas Node for ComfyUI [REMOVED]",
|
||||
"reference": "https://github.com/90cube/Comfyui-CBcanvas",
|
||||
"files": [
|
||||
"https://github.com/90cube/Comfyui-CBcanvas"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Canvas node with intelligent aspect ratio control - 13 preset aspect ratios from ultra-wide (21:9) to ultra-tall (9:21).\nNOTE: The files in the repo are not organized."
|
||||
},
|
||||
{
|
||||
"author": "inflamously",
|
||||
"title": "comfyui-prompt-enhancer [DEPRECATED]",
|
||||
"reference": "https://github.com/inflamously/comfyui-prompt-enhancer",
|
||||
"files": [
|
||||
"https://github.com/inflamously/comfyui-prompt-enhancer"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A crazy node that pragmatically just enhances a given prompt with various descriptions in the hope that the image quality just increase and prompting just gets easier."
|
||||
},
|
||||
{
|
||||
"author": "tudal",
|
||||
"title": "Hakkun-ComfyUI-nodes [REMOVED]",
|
||||
"reference": "https://github.com/tudal/Hakkun-ComfyUI-nodes",
|
||||
"files": [
|
||||
"https://raw.githubusercontent.com/tudal/Hakkun-ComfyUI-nodes/main/hakkun_nodes.py"
|
||||
],
|
||||
"install_type": "copy",
|
||||
"description": "Mainly its prompt generating by custom syntax. Prompt Parser, Prompt tags, Random Line, Calculate Upscale, Image size to string, Type Converter, Image Resize To Height/Width, Load Random Image, Load Text"
|
||||
},
|
||||
{
|
||||
"author": "huyl3-cpu",
|
||||
"title": "comfyui_segment_anything_a100 [REMOVED]",
|
||||
"reference": "https://github.com/huyl3-cpu/comfyui_segment_anything_a100",
|
||||
"files": [
|
||||
"https://github.com/huyl3-cpu/comfyui_segment_anything_a100"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Heavily optimized A100 GPU fork of ComfyUI Segment Anything using BF16 precision, VRAM Locking, and Zero-Copy GPU processing for massive batch processing."
|
||||
},
|
||||
{
|
||||
"author": "PauldeLavallaz",
|
||||
"title": "comfyui_morpheus_model_management [REMOVED]",
|
||||
"reference": "https://github.com/PauldeLavallaz/comfyui_morpheus_model_management",
|
||||
"files": [
|
||||
"https://github.com/PauldeLavallaz/comfyui_morpheus_model_management"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Nodo personalizzato per ComfyUI che consente di sfogliare una libreria locale di immagini di talent con interfaccia gallery, filtri avanzati e output multipli. (Description by CC)\nNOTE: The files in the repo are not organized."
|
||||
},
|
||||
{
|
||||
"author": "laboratoiresonore",
|
||||
"title": "ComfyUI_PerformanceLab [REMOVED]",
|
||||
"reference": "https://github.com/laboratoiresonore/ComfyUI_PerformanceLab",
|
||||
"files": [
|
||||
"https://github.com/laboratoiresonore/ComfyUI_PerformanceLab"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Make any ComfyUI workflow faster, use less VRAM, or produce better quality - with AI assistance"
|
||||
},
|
||||
{
|
||||
"author": "Linsoo",
|
||||
"title": "ComfyUI-Linsoo-Custom-Nodes [REMOVED]",
|
||||
"reference": "https://github.com/Linsoo/ComfyUI-Linsoo-Custom-Nodes",
|
||||
"files": [
|
||||
"https://github.com/Linsoo/ComfyUI-Linsoo-Custom-Nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: Linsoo Save Image, Linsoo Load Image (In development.. not working), Linsoo Empty Latent Image, Linsoo Multi Inputs, Linsoo Multi Outputs"
|
||||
},
|
||||
{
|
||||
"author": "PauldeLavallaz",
|
||||
"title": "ComfyUI-concat_images_to_api_gemini [REMOVED]",
|
||||
"reference": "https://github.com/PauldeLavallaz/ComfyUI-concat_images_to_api_gemini",
|
||||
"files": [
|
||||
"https://github.com/PauldeLavallaz/ComfyUI-concat_images_to_api_gemini"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: Concat Images → Gemini (MP only), Concat Two Images (RAW passthrough), Grid Collage AR Cols, ..."
|
||||
},
|
||||
{
|
||||
"author": "aistudynow",
|
||||
"title": "comfyui-wilddragon-nodes [REMOVED]",
|
||||
"reference": "https://github.com/aistudynow/comfyui-wilddragon-nodes",
|
||||
"files": [
|
||||
"https://github.com/aistudynow/comfyui-wilddragon-nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Image Face Crop (2025), Person Selector, Pose Face Filter, Person BBox Tracker, Face Restore & Blend, ...\nNOTE: The files in the repo are not organized."
|
||||
},
|
||||
{
|
||||
"author": "Wladimir Palant",
|
||||
"title": "image-resize-comfyui [REMOVED]",
|
||||
"reference": "https://github.com/ussoewwin/image_resize_comfyui",
|
||||
"files": [
|
||||
"https://github.com/ussoewwin/image_resize_comfyui"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Advanced image resizing node for ComfyUI with aspect ratio preservation and mask support"
|
||||
},
|
||||
{
|
||||
"author": "umisetokikaze",
|
||||
"title": "comfyui_mergekit [REMOVED]",
|
||||
"reference": "https://github.com/umisetokikaze/comfyui_mergekit",
|
||||
"files": [
|
||||
"https://github.com/umisetokikaze/comfyui_mergekit"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Nodes:DefineSaveName, SetModels, get_skip, LoadLR, LoadTarget, SetTokenizer, Merge, SetLayer, SetModels"
|
||||
},
|
||||
{
|
||||
"author": "LSDJesus",
|
||||
"title": "ComfyUI-Luna-Collection [REMOVED]",
|
||||
"reference": "https://github.com/LSDJesus/ComfyUI-Luna-Collection",
|
||||
"files": [
|
||||
"https://github.com/LSDJesus/ComfyUI-Luna-Collection"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Collection of finetuned and custom nodes for Pyrite and I\nNOTE: The files in the repo are not organized."
|
||||
},
|
||||
{
|
||||
"author": "r3dial",
|
||||
"title": "Redial Discomphy - Discord Integration for ComfyUI [REMOVED]",
|
||||
"reference": "https://github.com/r3dial/redial-discomphy",
|
||||
"files": [
|
||||
"https://github.com/r3dial/redial-discomphy"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A custom node for ComfyUI that enables direct posting of images, videos, and messages to Discord channels. This node seamlessly integrates your ComfyUI workflows with Discord communication, allowing you to automatically share your generated content."
|
||||
},
|
||||
{
|
||||
"author": "EricRorich",
|
||||
"title": "ComfyUI-Parametric-Face-Canvas [REMOVED]",
|
||||
"reference": "https://github.com/EricRorich/ComfyUI-Parametric-Face-Canvas",
|
||||
"files": [
|
||||
"https://github.com/EricRorich/ComfyUI-Parametric-Face-Canvas"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Generates a parametric 3D face wireframe and renders it as a 2D image with adjustable facial proportions and camera orientation for use in AI pipelines.\nNOTE: The files in the repo are not organized."
|
||||
},
|
||||
{
|
||||
"author": "pixixai",
|
||||
"title": "ComfyUI_Pixix-Tools [UNSAFE/REMOVED]",
|
||||
"reference": "https://github.com/pixixai/ComfyUI_pixixTools",
|
||||
"files": [
|
||||
"https://github.com/pixixai/ComfyUI_pixixTools"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Load Text (from folder)\nNOTE: The files in the repo are not organized.[w/The contents of files from arbitrary paths can be read remotely through this node.]"
|
||||
},
|
||||
{
|
||||
"author": "fllywaay",
|
||||
"title": "Comfyui-TextLine-counter [REMOVED]",
|
||||
"reference": "https://github.com/zpengcom/Comfyui-TextLine-counter",
|
||||
"files": [
|
||||
"https://github.com/zpengcom/Comfyui-TextLine-counter"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A simple multi-line text processing tool, such as line count statistics, ignoring blank lines, etc."
|
||||
},
|
||||
{
|
||||
"author": "daveand",
|
||||
"title": "ComfyUI-daveand-utils [REMOVED]",
|
||||
"reference": "https://github.com/daveand/ComfyUI-daveand-utils",
|
||||
"files": [
|
||||
"https://github.com/daveand/ComfyUI-daveand-utils"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Utility nodes including ModelConfigSelector for saving checkpoint configurations and managing manual sampler overrides. (Description by CC)"
|
||||
},
|
||||
{
|
||||
"author": "tristanvdb",
|
||||
"title": "ComfyUI-toolset [REMOVED]",
|
||||
"reference": "https://github.com/tristanvdb/ComfyUI-toolset",
|
||||
"files": [
|
||||
"https://github.com/tristanvdb/ComfyUI-toolset"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Human-in-the-loop image selection tool for ComfyUI workflows using a Flask web server, enabling users to pause workflows and interactively select images via a web browser interface."
|
||||
},
|
||||
{
|
||||
"author": "chuchu114514",
|
||||
"title": "comfyui_proportion_solver [REMOVED]",
|
||||
"reference": "https://github.com/chuchu114514/comfyui_proportion_solver",
|
||||
"files": [
|
||||
"https://github.com/chuchu114514/comfyui_proportion_solver"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This plugin includes two core nodes designed to handle proportion optimization tasks of varying complexity"
|
||||
},
|
||||
{
|
||||
"author": "chuchu114514",
|
||||
"title": "comfyui_text_list_stepper [REMOVED]",
|
||||
"reference": "https://github.com/chuchu114514/comfyui_text_list_stepper",
|
||||
"files": [
|
||||
"https://github.com/chuchu114514/comfyui_text_list_stepper"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Used for batch extraction of prompt words."
|
||||
},
|
||||
{
|
||||
"author": "balu112121",
|
||||
"title": "ComfyUI URL Image Loader [REMOVED]",
|
||||
"reference": "https://github.com/balu112121/comfyui-LoadImageFromURL",
|
||||
"files": [
|
||||
"https://github.com/balu112121/comfyui-LoadImageFromURL"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A custom ComfyUI node for loading images directly from URLs for AI image generation workflows."
|
||||
},
|
||||
{
|
||||
"author": "huyl3-cpu",
|
||||
"title": "ComfyUI_A100_Ultimate_Optimizer [REMOVED]",
|
||||
"reference": "https://github.com/huyl3-cpu/ComfyUI_A100_Ultimate_Optimizer",
|
||||
"files": [
|
||||
"https://github.com/huyl3-cpu/ComfyUI_A100_Ultimate_Optimizer"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A100 GPU batch processing and optimization node for ComfyUI. (Description by CC)"
|
||||
},
|
||||
{
|
||||
"author": "BlackVortexAI",
|
||||
"title": "BV Nodes [DEPRECATED]",
|
||||
"reference": "https://github.com/BlackVortexAI/ComfyUI-BVortexNodes",
|
||||
"files": [
|
||||
"https://github.com/BlackVortexAI/ComfyUI-BVortexNodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This repository contains a user-defined node for ComfyUI, currently there are nodes for capturing captions. But will be expanded in the future."
|
||||
},
|
||||
{
|
||||
"author": "scott-createplay",
|
||||
"title": "ComfyUI_frontend_tools [REMOVED]",
|
||||
"reference": "https://github.com/scott-createplay/ComfyUI_frontend_tools",
|
||||
"files": [
|
||||
"https://github.com/scott-createplay/ComfyUI_frontend_tools"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A comprehensive utility suite for ComfyUI that helps maintain clean, organized workflows with node cleaner, layout tools, HUD projection, and wireless connection management.\nNOTE: The files in the repo are not organized."
|
||||
},
|
||||
{
|
||||
"author": "yutrodimitri-ship-it",
|
||||
"title": "ComfyUI-YUTRO-CastingStudio-v2 [REMOVED]",
|
||||
"reference": "https://github.com/yutrodimitri-ship-it/ComfyUI-YUTRO-CastingStudio-v2",
|
||||
"files": [
|
||||
"https://github.com/yutrodimitri-ship-it/ComfyUI-YUTRO-CastingStudio-v2"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A professional modular suite of nodes for ComfyUI designed for virtual casting agencies, professional photographers, and content creators to generate high-quality model portfolios efficiently. (Description by CC)\nNOTE: The files in the repo are not organized."
|
||||
},
|
||||
{
|
||||
"author": "amamisonlyuser",
|
||||
"title": "MixvtonComfyui [REMOVED]",
|
||||
"reference": "https://github.com/amamisonlyuser/MixvtonComfyui",
|
||||
"files": [
|
||||
"https://github.com/amamisonlyuser/MixvtonComfyui"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: CXH_Leffa_Viton_Load, CXH_Leffa_Viton_Run\nNOTE: The files in the repo are not organized."
|
||||
},
|
||||
{
|
||||
"author": "AhBumm",
|
||||
"title": "ComfyUI_MangaLineExtraction [REMOVED]",
|
||||
"reference": "https://github.com/AhBumm/ComfyUI_MangaLineExtraction-hf",
|
||||
"files": [
|
||||
"https://github.com/AhBumm/ComfyUI_MangaLineExtraction-hf"
|
||||
],
|
||||
"description": "p1atdev/MangaLineExtraction-hf as a node in comfyui",
|
||||
"install_type": "git-clone"
|
||||
},
|
||||
{
|
||||
"author": "danieljanata",
|
||||
"title": "ComfyUI-QwenVL-Override [REMOVED]",
|
||||
"reference": "https://github.com/danieljanata/ComfyUI-QwenVL-Override",
|
||||
"files": [
|
||||
"https://github.com/danieljanata/ComfyUI-QwenVL-Override"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Adds two nodes that reuse upstream ComfyUI-QwenVL presets but add a runtime override that can be wired/unwired without getting stuck."
|
||||
},
|
||||
{
|
||||
"author": "Futureversecom",
|
||||
"title": "ComfyUI-JEN [REMOVED]",
|
||||
"reference": "https://github.com/futureversecom/ComfyUI-JEN",
|
||||
"files": [
|
||||
"https://github.com/futureversecom/ComfyUI-JEN"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Comfy UI custom nodes for JEN music generation powered by Futureverse"
|
||||
},
|
||||
{
|
||||
"author": "TheBill2001",
|
||||
"title": "comfyui-upscale-by-model [REMOVED]",
|
||||
"reference": "https://github.com/TheBill2001/comfyui-upscale-by-model",
|
||||
"files": [
|
||||
"https://github.com/TheBill2001/comfyui-upscale-by-model"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This custom node allow upscaling an image by a factor using a model."
|
||||
},
|
||||
{
|
||||
"author": "XYMikky12138",
|
||||
"title": "ComfyUI-NanoBanana-inpaint [REMOVED]",
|
||||
"reference": "https://github.com/XYMikky12138/ComfyUI-NanoBanana-inpaint",
|
||||
"files": [
|
||||
"https://github.com/XYMikky12138/ComfyUI-NanoBanana-inpaint"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "ComfyUI nodes for API-based inpainting (Gemini, Imagen) with aspect ratio constraints, smart cropping, resize fitting, intelligent paste-back with transparency support. (Description by CC)"
|
||||
},
|
||||
{
|
||||
"author": "Blonicx",
|
||||
"title": "ComfyUI-Rework-X [REMOVED]",
|
||||
"id": "rework-x",
|
||||
"reference": "https://github.com/Blonicx/ComfyUI-X-Rework",
|
||||
"files": [
|
||||
"https://github.com/Blonicx/ComfyUI-X-Rework"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This is a plugin for ComfyUI that adds new Util Nodes and Nodes for easier image creation and sharing."
|
||||
},
|
||||
{
|
||||
"author": "scott-createplay",
|
||||
"title": "ComfyUI_video_essentials [REMOVED]",
|
||||
"reference": "https://github.com/scott-createplay/ComfyUI_video_essentials",
|
||||
"files": [
|
||||
"https://github.com/scott-createplay/ComfyUI_video_essentials"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Essential video processing nodes for ComfyUI"
|
||||
},
|
||||
{
|
||||
"author": "thnikk",
|
||||
"title": "comfyui-thnikk-utils [REMOVED]",
|
||||
"reference": "https://github.com/thnikk/comfyui-thnikk-utils",
|
||||
"files": [
|
||||
"https://github.com/thnikk/comfyui-thnikk-utils"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Nodes to clean up your workflow."
|
||||
},
|
||||
{
|
||||
"author": "Tr1dae",
|
||||
"title": "LoRA Matcher Nodes for ComfyUI [REMOVED]",
|
||||
"reference": "https://github.com/Tr1dae/ComfyUI-LoraPromptMatcher",
|
||||
"files": [
|
||||
"https://github.com/Tr1dae/ComfyUI-LoraPromptMatcher"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This custom node provides two different approaches to automatically match text prompts with LoRA models using their descriptions."
|
||||
},
|
||||
|
||||
{
|
||||
"author": "jkhayiying",
|
||||
"title": "ImageLoadFromLocalOrUrl Node for ComfyUI [REMOVED]",
|
||||
"id": "JkhaImageLoaderPathOrUrl",
|
||||
"reference": "https://gitee.com/yyh915/jkha-load-img",
|
||||
"files": [
|
||||
"https://gitee.com/yyh915/jkha-load-img"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This is a node to load an image from local path or url."
|
||||
},
|
||||
{
|
||||
"author": "pizurny",
|
||||
"title": "ComfyUI-Just-DWPose [REMOVED]",
|
||||
"reference": "https://github.com/pizurny/ComfyUI-Just-DWPose",
|
||||
"files": [
|
||||
"https://github.com/pizurny/ComfyUI-Just-DWPose"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "An advanced DWPose annotator for ComfyUI with TorchScript and ONNX backends, featuring comprehensive pose detection, bone validation, temporal smoothing, and custom visualization tools."
|
||||
},
|
||||
{
|
||||
"author": "lfelipegg",
|
||||
"title": "lfgg_custom_nodes [REMOVED]",
|
||||
"reference": "https://github.com/lfelipegg/lfgg_custom_nodes",
|
||||
"files": [
|
||||
"https://github.com/lfelipegg/lfgg_custom_nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "NODES: ModelMergeCombos\nNOTE: The files in the repo are not organized."
|
||||
},
|
||||
{
|
||||
"author": "AndSni",
|
||||
"title": "Comfy-FL-Nodes [REMOVED]",
|
||||
"reference": "https://github.com/AndSni/Comfy-FL-Nodes",
|
||||
"files": [
|
||||
"https://github.com/AndSni/Comfy-FL-Nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Generates human characters for commerce applications in ComfyUI. (Description by CC)"
|
||||
},
|
||||
{
|
||||
"author": "neeltheninja",
|
||||
"title": "ComfyUI-ControlNeXt [REMOVED]",
|
||||
"reference": "https://github.com/neverbiasu/ComfyUI-ControlNeXt",
|
||||
"files": [
|
||||
"https://github.com/neverbiasu/ComfyUI-ControlNeXt"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "In progress🚧"
|
||||
},
|
||||
{
|
||||
"author": "TheArtOfficial",
|
||||
"title": "ComfyUI-Nitra [REMOVED]",
|
||||
"reference": "https://github.com/TheArtOfficial/ComfyUI-Nitra",
|
||||
"files": [
|
||||
"https://github.com/TheArtOfficial/ComfyUI-Nitra"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Nitra custom node for ComfyUI"
|
||||
},
|
||||
{
|
||||
"author": "AngelCookies",
|
||||
"title": "ComfyUI-Seed-Tracker [REMOVED]",
|
||||
"reference": "https://github.com/AngelCookies/ComfyUI-Seed-Tracker",
|
||||
"files": [
|
||||
"https://github.com/AngelCookies/ComfyUI-Seed-Tracker"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A ComfyUI extension that tracks random seeds throughout your image generation workflows"
|
||||
},
|
||||
{
|
||||
"author": "shinich39",
|
||||
"title": "comfyui-nothing-happened [REMOVED]",
|
||||
"reference": "httphttps://github.com/shinich39/comfyui-nothing-happened",
|
||||
"files": [
|
||||
"https://github.com/shinich39/comfyui-nothing-happened"
|
||||
],
|
||||
"description": "Save image and keep metadata.",
|
||||
"install_type": "git-clone"
|
||||
},
|
||||
{
|
||||
"author": "ashtar1984",
|
||||
"title": "comfyui-switch-bypass-mute-by-group [REMOVED]",
|
||||
"reference": "https://github.com/ashtar1984/comfyui-switch-bypass-mute-by-group",
|
||||
"files": [
|
||||
"https://github.com/ashtar1984/comfyui-switch-bypass-mute-by-group"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "ComfyUI custom node for group-based node switching, bypassing, and muting control. (Description by CC)"
|
||||
},
|
||||
{
|
||||
"author": "wallen0322",
|
||||
"title": "ComfyUI-TTM-WAN22 [REMOVED]",
|
||||
"reference": "https://github.com/wallen0322/ComfyUI-TTM-WAN22",
|
||||
"files": [
|
||||
"https://github.com/wallen0322/ComfyUI-TTM-WAN22"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "TTM (Time-to-Move) node for ComfyUI enabling motion-controlled video generation with Wan2.2 models using dual-clock denoising for independent background and object animation control."
|
||||
},
|
||||
{
|
||||
"author": "cdanielp",
|
||||
"title": "COMFYUI_PROMPTMODELS [REMOVED]",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -370,10 +370,13 @@ try:
|
||||
pass
|
||||
|
||||
with std_log_lock:
|
||||
if self.is_stdout:
|
||||
original_stdout.flush()
|
||||
else:
|
||||
original_stderr.flush()
|
||||
try:
|
||||
if self.is_stdout:
|
||||
original_stdout.flush()
|
||||
else:
|
||||
original_stderr.flush()
|
||||
except (OSError, ValueError):
|
||||
pass
|
||||
|
||||
def close(self):
|
||||
self.flush()
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-manager"
|
||||
description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI."
|
||||
version = "3.38.3"
|
||||
version = "3.39.2"
|
||||
license = { file = "LICENSE.txt" }
|
||||
dependencies = ["GitPython", "PyGithub", "matrix-nio", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions", "toml", "uv", "chardet"]
|
||||
|
||||
|
||||
175
scanner.py
175
scanner.py
@ -20,7 +20,7 @@ from pathlib import Path
|
||||
from typing import Set, Dict, Optional
|
||||
|
||||
# Scanner version for cache invalidation
|
||||
SCANNER_VERSION = "2.0.11" # Multi-layer detection: class existence + display names
|
||||
SCANNER_VERSION = "2.0.13" # Add fallback for dynamic v3 node_id
|
||||
|
||||
# Cache for extract_nodes and extract_nodes_enhanced results
|
||||
_extract_nodes_cache: Dict[str, Set[str]] = {}
|
||||
@ -552,12 +552,22 @@ def extract_nodes_enhanced(
|
||||
if exists:
|
||||
phase5_nodes.add(node_name)
|
||||
|
||||
# Union all results (FIX: Scanner 2.0.9 bug + Scanner 2.0.10 bug)
|
||||
# Phase 6: Dict comprehension pattern (NEW in 2.0.12)
|
||||
# Detects: NODE_CLASS_MAPPINGS = {cls.__name__: cls for cls in to_export}
|
||||
# Example: TobiasGlaubach/ComfyUI-TG_PyCode
|
||||
phase6_nodes = _fallback_dict_comprehension(code_text, file_path)
|
||||
|
||||
# Phase 7: Import-based class names for dict comprehension (NEW in 2.0.12)
|
||||
# Detects imported classes that are added to export lists
|
||||
phase7_nodes = _fallback_import_class_names(code_text, file_path)
|
||||
|
||||
# Union all results (FIX: Scanner 2.0.9 bug + Scanner 2.0.10 bug + Scanner 2.0.12 dict comp)
|
||||
# 2.0.9: Used early return which missed Phase 3 nodes
|
||||
# 2.0.10: Only checked registrations, missed classes referenced in display names
|
||||
all_nodes = phase1_nodes | phase2_nodes | phase3_nodes | phase4_nodes | phase5_nodes
|
||||
# 2.0.12: Added dict comprehension and import-based class detection
|
||||
all_nodes = phase1_nodes | phase2_nodes | phase3_nodes | phase4_nodes | phase5_nodes | phase6_nodes | phase7_nodes
|
||||
|
||||
# Phase 6: Empty dict detector (logging only, doesn't add nodes)
|
||||
# Phase 8: Empty dict detector (logging only, doesn't add nodes)
|
||||
if not all_nodes:
|
||||
_fallback_empty_dict_detector(code_text, file_path, verbose)
|
||||
|
||||
@ -616,7 +626,7 @@ def _fallback_classname_resolver(code_text: str, file_path: Optional[Path]) -> S
|
||||
def _fallback_item_assignment(code_text: str) -> Set[str]:
|
||||
"""
|
||||
Detect item assignment pattern.
|
||||
|
||||
|
||||
Pattern:
|
||||
NODE_CLASS_MAPPINGS = {}
|
||||
NODE_CLASS_MAPPINGS["MyNode"] = MyNode
|
||||
@ -627,9 +637,9 @@ def _fallback_item_assignment(code_text: str) -> Set[str]:
|
||||
parsed = ast.parse(code_text)
|
||||
except:
|
||||
return set()
|
||||
|
||||
|
||||
nodes = set()
|
||||
|
||||
|
||||
for node in ast.walk(parsed):
|
||||
if isinstance(node, ast.Assign):
|
||||
for target in node.targets:
|
||||
@ -640,10 +650,156 @@ def _fallback_item_assignment(code_text: str) -> Set[str]:
|
||||
if isinstance(target.slice, ast.Constant):
|
||||
if isinstance(target.slice.value, str):
|
||||
nodes.add(target.slice.value)
|
||||
|
||||
|
||||
return nodes
|
||||
|
||||
|
||||
def _fallback_dict_comprehension(code_text: str, file_path: Optional[Path] = None) -> Set[str]:
|
||||
"""
|
||||
Detect dict comprehension pattern with __name__ attribute access.
|
||||
|
||||
Pattern:
|
||||
NODE_CLASS_MAPPINGS = {cls.__name__: cls for cls in to_export}
|
||||
NODE_CLASS_MAPPINGS = {c.__name__: c for c in [ClassA, ClassB]}
|
||||
|
||||
This function detects dict comprehension assignments to NODE_CLASS_MAPPINGS
|
||||
and extracts class names from the iterable (list literal or variable reference).
|
||||
|
||||
Returns:
|
||||
Set of class names extracted from the dict comprehension
|
||||
"""
|
||||
try:
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings('ignore', category=SyntaxWarning)
|
||||
parsed = ast.parse(code_text)
|
||||
except:
|
||||
return set()
|
||||
|
||||
nodes = set()
|
||||
export_lists = {} # Track list variables and their contents
|
||||
|
||||
# First pass: collect list assignments (to_export = [...], exports = [...])
|
||||
for node in ast.walk(parsed):
|
||||
if isinstance(node, ast.Assign):
|
||||
for target in node.targets:
|
||||
if isinstance(target, ast.Name):
|
||||
var_name = target.id
|
||||
# Check for list literal
|
||||
if isinstance(node.value, ast.List):
|
||||
class_names = set()
|
||||
for elt in node.value.elts:
|
||||
if isinstance(elt, ast.Name):
|
||||
class_names.add(elt.id)
|
||||
export_lists[var_name] = class_names
|
||||
|
||||
# Handle augmented assignment: to_export += [...]
|
||||
elif isinstance(node, ast.AugAssign):
|
||||
if isinstance(node.target, ast.Name) and isinstance(node.op, ast.Add):
|
||||
var_name = node.target.id
|
||||
if isinstance(node.value, ast.List):
|
||||
class_names = set()
|
||||
for elt in node.value.elts:
|
||||
if isinstance(elt, ast.Name):
|
||||
class_names.add(elt.id)
|
||||
if var_name in export_lists:
|
||||
export_lists[var_name].update(class_names)
|
||||
else:
|
||||
export_lists[var_name] = class_names
|
||||
|
||||
# Second pass: find NODE_CLASS_MAPPINGS dict comprehension
|
||||
for node in ast.walk(parsed):
|
||||
if isinstance(node, ast.Assign):
|
||||
for target in node.targets:
|
||||
if isinstance(target, ast.Name) and target.id in ['NODE_CLASS_MAPPINGS', 'NODE_CONFIG']:
|
||||
# Check for dict comprehension
|
||||
if isinstance(node.value, ast.DictComp):
|
||||
dictcomp = node.value
|
||||
|
||||
# Check if key is cls.__name__ pattern
|
||||
key = dictcomp.key
|
||||
if isinstance(key, ast.Attribute) and key.attr == '__name__':
|
||||
# Get the iterable from the first generator
|
||||
for generator in dictcomp.generators:
|
||||
iter_node = generator.iter
|
||||
|
||||
# Case 1: Inline list [ClassA, ClassB, ...]
|
||||
if isinstance(iter_node, ast.List):
|
||||
for elt in iter_node.elts:
|
||||
if isinstance(elt, ast.Name):
|
||||
nodes.add(elt.id)
|
||||
|
||||
# Case 2: Variable reference (to_export, exports, etc.)
|
||||
elif isinstance(iter_node, ast.Name):
|
||||
var_name = iter_node.id
|
||||
if var_name in export_lists:
|
||||
nodes.update(export_lists[var_name])
|
||||
|
||||
return nodes
|
||||
|
||||
|
||||
def _fallback_import_class_names(code_text: str, file_path: Optional[Path] = None) -> Set[str]:
|
||||
"""
|
||||
Extract class names from imports that are added to export lists.
|
||||
|
||||
Pattern:
|
||||
from .module import ClassA, ClassB
|
||||
to_export = [ClassA, ClassB]
|
||||
NODE_CLASS_MAPPINGS = {cls.__name__: cls for cls in to_export}
|
||||
|
||||
This is a complementary fallback that works with _fallback_dict_comprehension
|
||||
to resolve import-based node registrations.
|
||||
|
||||
Returns:
|
||||
Set of imported class names that appear in export-like contexts
|
||||
"""
|
||||
try:
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings('ignore', category=SyntaxWarning)
|
||||
parsed = ast.parse(code_text)
|
||||
except:
|
||||
return set()
|
||||
|
||||
# Collect imported names
|
||||
imported_names = set()
|
||||
for node in ast.walk(parsed):
|
||||
if isinstance(node, ast.ImportFrom):
|
||||
for alias in node.names:
|
||||
name = alias.asname if alias.asname else alias.name
|
||||
imported_names.add(name)
|
||||
|
||||
# Check if these names appear in list assignments that feed into NODE_CLASS_MAPPINGS
|
||||
export_candidates = set()
|
||||
has_dict_comp_mapping = False
|
||||
|
||||
for node in ast.walk(parsed):
|
||||
# Check for dict comprehension NODE_CLASS_MAPPINGS
|
||||
if isinstance(node, ast.Assign):
|
||||
for target in node.targets:
|
||||
if isinstance(target, ast.Name) and target.id == 'NODE_CLASS_MAPPINGS':
|
||||
if isinstance(node.value, ast.DictComp):
|
||||
has_dict_comp_mapping = True
|
||||
|
||||
# Collect list contents
|
||||
if isinstance(node, ast.Assign):
|
||||
if isinstance(node.value, ast.List):
|
||||
for elt in node.value.elts:
|
||||
if isinstance(elt, ast.Name) and elt.id in imported_names:
|
||||
export_candidates.add(elt.id)
|
||||
|
||||
# Handle augmented assignment
|
||||
elif isinstance(node, ast.AugAssign):
|
||||
if isinstance(node.value, ast.List):
|
||||
for elt in node.value.elts:
|
||||
if isinstance(elt, ast.Name) and elt.id in imported_names:
|
||||
export_candidates.add(elt.id)
|
||||
|
||||
# Only return if there's a dict comprehension mapping
|
||||
if has_dict_comp_mapping:
|
||||
return export_candidates
|
||||
|
||||
return set()
|
||||
|
||||
|
||||
def _extract_repo_name(file_path: Path) -> str:
|
||||
"""
|
||||
Extract repository name from file path.
|
||||
@ -780,6 +936,9 @@ def extract_v3_nodes(code_text):
|
||||
node_id = extract_node_id_from_schema(node)
|
||||
if node_id:
|
||||
nodes.add(node_id)
|
||||
else:
|
||||
# Fallback: use class name when node_id is dynamic/empty
|
||||
nodes.add(node.name)
|
||||
|
||||
return nodes
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user