Nodes/Champdev Custom Nodes/Champdev Terminal
ComfyUI Node

Champdev Terminal

A real terminal inside a ComfyUI node — with the warning you'd expect

By rohit267·Created 6 months ago·Updated 8 days ago· 1
Champdev Terminal
      shell
      start_dir/tmp/ComfyUI/output

      Champdev Terminal embeds a full interactive terminal in a node's body, backed by a real pseudo-terminal on the machine running ComfyUI. Not a fake prompt that runs one canned command - a real shell. vim works. top works. ANSI colors work, resizing works, and interactive TUI programs behave like they do in a normal terminal. If you're forever switching out of ComfyUI to SSH into the box, tail a log, or pip install the one missing dependency, this puts that session inside the graph.

      How it works

      Like the pack's File Manager, the node itself is a noop - nothing flows through it. The two widgets are configuration, and the actual terminal runs on the server. The node connects to a WebSocket route (/champdev/terminal/ws), and the server spawns a PtySession: on macOS/Linux that's the Python standard library's pty module (os.forkpty under the hood), so there's no extra dependency at all. On Windows it uses pywinpty (ConPTY). It also sets TERM to match the xterm.js frontend (xterm-256color, with fallbacks), which fixes the "unknown terminal type" errors you'd otherwise get in slim containers - a detail most terminal-in-a-box tools get wrong.

      The session is fresh per connection: it starts when the terminal connects and is killed when you close the tab or reload. The ⟳ Restart button on the node starts a new shell.

      The inputs

      Two, and you can usually leave both alone:

      • shell - which shell to launch. Empty (the default) auto-detects: $SHELL or /bin/bash//bin/sh on macOS/Linux, PowerShell or cmd.exe on Windows. Set it to something specific like /usr/bin/zsh or python if you want.
      • start_dir - the working directory the shell opens in. Defaults to ComfyUI's output directory, which is honestly the right place to land.

      No outputs. It's a tool node, not part of the data flow.

      Read this before you use it

      This node is arbitrary command execution on the machine running ComfyUI, by design. That's the entire feature. So the rules are simple: local, single-user use only. Never on a network-exposed ComfyUI - no --listen, no reverse proxy, no shared host. Anyone who can reach your UI gets a shell on your machine, and there's no sandbox between "reach the web UI" and "run rm -rf as your user."

      That's not me being dramatic. ComfyUI's API is unauthenticated by default, and the ecosystem has a documented history of nodes weaponizing that trust - the LLMVISION malware in 2024 shipped through the same install channel and ended in a federal prosecution. A terminal node is the extreme end of that surface. Keep it local and you're fine; expose it and you're inviting trouble.

      Also worth knowing: the pack pings the author's telemetry server once per ComfyUI startup (device specs plus the bind port). Disable with CHAMPDEV_TELEMETRY=0.

      Install

      Easiest via ComfyUI Manager - search Champdev Custom Nodes. Manual:

      cd /path/to/ComfyUI/custom_nodes
      git clone https://github.com/rohit267/champdev-comfyui-nodes
      cd champdev-comfyui-nodes
      python -m pip install -r requirements.txt   # portable build: python_embeded\python.exe
      

      Restart ComfyUI. No models to download. On macOS/Linux the terminal uses only the standard library, so nothing extra installs. On Windows you need pywinpty, which Manager and the pip line above both handle. If it's somehow missing, the node shows the exact pip install command to run rather than a cryptic import error - that was a real fix in the pack's changelog.

      Notes from the trenches

      • No persistent shell. The session dies when you close the node or reload the page. The restart button gives you a fresh one, which is usually what you want anyway.
      • start_dir must exist or the spawn fails.
      • On Windows the default shell prefers PowerShell over cmd.exe.

      Is a terminal-in-a-node for everyone? No - but if you run ComfyUI on a box you don't want to SSH into every five minutes, this is the single most useful utility node in the pack. Just don't put it on the internet.

      Categorychamdev-nodes/utils

      Inputs (2)

      NameTypeDefaultDescription
      shellSTRING
      start_dirSTRING/tmp/ComfyUI/output

      Outputs (0)

      No outputs