Workflow Generator Pipeline
WG_Pipeline Does the Whole ComfyUI Job
- workflow_edges
- workflow_edges (refined)
- workflow_json
- file_path
Type "create a text-to-image workflow using SDXL" and get a loadable ComfyUI workflow out the other end. That's the whole pitch of the Workflow Generator Pipeline node - it's the one box you actually need from this pack, because it runs all three stages (generate → validate → build) in sequence and hands you a JSON file you can drag back into ComfyUI. The other four nodes exist so you can peek inside; this one exists so you don't have to.
It's not magic, and it's worth knowing that before you get mad at it. This pack is an independent implementation of the ComfyGPT research by DanielPFlorian, so the pipeline mirrors the paper's agents: a fine-tuned Qwen2.5-14B model (quantized to GGUF q8_0, which as a format is essentially fp16 at roughly half the size) turns your instruction into a JSON list of node connections, a validator checks every node name against the catalog of what's actually installed on your machine, and a builder compiles the corrected diagram into executable workflow JSON. The one dependency that bites people hardest is llama-cpp-python, which isn't in requirements.txt because it needs a per-system build - install it separately (pip install llama-cpp-python[cuda] on NVIDIA, [metal] on Apple Silicon, or plain CPU).
Setup, the honest version
cd ComfyUI/custom_nodes && git clone https://github.com/DanielPFlorian/ComfyUI-WorkflowGeneratorpip install -r requirements.txt(sentence-transformers, tinydb, scikit-learn, omegaconf)- Install
llama-cpp-pythonfor your GPU. If the quick install fails, expect to compile from source - the wiki has the full walkthrough. - Copy the models into
ComfyUI/models/LLM/: the workflow generator GGUF plus its tokenizer folder, the optional 7B validator model, and the embedding model. - Run UpdateNodeCatalog once before anything else. No catalog, no validation, no workflow.
- Restart ComfyUI.
ComfyUI Manager can do the clone + requirements for you if you search "ComfyUI-WorkflowGenerator", but it won't install llama-cpp-python or download the models. The models live on HuggingFace under DanielPFlorian/comfyui-workflowgenerator-models, and the 14B GGUF is a chunky download, so budget for that.
The inputs that actually matter
This node is one giant input form - 30 fields, most of which you will never touch. Here's the short list:
- instruction - your workflow description. Be specific. "Create a text-to-image workflow using SDXL with a refiner" beats "make an image" by a mile.
- model_path - defaults to
workflow-generator-q8_0.gguf; the dropdown is populated from whatever's inmodels/LLM/. - refine_enabled - keeps Step 2 (validation) on. Leave it on.
- use_llm_refinement - off by default, meaning the validator uses fast semantic search. Flip it on only if node names are coming out wrong; it loads a second 7B model and slows everything down.
- save_workflow / filename_prefix - saves the result as
generated_workflow_001.json(counter auto-increments) in your ComfyUI output folder. - seed - same seed + same instruction = same workflow. Bump it to re-roll.
Outputs: the raw workflow_edges diagram, the workflow_edges (refined) after validation, the final workflow_json (wire this to a Save Text node if you want it pasted elsewhere), and file_path.
Where people get burned
- "Model not found" - the file isn't in
models/LLM/, or you didn't restart after moving it there. llama-cpp-pythonwon't install - the most common complaint in the repo's docs. Try the force-reinstall flags in the wiki before giving up; Windows/CUDA combos almost always need local compilation.- OOM on load -
auto_gpu_layersis on by default to keep the 14B under your VRAM. If it still blows up, drop to semantic-only validation and consider a smaller quant. - Generated workflow references nodes you don't have - the model's training data (about 13,000 workflows, mostly SD 1.5/SDXL/SVD era) predates half of your custom nodes. Run UpdateNodeCatalog after installing new packs, and treat every output as a draft to supervise, not gospel.
It's a time-saver and a scaffold, not a replacement for knowing your own graph. But for going from a sentence to something loadable, it's genuinely the closest thing to a "just works" button this pack offers.
Inputs (30)
| Name | Type | Default | Description |
|---|---|---|---|
| instruction | STRING | Description of the desired ComfyUI workflow. | |
| model_path | COMBO | workflow-generator-q8_0.gguf | Model file (GGUF) or directory (HuggingFace). |
| dtype | COMBO | auto | Data type (HuggingFace only). |
| device_preference | COMBO | auto | Device preference (cuda/cpu). |
| attn_implementation | COMBO | auto | Attention implementation (HuggingFace). |
| auto_gpu_layers | BOOLEAN | true | Auto-calculate GPU layers based on available VRAM (prevents OOM errors) (GGUF). |
| n_gpu_layers | INT | -1-1–1000 | Number of GPU layers (GGUF). -1 for all. |
| max_new_tokens | INT | 81921–32768 | Max tokens to generate. |
| context_size | INT | 4096512–131072 | Context window size (GGUF). |
| temperature | FLOAT | 0.950–2 | Sampling temperature. |
| top_p | FLOAT | 0.700–1 | Top-p sampling. |
| allow_primitive_nodes | BOOLEAN | false | Include primitive nodes in diagram. False removes them for cleaner workflows. |
| refine_enabled | BOOLEAN | true | Enable Step 2 (NodeValidator). |
| use_llm_refinement | BOOLEAN | false | Enable LLM-based node correction (slower but more accurate). |
| refine_model_path | COMBO | Qwen2.5-7B-Instruct-q8_0.gguf | LLM model for refinement. |
| embedding_model_path | COMBO | paraphrase-multilingual-MiniLM-L12-v2 | Embedding model for semantic search. |
| catalog_directory | STRING | catalog | Directory containing node catalog files. |
| refine_dtype | COMBO | auto | Data type for refinement model (HuggingFace). |
| refine_device_preference | COMBO | auto | Device preference for refinement model. |
| refine_attn_implementation | COMBO | auto | Attention implementation for refinement model. |
| refine_auto_gpu_layers | BOOLEAN | false | Auto-calculate GPU layers for refinement model (GGUF). |
| refine_n_gpu_layers | INT | -1-1–1000 | GPU layers for refinement model (GGUF). -1 for all. |
| refine_max_new_tokens | INT | 40961–16384 | Max tokens for refinement. |
| refine_context_size | INT | 4096512–32768 | Context window size for refinement model (GGUF). |
| refine_temperature | FLOAT | 0.950–2 | Temperature for refinement. |
| top_k | INT | 51–20 | Number of similar nodes to consider. |
| refine_top_p | FLOAT | 0.700–1 | Top-p for refinement. |
| save_workflow | BOOLEAN | true | Save workflow to file. |
| filename_prefix | STRING | generated_workflow | Filename prefix or path for saved workflow. |
| seed | INT | 00–4294967295 | Random seed. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| workflow_edges | STRING | Initial workflow diagram (JSON). |
| workflow_edges (refined) | STRING | Refined workflow diagram (JSON). |
| workflow_json | STRING | Final ComfyUI workflow JSON. |
| file_path | STRING | Path to saved file. |