ComfyUI Node

Terminal

HotReload_Terminal Explained

By LAOGOU-666·Created 2 years ago·Updated 7 months ago· 324
Terminal

      If you develop custom nodes, you know the grind: edit a Python file, restart ComfyUI, wait for your models to load, run the workflow, find the bug, repeat. That loop is why ComfyUI-LG_HotReload exists - it watches your custom_nodes directory and reloads changed node code without a restart. And this node, HotReload_Terminal, is the thing that makes that workflow actually usable. It's a live view of ComfyUI's console log rendered as a widget on the canvas, so when your reloaded node throws an error, you see it in the graph instead of squinting at a terminal window that may have scrolled past it.

      The pack's README says it "has no physical nodes" - that's the one thing in it I'd argue with. HotReload_Terminal is the single node it ships, and it exists for a very specific reason: the author credits @Mo-enen for fixing the bug where the system terminal output gets lost after a hot reload. When code reloads under you, your console window becomes unreliable. This node sidesteps that by watching the log file directly.

      How it works

      This is a pure display node. It has zero inputs and zero outputs - check the schema, it's just an empty optional dict and an empty return type. You drop it on the canvas like a monitor, not a processor.

      Under the hood there's a background thread that tails ComfyUI's log file - user/comfyui_<port>.log, port being whatever your server runs on - and pushes new lines to the frontend over a websocket message. The node's widget keeps the last 1024 lines, auto-scrolls to the bottom, and gives you a Clear button when the noise gets too thick. New lines are picked up once a second, with some timestamp cleanup so you don't get millisecond spam. The thread starts when the pack loads, so you don't even need the node on the canvas to collect log data - but you do need it to see it.

      There's also a deeper connection to the pack's reload engine: when your node code changes, LG_HotReload calls ComfyUI's load_custom_node again, swaps the old node class for the new one, and even patches the execution cache so stale results don't stick around. The Terminal node is your window into whether that all succeeded - you'll see the [LG_HotReload] reload messages and any traceback from your own code right here.

      Install

      The pack itself is the install, and it's light. requirements.txt is a single dependency: watchdog, which powers the file watching.

      cd ComfyUI/custom_nodes
      git clone https://github.com/LAOGOU-666/ComfyUI-LG_HotReload.git
      cd ComfyUI-LG_HotReload
      pip install -r requirements.txt
      

      Then restart ComfyUI once, and you're done. ComfyUI Manager users can just search "ComfyUI-LG_HotReload" and hit install. No model files, no API keys, no config to set up out of the box.

      Gotchas

      • Blank terminal, no text. The node reads user/comfyui_<port>.log. If that file doesn't exist, or your port changed, you get nothing. Check the file exists in your user directory - if it's missing, the node has nothing to tail.
      • This is a dev tool. The README says it plainly: use it while developing, be cautious in production. Hot reload is a convenience, not a guarantee. Complex changes - new dependencies, changed class names in ways the loader can't track - will still need a full restart.
      • Syntax errors break the reload. The pack reloads whatever you saved, so a broken file can fail the reload and leave a node in a half-registered state. Keep an editor with linting on while you iterate.
      • Heavy nodes can fight the reloader. The pack ships a default exclude list (rgthree, Manager, KJNodes, and friends) and a Settings → HotReload panel to add your own. If a big pack is misbehaving during reloads, exclude it there.

      It's a niche node for a niche crowd - but if you're the person editing custom node Python all day, it's the difference between a ten-second iteration loop and a two-minute restart loop. That's the whole game.

      CategoryHotReload

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs