luandev / ComfyUI-CrewAI

This project aims to integrate Crew AI's multi-agent collaboration framework into the ComfyUI environment. By combining the strengths of Crew AI's role-based, collaborative AI agent system with ComfyUI's intuitive interface, we will create a robust platform for managing and executing complex AI tasks seamlessly
MIT License
15 stars 4 forks source link

📎ComfyUI-CrewAI

View of the nodes


Build Status

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? ## About ComfyUI [ComfyUI](https://github.com/comfyanonymous/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. ## About CrewAI [CrewAI](https://www.crewai.com/) 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. ![How CrewAI works diagram](./docs/crewai.png) ### Key Features - **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.

Integration with ComfyUI

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.

Benefits of Integration

How It Works

  1. Create Agents: Define agents with specific roles and backstories.
  2. Define Tasks: Set tasks with clear descriptions and expected outputs.
  3. Setup the Crew: Use the Crew node to manage agents and tasks, choose the execution process (sequential or hierarchical).
  4. Run and Monitor: Execute the workflow and monitor progress through verbose logging. Adjust settings and parameters to optimize performance.

Installation 🛠️

Easy Install: Use the ComfyUI Manager to automate the installation process.

Manual Install:

  1. Clone the repository into the custom_nodes directory:
    git clone https://github.com/luandev/ComfyUI-CrewAI.git
  2. Install the requirements (ensure your virtual environment is activated if using one):
    pip install -r requirements.txt

Linting and Code Quality

To maintain code quality, we use flake8 for linting. We use pre-commit hooks to lint the staged files before committing:

  1. To run pre-commit manually:

    pre-commit run --all-files 
  2. Run flake8 manually:

    flake8

    Current Nodes

    • 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).

Coming Soon

Contributing 🤝

Contributions are welcome! Please read the contributing guidelines first.

License 📄

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

Special thanks to the developers of ComfyUI and CrewAI for their amazing tools.


Feel free to suggest improvements or report issues here.