Crafting high-quality prompts is essential for generating images or other content, but it can be challenging and time-consuming to find the right words, structure, or variations to achieve the desired result.
Integrating CrewAI into ComfyUI allows users to automate and refine the prompt creation process using intelligent agents. CrewAI can generate, analyze, and iteratively improve text prompts based on user input or specific goals, streamlining the creative workflow.
This project integrates CrewAI's multi-agent collaboration framework into the ComfyUI environment, combining the robust capabilities of CrewAI's role-based AI agent system with ComfyUI's intuitive drag-and-drop interface. The goal is to create a platform that simplifies the management and execution of complex AI tasks.
ComfyUI? CrewAI?
ComfyUI is The most powerful and modular stable diffusion GUI and backend. It also has an innovative and user-friendly interface designed to streamline the creation and management of image and video creation workflows. Utilizing a drag-and-drop system, ComfyUI allows users to effortlessly design, visualize, and iterate over complex multi-agent tasks without deep technical knowledge. It supports a wide range of custom nodes and models, making it highly versatile for various AI applications.
CrewAI is an advanced framework that facilitates the collaboration of AI agents. It enables agents to assume specific roles, share common objectives, and function as a cohesive unit. This setup is ideal for building smart assistant platforms, automated customer service systems, and multi-agent research teams.
- Role-Based Agent Design: Customize agents with specific roles, goals, and tools.
- Autonomous Inter-Agent Delegation: Agents can delegate tasks and request assistance from peers.
- Flexible Task Management: Define and dynamically assign tasks to agents.
- Integration with Various LLMs: Supports local and remote language models like OpenAI, Mistral, and others.
- Sequential and Hierarchical Processes: Offers structured task execution models.
Integrating CrewAI with ComfyUI provides a powerful, user-friendly interface for prototyping and deploying AI agent workflows. ComfyUI's drag-and-drop system makes it easy to design and visualize complex multi-agent tasks.
- Streamlined Workflow Design: Easily create and manage AI workflows.
- Enhanced Collaboration: Leverage CrewAI's collaborative AI capabilities.
- Seamless Model Integration: Support for various LLMs, including local models via Ollama.
- Scalable and Flexible: Ideal for prototyping and scaling AI solutions.
- Create Agents: Define agents with specific roles and backstories.
- Define Tasks: Set tasks with clear descriptions and expected outputs.
- Setup the Crew: Use the Crew node to manage agents and tasks, choose the execution process (sequential or hierarchical).
- Run and Monitor: Execute the workflow and monitor progress through verbose logging. Adjust settings and parameters to optimize performance.
Easy Install: Use the ComfyUI Manager to automate the installation process.
Manual Install:
- Clone the repository into the custom_nodes directory:
git clone https://github.com/luandev/ComfyUI-CrewAI.git
- Install the requirements (ensure your virtual environment is activated if using one):
pip install -r requirements.txt
To maintain code quality, we use flake8
for linting. We use pre-commit hooks to lint the staged files before committing:
-
To run
pre-commit
manually:pre-commit run --all-files
-
Run
flake8
manually:flake8
- Agent Node: Defines an agent with a specific role and goal.
- Usage: Customize the agent by setting attributes such as role, goal, backstory, and tools.
- Task Node: Specifies a task for an agent to perform.
- Usage: Define the task description, expected output, and assign it to an agent.
- Crew Node: Manages a group of agents and tasks, coordinating their execution.
- Usage: Set up the crew with defined agents and tasks, and choose the process type (sequential or hierarchical).
- Text Node: Can display and safe text strings, good for debugging
Contributions are welcome! Please read the contributing guidelines first.
This project is licensed under the MIT License - see the LICENSE file for details.
Special thanks to the developers of ComfyUI and CrewAI for their amazing tools.
Feel free to suggest improvements or report issues here.