Nodes/ComfyUI CrewAI/📎CrewAI Agent
ComfyUI Node

📎CrewAI Agent

Give your prompt-writer a role, a goal, and a backstory

By luandev·Created 2 years ago·Updated 2 years ago· 63
📎CrewAI Agent
  • llm
  • agent
â—„roleâ–º
â—„goalâ–º
â—„backstoryâ–º
â—„verbosefalseâ–º
â—„allow_delegationfalseâ–º

CrewAI's whole trick is that agents are just LLMs with a persona bolted on. This node is where you write the persona. In the context of this pack, the agent is a character whose job is to produce image prompts - a creative director, a prompt engineer, a critic - and the quality of your final prompt lives or dies on how you fill in these three boxes.

Three required multiline fields, straight from CrewAI's own Agent constructor:

  • role - who the agent is. "Creative Director", "Negative Prompt Specialist". One or two words beats a paragraph.
  • goal - what it's trying to achieve, stated as an imperative. "Write punchy, detailed prompts for a photorealistic model."
  • backstory - the context that shapes its voice. CrewAI genuinely leans on this; give it a sentence or two about the style, the model, the workflow.

Then three optional inputs:

  • llm (CREWAI_LLM) - wire any of the pack's four LLM nodes in here. Leave it unwired and CrewAI falls back to its default model, which still needs an OpenAI-style key in the environment.
  • verbose (bool) - prints the agent's full config and its internal reasoning to the ComfyUI console. Turn it on once to see what's happening, then turn it off; it makes the logs enormous on a multi-agent crew.
  • allow_delegation (bool) - lets this agent hand subtasks to other agents in the crew. Leave it off until you actually have a crew worth delegating to.

The output is one agent (CREWAI_AGENT), which you feed into a 📎CrewAI Task node's agent input and/or into the 📎CrewAI Agent List when you want multiple agents in one crew.

How it actually works

The node is nearly a straight pass-through: it builds Agent(role=..., goal=..., backstory=..., verbose=..., allow_delegation=...) and passes the object along. Nothing happens at this node - no calls to a model, no output text. The agent only starts "thinking" when the 📎CrewAI Crew node runs and assigns it tasks. So a lone Agent node in your graph is inert, which trips people up. The execution order is: LLM → Agent → Task → Crew, and the Crew is where the cost lands.

Getting the most out of it

The same agent can be wired to several tasks, which is the standard pattern here - one "creative director" agent handling both the positive-prompt task and the negative-prompt task is fine. And because this pack's 📎CrewAI Task node hard-codes a structured output of positive_prompt/negative_prompt, your agent's goal and backstory should keep telling it that its deliverable is a prompt pair. Tell it the checkpoint or model you're targeting (the example workflow says "dreamshaper_8") - a model-aware agent writes better prompts than a generic one.

Install the pack via ComfyUI Manager (search "ComfyUI-CrewAI") or clone https://github.com/luandev/ComfyUI-CrewAI into custom_nodes and pip install -r requirements.txt (which installs CrewAI itself). No model downloads. One small quirk worth knowing: the category this node lives under is typed "📎CrewAi" in the source - a cosmetic typo, but it means the node can show up under a slightly differently-spelled category in your node menu than its siblings. Harmless, just don't go hunting for a missing node.

Category📎CrewAi

Inputs (6)

NameTypeDefaultDescription
roleSTRING—
goalSTRING—
backstorySTRING—
llmoptCREWAI_LLM—
verboseoptBOOLEANfalse—
allow_delegationoptBOOLEANfalse—

Outputs (1)

NameTypeDescription
agentCREWAI_AGENT—