Browse by type
Generate ComfyUI workflows from natural language descriptions using Large Language Models (LLMs).
This custom node enables users to describe a workflow in natural language (e.g., "Create a text-to-image workflow using SDXL") and automatically constructs the corresponding node graph. It leverages Large Language Models (LLMs) to bridge the gap between intent and execution.
This project is an independent implementation of the ComfyGPT research, designed to bring that architecture directly into ComfyUI as a native node suite.
My goal was to preserve the core functionality of the original research—specifically the multi-stage pipeline of generation, validation, and construction, while optimizing it for the local ComfyUI environment. This implementation focuses on modularity, allowing users to inspect and intervene at each stage of the generation process.
Current Limitations: The system's knowledge is bounded by its training data. While it excels at standard patterns and known nodes, it cannot inherently "know" about custom nodes released after its training cutoff without additional context. It acts as a powerful accelerator for workflow creation, but supervision is recommended.
Title: "ComfyGPT: A Self-Optimizing Multi-Agent System for Comprehensive ComfyUI Workflow Generation" - Original Repository: https://github.com/comfygpt/comfygpt - Project Website: https://comfygpt.github.io/
This implementation uses a specialized LLM fine-tuned on workflow data to execute a three-stage pipeline: 1. Generator: Interprets the natural language prompt to generate a logical graph structure (JSON). 2. Validator: Verifies node names against the local installation or semantic embeddings to ensure compatibility. 3. Builder: Compiles the validated structure into an executable ComfyUI workflow format.
The models used in this implementation are based on the original ComfyGPT research:
Quantized to GGUF format (q8_0) for efficient inference
Embedding Model: sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 (original SentenceTransformer model)
Used for semantic search in NodeValidator
NodeValidator Model: Base Qwen2.5-7B-Instruct model (not fine-tuned)
Model Repositories: - Original Models: xiatianzs/resources - Original fine-tuned models from ComfyGPT research team (HuggingFace format) - Pre-quantized GGUF Models: DanielPFlorian/comfyui-workflowgenerator-models - Ready-to-use quantized GGUF models for this implementation
Python Requirements:
- Standard ComfyUI Installation: Python 3.10 or higher must be installed separately. ComfyUI requires Python to run, so if ComfyUI is working, Python is already installed.
- Portable ComfyUI Installation: Python is included (embedded in the python_embeded folder), so no separate Python installation is needed. The custom node will use ComfyUI's embedded Python.
Note: If Git is not installed, download it from git-scm.com. You can verify Git installation by running git --version in your terminal.
Model Format Comparison:
GGUF models: Use significantly less VRAM with similar generation quality compared to HuggingFace models. Quantization (q8_0, q4_0) provides a good balance between quality and memory usage.
HuggingFace models: Use more VRAM but offer full precision. Both formats are fully supported and produce similar quality results.
Navigate to your ComfyUI custom_nodes directory and clone this repository:
cd ComfyUI/custom_nodes
git clone https://github.com/danielpflorian/ComfyUI-WorkflowGenerator.git
Install the required Python dependencies by opening your terminal inside the ComfyUI-WorkflowGenerator folder:
cd ComfyUI/custom_nodes/ComfyUI-WorkflowGenerator
pip install -r requirements.txt
For Portable ComfyUI Installations:
For portable installations, use the embedded Python from the portable ComfyUI root directory:
cd <portable_comfyui_root>
python_embeded\python.exe -s -m pip install -r ComfyUI\custom_nodes\ComfyUI-WorkflowGenerator\requirements.txt
Important: llama-cpp-python is required for GGUF models. It must be installed separately based on your system configuration.
Note: The quick install commands below may not work for all Windows/CUDA configurations. If they fail or if CUDA support isn't detected, local compilation is often necessary. See the Wiki - llama-cpp-python Installation for detailed instructions on compiling from source.
Quick install (try this first):
- CPU only: pip install llama-cpp-python
- CUDA (NVIDIA): pip install llama-cpp-python[cuda]
- Metal (macOS): pip install llama-cpp-python[metal]
For Portable ComfyUI Installations:
For portable installations, use the embedded Python from the portable ComfyUI root directory:
cd <portable_comfyui_root>
python_embeded\python.exe -s -m pip install llama-cpp-python[cuda]
Note: If you plan to use HuggingFace models instead, you can skip this step.
Copy your GGUF models and tokenizers to ComfyUI/models/LLM/:
ComfyUI/models/LLM/
├── workflow-generator-q8_0.gguf # WorkflowGenerator model
├── workflow-generator/ # WorkflowGenerator tokenizer
├── Qwen2.5-7B-Instruct-q8_0.gguf # NodeValidator model (optional)
├── Qwen2.5-7B-Instruct/ # NodeValidator tokenizer (optional)
└── paraphrase-multilingual-MiniLM-L12-v2/ # Embedding model
Restart ComfyUI to load the custom nodes. The nodes will appear in the WorkflowGenerator category.
The easiest way to get started is using the Workflow Generator Pipeline node, which processes your instruction through all three stages sequentially:
"Create a text-to-image workflow"Expected Results: - The Pipeline node automatically generates the workflow diagram, validates node names, and converts it to executable ComfyUI workflow JSON - You can save the workflow to a file for later use. By default it will be saved in comfyUI/output.
Note: For detailed documentation on individual nodes and advanced usage, see the Wiki.
This section provides a high-level overview of each node.
For more control, you can use individual nodes to inspect and modify intermediate results:
Important: Before using individual nodes or the pipeline, run the "Update Node Catalog" node first to scan and catalog all available ComfyUI nodes. This is required for proper node validation and workflow building.
Note: WorkflowGenerator, NodeValidator, and WorkflowBuilder are designed to be used in sequence. NodeValidator is optional—you can connect WorkflowGenerator directly to WorkflowBuilder if you want to skip validation.
Quick fixes:
- Models not found: Verify models are in ComfyUI/models/LLM/
- OOM errors: auto_gpu_layers is enabled by default to prevent this. If issues persist, verify your VRAM is sufficient for the model size.
- Slow performance: Use GGUF models (lower VRAM usage), disable LLM refinement
- Invalid nodes: Run Update Node Catalog node
While this implementation successfully brings the ComfyGPT architecture to ComfyUI, the rapid evolution of the generative AI landscape suggests that the next generation of workflow generation tools will need to evolve beyond static fine-tuning.
The ComfyUI custom node ecosystem changes daily. New nodes and unforeseen architectures are released constantly. A model fine-tuned on a dataset from last month (like the current WorkflowGenerator) is inherently "frozen" in time. It cannot hallucinate the correct connections for a node it has never seen during training.
To achieve true state-of-the-art performance that keeps pace with the community, future architectures should likely move toward:
Retrieval-Augmented Generation (RAG) for Nodes: Instead of baking node knowledge into the model weights, an agent could query a dynamic, vector-embedded database that includes both the user's currently installed nodes and an updated database of repositories. This allows the system to discover and use completely new nodes or updated versions directly from the internet, enabling it to "read" the documentation of a node released today and use it immediately.
Input/Output Type Awareness: The current approach uses semantic search to correct node names (e.g., matching "Load Image" to "Image Loader"). However, a robust system needs to understand I/O Schema.
LATENT output of Node A actually fit into the LATENT input of Node B?"Small Graph-Reasoning Models (SLMs): We may not need massive 70B+ parameter models for this task. Specialized, smaller models trained specifically on Graph Theory and Directed Acyclic Graphs (DAGs) could offer superior reasoning c
$ claude mcp add ComfyUI-WorkflowGenerator \
-- python -m otcore.mcp_server <graph>