Skip to content

Commit

Permalink
terminal feature is removed.
Browse files Browse the repository at this point in the history
Now ComfyUI provides built-in terminal feature.

comfyanonymous/ComfyUI#5413
  • Loading branch information
ltdrdata committed Oct 29, 2024
1 parent 0a9a8e4 commit 294244b
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 145 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ When you run the `scan.sh` script:
* `high` level risky features
* `Install via git url`, `pip install`
* Installation of custom nodes registered not in the `default channel`.
* Display terminal log
* Fix custom nodes
* `middle` level risky features
Expand Down
2 changes: 1 addition & 1 deletion glob/manager_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import cm_global
from manager_util import *

version = [2, 51, 8]
version = [2, 51, 9]
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')


Expand Down
28 changes: 1 addition & 27 deletions glob/manager_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,32 +1070,6 @@ async def install_model(request):
return web.Response(status=400)


class ManagerTerminalHook:
def write_stderr(self, msg):
PromptServer.instance.send_sync("manager-terminal-feedback", {"data": msg})

def write_stdout(self, msg):
PromptServer.instance.send_sync("manager-terminal-feedback", {"data": msg})


manager_terminal_hook = ManagerTerminalHook()


@PromptServer.instance.routes.get("/manager/terminal")
async def terminal_mode(request):
if not is_allowed_security_level('high'):
print(SECURITY_MESSAGE_NORMAL_MINUS)
return web.Response(status=403)

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)


@PromptServer.instance.routes.get("/manager/preview_method")
async def preview_method(request):
if "value" in request.rel_url.query:
Expand Down Expand Up @@ -1372,6 +1346,6 @@ async def get_cache(filename):
cm_global.register_extension('ComfyUI-Manager',
{'version': core.version,
'name': 'ComfyUI Manager',
'nodes': {'Terminal Log //CM'},
'nodes': {},
'description': 'It provides the ability to manage custom nodes in ComfyUI.', })

83 changes: 0 additions & 83 deletions js/terminal.js

This file was deleted.

32 changes: 0 additions & 32 deletions prestartup_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,36 +98,6 @@ def remap_pip_package(pkg):
std_log_lock = threading.Lock()


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:
Expand Down Expand Up @@ -270,11 +240,9 @@ def sync_write(self, message, file_only=False):
if self.is_stdout:
write_stdout(message)
original_stdout.flush()
terminal_hook.write_stderr(message)
else:
write_stderr(message)
original_stderr.flush()
terminal_hook.write_stdout(message)

def flush(self):
log_file.flush()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "2.51.8"
version = "2.51.9"
license = { file = "LICENSE.txt" }
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]

Expand Down

0 comments on commit 294244b

Please sign in to comment.