Nodes/NodeGPT/UserProxy
ComfyUI Node

UserProxy

The agent that actually runs the code in NodeGPT

By antonym-git·Created 3 years ago·Updated 2 years ago· 355
UserProxy
  • LLM
  • User
nameUser
human_input_modeTERMINATE
system_messageReply TERMINATE if the task has been solved at full satisfaction. Otherwise, reply CONTINUE, or the reason why the task is not solved yet.
default_auto_replyReply TERMINATE if you are done
code_executionTrue
code_execution_dircoding
MaxConsecutiveAutoReply10
Terminate_TokenTERMINATE

Here's the thing everyone misses about AutoGen: the "AI" that writes the code is only half of it. Somebody has to run the code, see what broke, and hand the error back so the AI can fix it. In NodeGPT - xXAdonesXx's 2023 AutoGen-inside-ComfyUI pack - that somebody is UserProxy.

It's the node that makes the pack's flagship trick possible: an agent chain that solves a coding task by writing code, executing it, and debugging itself until it works. Scientist writes the plan and the code; UserProxy is the hands that execute it and report back.

How it works

UserProxy is a wrapper around AutoGen's UserProxyAgent - the "user" half of a conversation that, unusually for something labeled "user," can be fully autonomous. When it receives a message containing code, it writes it to a work directory, runs it, and returns the stdout (or the traceback) to the sender. That's the debugging loop: Scientist produces code, UserProxy runs it, Scientist sees the error and fixes it, repeat until someone says TERMINATE.

Its output, User, feeds the pack's Chat node (User input), which calls user.initiate_chat(agent, message=Task) - that one call starts the whole multi-turn conversation.

The inputs that matter

  • code_execution (string, default "True") - turns code running on or off. If you turn it off, you've gutted the pack's main feature and are just left with two agents talking.
  • code_execution_dir (default coding) - where generated scripts land and run. Relative to where ComfyUI was launched, which is easy to lose track of.
  • MaxConsecutiveAutoReply (default 10) - how many auto-replies the proxy will make before it stops. Your real "how far will this loop run" dial. If a task never terminates, lower this.
  • human_input_mode (default TERMINATE) - TERMINATE means never ask a human, just end the conversation when the task looks done. That's the setting that makes the whole thing run hands-free.
  • Terminate_Token (default TERMINATE) - the exact string that ends the loop.
  • default_auto_reply - what the proxy says when it has nothing better to say.
  • LLM (optional) - give the proxy its own model and it can generate replies instead of falling back to the default. For a pure code-runner you can leave it empty.

Install

Same as the rest of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/xXAdonesXx/NodeGPT

Restart and ComfyUI attempts the dependency install on first boot (pyautogen, llama-cpp-python, pymemgpt). It may not get far: the repo now returns 404 - the pack is abandoned, and the clone can fail outright. The Wayback Machine's June 2025 snapshot still has the source if you're determined.

Common issues

Two things bite people. First, the auto-installer is Windows-only (it runs install.bat and builds a venv), so on Linux/macOS the nodes often fail to import autogen and simply don't show up - install pyautogen into ComfyUI's environment by hand. Second, the README's warning: don't share workflows with API keys in them. This pack reads keys from plain text files, and a shared workflow will happily leak them.

And one thing that should bother you, not just inconvenience you: UserProxy executes arbitrary generated code on your machine. That's the feature, and it's also the risk. The generated code runs in a folder called coding/ next to your ComfyUI, but there's no sandbox - a malicious or just stupid prompt can produce code that does real damage. If you install NodeGPT, keep it pointed at a test environment.

Fun idea, dead project. If you want a hands-free LLM that runs and debugs its own code, the concept lives on in better-maintained tools; UserProxy is the original, and it still works - when it works.

CategoryAutoGen

Inputs (9)

NameTypeDefaultDescription
nameSTRINGUser
human_input_modeSTRINGTERMINATE
system_messageSTRINGReply TERMINATE if the task has been solved at full satisfaction. Otherwise, reply CONTINUE, or the reason why the task is not solved yet.
default_auto_replySTRINGReply TERMINATE if you are done
code_executionSTRINGTrue
code_execution_dirSTRINGcoding
MaxConsecutiveAutoReplyINT10
Terminate_TokenSTRINGTERMINATE
LLMoptLLM

Outputs (1)

NameTypeDescription
UserUser