mirror of
https://git.datalinker.icu/ltdrdata/ComfyUI-Manager
synced 2025-12-09 06:04:31 +08:00
Merge branch 'main' of https://github.com/ltdrdata/ComfyUI-Manager
This commit is contained in:
commit
06133a1732
24
__init__.py
24
__init__.py
@ -20,7 +20,7 @@ import nodes
|
||||
import torch
|
||||
|
||||
|
||||
version = "V1.11.5"
|
||||
version = "V1.12.1"
|
||||
print(f"### Loading: ComfyUI-Manager ({version})")
|
||||
|
||||
|
||||
@ -1517,6 +1517,28 @@ async def install_model(request):
|
||||
return web.Response(status=400)
|
||||
|
||||
|
||||
class ManagerTerminalHook:
|
||||
def write_stderr(self, msg):
|
||||
server.PromptServer.instance.send_sync("manager-terminal-feedback", {"data": msg})
|
||||
|
||||
def write_stdout(self, msg):
|
||||
server.PromptServer.instance.send_sync("manager-terminal-feedback", {"data": msg})
|
||||
|
||||
|
||||
manager_terminal_hook = ManagerTerminalHook()
|
||||
|
||||
|
||||
@server.PromptServer.instance.routes.get("/manager/terminal")
|
||||
async def terminal_mode(request):
|
||||
if "mode" in request.rel_url.query:
|
||||
if request.rel_url.query['mode'] == 'true':
|
||||
sys.__comfyui_manager_terminal_hook.add_hook('cm', manager_terminal_hook)
|
||||
else:
|
||||
sys.__comfyui_manager_terminal_hook.remove_hook('cm')
|
||||
|
||||
return web.Response(status=200)
|
||||
|
||||
|
||||
@server.PromptServer.instance.routes.get("/manager/preview_method")
|
||||
async def preview_method(request):
|
||||
if "value" in request.rel_url.query:
|
||||
|
||||
@ -2374,7 +2374,7 @@
|
||||
"https://github.com/drustan-hawk/primitive-types"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "A text-to-speech plugin used under ComfyUI. It utilizes the Microsoft Speech TTS interface to convert text content into MP3 format audio files."
|
||||
"description": "This repository contains typed primitives for ComfyUI. The motivation for these primitives is that the standard primitive node cannot be routed."
|
||||
},
|
||||
{
|
||||
"author": "shadowcz007",
|
||||
@ -3068,6 +3068,16 @@
|
||||
"install_type": "git-clone",
|
||||
"description": "This is an Extension for ComfyUI, which helps formatting texts."
|
||||
},
|
||||
{
|
||||
"author": "Haoming02",
|
||||
"title": "ComfyUI Clear Screen",
|
||||
"reference": "https://github.com/Haoming02/comfyui-clear-screen",
|
||||
"files": [
|
||||
"https://github.com/Haoming02/comfyui-clear-screen"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This is an Extension for ComfyUI, which adds a button, CLS, to clear the console window."
|
||||
},
|
||||
{
|
||||
"author": "bedovyy",
|
||||
"title": "ComfyUI_NAIDGenerator",
|
||||
@ -3310,6 +3320,16 @@
|
||||
"install_type": "git-clone",
|
||||
"description": "[PoC] This extension implements [a/DemoFusion](https://ruoyidu.github.io/demofusion/demofusion.html)."
|
||||
},
|
||||
{
|
||||
"author": "spacepxl",
|
||||
"title": "ComfyUI-Image-Filters",
|
||||
"reference": "https://github.com/spacepxl/ComfyUI-Image-Filters",
|
||||
"files": [
|
||||
"https://github.com/spacepxl/ComfyUI-Image-Filters"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Image and matte filtering nodes for ComfyUI `image/filters/*`"
|
||||
},
|
||||
{
|
||||
"author": "Ser-Hilary",
|
||||
"title": "SDXL_sizing",
|
||||
|
||||
@ -3798,7 +3798,6 @@
|
||||
],
|
||||
"https://github.com/knuknX/ComfyUI-Image-Tools": [
|
||||
[
|
||||
"ImageBatchSqueezeProcessor",
|
||||
"ImageBgRemoveProcessor",
|
||||
"ImageStandardResizeProcessor",
|
||||
"SingleImagePathLoader",
|
||||
@ -4061,6 +4060,7 @@
|
||||
"Segs Mask ForEach",
|
||||
"SegsMaskCombine",
|
||||
"SegsToCombinedMask",
|
||||
"SetDefaultImageForSEGS",
|
||||
"SubtractMask",
|
||||
"SubtractMaskForEach",
|
||||
"TiledKSamplerProvider",
|
||||
@ -4730,6 +4730,8 @@
|
||||
"ShowLayer",
|
||||
"ShowTextForGPT",
|
||||
"SmoothMask",
|
||||
"SpeechRecognition",
|
||||
"SpeechSynthesis",
|
||||
"SplitLongMask",
|
||||
"SvgImage",
|
||||
"TextImage",
|
||||
@ -4893,6 +4895,17 @@
|
||||
"title_aux": "ComfyUI-HQ-Image-Save"
|
||||
}
|
||||
],
|
||||
"https://github.com/spacepxl/ComfyUI-Image-Filters": [
|
||||
[
|
||||
"AlphaClean",
|
||||
"EnhanceDetail",
|
||||
"GuidedFilterAlpha",
|
||||
"RemapRange"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI-Image-Filters"
|
||||
}
|
||||
],
|
||||
"https://github.com/spinagon/ComfyUI-seam-carving": [
|
||||
[
|
||||
"SeamCarving"
|
||||
|
||||
81
js/terminal.js
Normal file
81
js/terminal.js
Normal file
@ -0,0 +1,81 @@
|
||||
import {app} from "../../scripts/app.js";
|
||||
import {ComfyWidgets} from "../../scripts/widgets.js";
|
||||
// Node that add notes to your project
|
||||
|
||||
let terminal_node;
|
||||
let log_mode = false;
|
||||
|
||||
app.registerExtension({
|
||||
name: "Comfy.Manager.Terminal",
|
||||
|
||||
registerCustomNodes() {
|
||||
class TerminalNode {
|
||||
color = "#222222";
|
||||
bgcolor = "#000000";
|
||||
groupcolor = LGraphCanvas.node_colors.black.groupcolor;
|
||||
constructor() {
|
||||
this.logs = [];
|
||||
|
||||
if (!this.properties) {
|
||||
this.properties = {};
|
||||
this.properties.text="";
|
||||
}
|
||||
|
||||
ComfyWidgets.STRING(this, "", ["", {default:this.properties.text, multiline: true}], app)
|
||||
ComfyWidgets.BOOLEAN(this, "mode", ["", {default:true, label_on:'Logging', label_off:'Stop'}], app)
|
||||
ComfyWidgets.INT(this, "lines", ["", {default:500, min:10, max:10000, steps:1}], app)
|
||||
|
||||
let self = this;
|
||||
Object.defineProperty(this.widgets[1], 'value', {
|
||||
set: (v) => {
|
||||
api.fetchApi(`/manager/terminal?mode=${v}`, {});
|
||||
log_mode = v;
|
||||
},
|
||||
get: () => {
|
||||
return log_mode;
|
||||
}
|
||||
});
|
||||
|
||||
this.serialize_widgets = false;
|
||||
this.isVirtualNode = true;
|
||||
|
||||
if(terminal_node) {
|
||||
try {
|
||||
terminal_node.widgets[0].value = 'The output of this node is disabled because another terminal node has appeared.';
|
||||
}
|
||||
catch {}
|
||||
}
|
||||
terminal_node = this;
|
||||
}
|
||||
}
|
||||
|
||||
// Load default visibility
|
||||
LiteGraph.registerNodeType(
|
||||
"Terminal Log //CM",
|
||||
Object.assign(TerminalNode, {
|
||||
title_mode: LiteGraph.NORMAL_TITLE,
|
||||
title: "Terminal Log (Manager)",
|
||||
collapsable: true,
|
||||
})
|
||||
);
|
||||
|
||||
TerminalNode.category = "utils";
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
import { api } from "../../scripts/api.js";
|
||||
|
||||
function terminalFeedback(event) {
|
||||
if(terminal_node) {
|
||||
terminal_node.logs.push(event.detail.data);
|
||||
if(terminal_node.logs.length > terminal_node.widgets[2].value) {
|
||||
terminal_node.logs.shift();
|
||||
if(terminal_node.logs[0] == '' || terminal_node.logs[0] == '\n')
|
||||
terminal_node.logs.shift();
|
||||
}
|
||||
terminal_node.widgets[0].value = [...terminal_node.logs].reverse().join('').trim();
|
||||
}
|
||||
}
|
||||
|
||||
api.addEventListener("manager-terminal-feedback", terminalFeedback);
|
||||
@ -1,5 +1,25 @@
|
||||
{
|
||||
"custom_nodes": [
|
||||
{
|
||||
"author": "spacepxl",
|
||||
"title": "ComfyUI-Image-Filters",
|
||||
"reference": "https://github.com/spacepxl/ComfyUI-Image-Filters",
|
||||
"files": [
|
||||
"https://github.com/spacepxl/ComfyUI-Image-Filters"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Image and matte filtering nodes for ComfyUI `image/filters/*`"
|
||||
},
|
||||
{
|
||||
"author": "Haoming02",
|
||||
"title": "ComfyUI Clear Screen",
|
||||
"reference": "https://github.com/Haoming02/comfyui-clear-screen",
|
||||
"files": [
|
||||
"https://github.com/Haoming02/comfyui-clear-screen"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This is an Extension for ComfyUI, which adds a button, CLS, to clear the console window."
|
||||
},
|
||||
{
|
||||
"author": "deroberon",
|
||||
"title": "demofusion-comfyui",
|
||||
|
||||
@ -3798,7 +3798,6 @@
|
||||
],
|
||||
"https://github.com/knuknX/ComfyUI-Image-Tools": [
|
||||
[
|
||||
"ImageBatchSqueezeProcessor",
|
||||
"ImageBgRemoveProcessor",
|
||||
"ImageStandardResizeProcessor",
|
||||
"SingleImagePathLoader",
|
||||
@ -4061,6 +4060,7 @@
|
||||
"Segs Mask ForEach",
|
||||
"SegsMaskCombine",
|
||||
"SegsToCombinedMask",
|
||||
"SetDefaultImageForSEGS",
|
||||
"SubtractMask",
|
||||
"SubtractMaskForEach",
|
||||
"TiledKSamplerProvider",
|
||||
@ -4730,6 +4730,8 @@
|
||||
"ShowLayer",
|
||||
"ShowTextForGPT",
|
||||
"SmoothMask",
|
||||
"SpeechRecognition",
|
||||
"SpeechSynthesis",
|
||||
"SplitLongMask",
|
||||
"SvgImage",
|
||||
"TextImage",
|
||||
@ -4893,6 +4895,17 @@
|
||||
"title_aux": "ComfyUI-HQ-Image-Save"
|
||||
}
|
||||
],
|
||||
"https://github.com/spacepxl/ComfyUI-Image-Filters": [
|
||||
[
|
||||
"AlphaClean",
|
||||
"EnhanceDetail",
|
||||
"GuidedFilterAlpha",
|
||||
"RemapRange"
|
||||
],
|
||||
{
|
||||
"title_aux": "ComfyUI-Image-Filters"
|
||||
}
|
||||
],
|
||||
"https://github.com/spinagon/ComfyUI-seam-carving": [
|
||||
[
|
||||
"SeamCarving"
|
||||
|
||||
@ -33,6 +33,36 @@ restore_snapshot_path = os.path.join(startup_script_path, "restore-snapshot.json
|
||||
git_script_path = os.path.join(comfyui_manager_path, "git_helper.py")
|
||||
|
||||
|
||||
class TerminalHook:
|
||||
def __init__(self):
|
||||
self.hooks = {}
|
||||
|
||||
def add_hook(self, k, v):
|
||||
self.hooks[k] = v
|
||||
|
||||
def remove_hook(self, k):
|
||||
if k in self.hooks:
|
||||
del self.hooks[k]
|
||||
|
||||
def write_stderr(self, msg):
|
||||
for v in self.hooks.values():
|
||||
try:
|
||||
v.write_stderr(msg)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def write_stdout(self, msg):
|
||||
for v in self.hooks.values():
|
||||
try:
|
||||
v.write_stdout(msg)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
terminal_hook = TerminalHook()
|
||||
sys.__comfyui_manager_terminal_hook = terminal_hook
|
||||
|
||||
|
||||
def handle_stream(stream, prefix):
|
||||
stream.reconfigure(encoding=locale.getpreferredencoding(), errors='replace')
|
||||
for msg in stream:
|
||||
@ -157,9 +187,11 @@ try:
|
||||
if self.is_stdout:
|
||||
original_stdout.write(message)
|
||||
original_stdout.flush()
|
||||
terminal_hook.write_stderr(message)
|
||||
else:
|
||||
original_stderr.write(message)
|
||||
original_stderr.flush()
|
||||
terminal_hook.write_stdout(message)
|
||||
|
||||
def flush(self):
|
||||
log_file.flush()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user