Scientist
The code-writing AutoGen agent hiding inside ComfyUI
- LLM
- Agent
Scientist is not a diffusion node. It doesn't touch a checkpoint, it won't change a single pixel, and no amount of seed-scrolling will alter an image. What it does is weirder and older: it stuffs a whole large-language-model agent - Microsoft AutoGen's "scientist" role - into one ComfyUI node, so you can drop an LLM that reasons, writes code, and iterates on a task into the same graph as your KSampler.
This is the brain of NodeGPT, xXAdonesXx's abandoned 2023 experiment in bolting AutoGen onto ComfyUI. The pack's flagship workflow (Task_Solving_with_Code_Generation.json) uses Scientist as the thinker: it plans, writes code, and fixes its own mistakes while another node actually runs the code. That loop is the entire point.
How it works
You feed Scientist an LLM object produced by the pack's own API nodes - LM_Studio, ChatGPT, Ollama, oobaboogaOpenAI. LM Studio is what the README recommends, because it runs a local OpenAI-compatible server and needs no key. The node wraps that connection into an AutoGen agent with a scientist persona baked in. There's no system_message input to edit, so you don't tune its personality - you tune its sampling. The persona is the classic AutoGen code-solver: propose a plan, write code, react to what actually happened when the code runs.
In a normal workflow, Scientist's output goes to a UserProxy node, which executes the generated code, captures stdout and tracebacks, and feeds them back so Scientist can debug its own work. The conversation bounces until somebody says TERMINATE. ComfyUI is just the wiring harness for that hand-off.
The inputs that matter
- LLM (required) - the model connection from the pack's API nodes.
- Temp - default 0. Near-deterministic, which is what you want while an agent is looping and debugging. Crank it up only if the scientist starts repeating itself.
- Seed (default 42) - honored on the local llama.cpp backend. OpenAI-compatible servers like LM Studio don't reliably reproduce seeds, so don't expect repeatable runs there.
- request_timeout (default 120) - seconds to wait for a reply. If you're running a big model on CPU, bump this. Slow local models will sail past 120 seconds and you'll get timeouts instead of answers.
The output
Agent - a Scientist object, not text. It plugs into the pack's Chat node (the Agent input), which is what actually starts the conversation: User initiates chat with this agent, sends the task, and the loop begins.
Install
The pack-wide install, straight from the README:
cd ComfyUI/custom_nodes
git clone https://github.com/xXAdonesXx/NodeGPT
Restart ComfyUI and it tries to install requirements on first boot (pyautogen, llama-cpp-python, pymemgpt, and a couple of pins). ComfyUI Manager should also find it if you search "NodeGPT". One honest caveat: the repo link currently returns 404 - the account went dark and the pack is unmaintained. If the clone fails, that's why; the source survives in the Wayback Machine's June 2025 snapshot.
Common issues
Scientist is useless on its own - if nothing happens after you run it, you've forgotten the rest of the chain (UserProxy + Chat). And remember the README's own note: output prints to the terminal, not the ComfyUI UI, so watch your console.
The pack's auto-installer is Windows-centric (it runs install.bat and builds a venv). On Linux or macOS that step silently fails, autogen never lands, and the nodes don't appear at all. Fix it by installing pyautogen into ComfyUI's Python environment yourself, or creating the pack's venv by hand. And heed the README's warning: don't share workflows containing API keys - the pack reads keys from plain-text files.
Honest verdict: this is a museum piece, not a daily driver. But the idea it demonstrated - an LLM agent that writes, executes, and debugs code inside a node graph - is exactly what modern ComfyUI LLM nodes grew up to do. Scientist is worth a run for the history lesson and the "wait, it actually solved that" moment. Just know what you're installing.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| LLM | LLM | — | |
| Seedopt | INT | 42 | — |
| Tempopt | INT | 0 | — |
| request_timeoutopt | INT | 120 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Agent | Agent | — |