1. WorkflowGenerator
The LLM That Turns a Sentence Into a Node Graph (Step 1)
- workflow_edges
- instruction
This is the node that does the actual "AI" part of this pack: it reads a plain-English description of a workflow and writes out a structured plan for one. It's labeled "1. WorkflowGenerator" because it's the first stage of a three-node chain (generate → validate → build), part of DanielPFlorian's implementation of the ComfyGPT research paper. If you just want results, skip straight to the WG_Pipeline node, which chains all three stages for you. Reach for this one only when you want to see and edit the intermediate diagram before it gets compiled.
How it works
The WorkflowGenerator runs a fine-tuned Qwen2.5-14B model that was trained on FlowDataset - roughly 13,000 workflow-description pairs from the ComfyGPT paper. The model is not instruction-tuned in the usual sense; it was fine-tuned on a specific prompt template, and the node reproduces that exact format ("generate a JSON example of the required ComfyUi workflow. description:") so the output matches what it learned.
The clever bit, borrowed from the paper: it doesn't try to generate an entire workflow at once. It emits a JSON list of edges - tuples of the form (source node, source output, target node, target input) - which is a much smaller, more learnable unit than a full graph, and far easier for the next two stages to validate. The GGUF q8_0 quantization means a 14B model that stays in a reasonable amount of VRAM; q8 is effectively fp16 at half the size.
The inputs that matter
There are sixteen inputs, but only a few you'll touch:
- instruction - your description, in a multiline box. This is the whole job. More detail = better graph: mention the checkpoint, the sampler, the upscaler, anything you'd care about in a real workflow.
- allow_primitive_nodes - off by default and you should keep it off. Primitive nodes (CLIP Text Encode, Load Image, that sort of thing) get inlined as widget values, leaving a cleaner diagram. Turn it on only if you specifically want every input as an explicit node.
- seed - same seed, same instruction, same output. Change it to re-roll a bad result instead of rewriting your prompt.
- model_path - dropdown of whatever's in
ComfyUI/models/LLM/, defaulting toworkflow-generator-q8_0.gguf. - temperature / top_p / max_new_tokens - sampling knobs. Defaults (0.95 / 0.7 / 8192) are fine; lower temperature if you want more deterministic output.
The rest split into two families: the GGUF knobs (auto_gpu_layers, n_gpu_layers, context_size, use_mmap, use_mlock, n_batch, n_threads) and the HuggingFace-family knobs (dtype, attn_implementation, device_preference) which only apply if you load a full-precision model instead of a GGUF. auto_gpu_layers is on by default so the model doesn't OOM your card - leave it.
Outputs
- workflow_edges - the generated diagram as a JSON string. Wire this into NodeValidator (Step 2) or straight into WorkflowBuilder (Step 3) if you want to skip validation.
- instruction - a pass-through of your original text. Wire it into NodeValidator's
instructioninput so the validator knows the context when it corrects node names.
Install & expectations
Clone the pack into custom_nodes, run pip install -r requirements.txt, install llama-cpp-python separately (it's not in the requirements - CUDA builds often need compiling from source; the repo wiki has the steps), and drop the GGUF plus its tokenizer folder into ComfyUI/models/LLM/. Run UpdateNodeCatalog before your first generation so downstream stages know what nodes exist.
Then set your expectations: the model is biased toward the workflow patterns it trained on (mostly SD 1.5 / SDXL / SVD), so it will happily hallucinate node names for custom packs released after 2024. That's not a bug in your setup - it's what Step 2 exists for. If a diagram comes out wrong, re-roll the seed or reword the instruction rather than fighting the output; and remember the README's own caveat that this is an accelerator, not an oracle. You're supervising a draft, not getting a finished workflow.
Inputs (17)
| 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). |
| use_mmap | BOOLEAN | true | Use memory-mapped loading (GGUF). |
| use_mlock | BOOLEAN | false | Lock memory to prevent swapping (GGUF). |
| n_batch | INT | 51232–2048 | Batch size for prompt processing (GGUF). |
| n_threads | COMBO | Auto | CPU threads for inference (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 (recommended) removes them for cleaner workflows. |
| seed | INT | 00–4294967295 | Random seed. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| workflow_edges | STRING | Generated workflow diagram (JSON). |
| instruction | STRING | Original instruction text (pass to Step 2). |