Nodes/ComfyUI-WorkflowGenerator/Workflow Generator Pipeline
ComfyUI Node

Workflow Generator Pipeline

WG_Pipeline Does the Whole ComfyUI Job

By DanielPFlorian·Created 9 months ago·Updated 9 months ago· 41
Workflow Generator Pipeline
    • workflow_edges
    • workflow_edges (refined)
    • workflow_json
    • file_path
    instruction
    model_pathworkflow-generator-q8_0.gguf
    dtypeauto
    device_preferenceauto
    attn_implementationauto
    auto_gpu_layerstrue
    n_gpu_layers-1
    max_new_tokens8192
    context_size4096
    temperature0.95
    top_p0.70
    allow_primitive_nodesfalse
    refine_enabledtrue
    use_llm_refinementfalse
    refine_model_pathQwen2.5-7B-Instruct-q8_0.gguf
    embedding_model_pathparaphrase-multilingual-MiniLM-L12-v2
    catalog_directorycatalog
    refine_dtypeauto
    refine_device_preferenceauto
    refine_attn_implementationauto
    refine_auto_gpu_layersfalse
    refine_n_gpu_layers-1
    refine_max_new_tokens4096
    refine_context_size4096
    refine_temperature0.95
    top_k5
    refine_top_p0.70
    save_workflowtrue
    filename_prefixgenerated_workflow
    seed0

    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

    1. cd ComfyUI/custom_nodes && git clone https://github.com/DanielPFlorian/ComfyUI-WorkflowGenerator
    2. pip install -r requirements.txt (sentence-transformers, tinydb, scikit-learn, omegaconf)
    3. Install llama-cpp-python for your GPU. If the quick install fails, expect to compile from source - the wiki has the full walkthrough.
    4. Copy the models into ComfyUI/models/LLM/: the workflow generator GGUF plus its tokenizer folder, the optional 7B validator model, and the embedding model.
    5. Run UpdateNodeCatalog once before anything else. No catalog, no validation, no workflow.
    6. 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 in models/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-python won'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_layers is 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.

    CategoryWorkflowGenerator

    Inputs (30)

    NameTypeDefaultDescription
    instructionSTRINGDescription of the desired ComfyUI workflow.
    model_pathCOMBOworkflow-generator-q8_0.ggufModel file (GGUF) or directory (HuggingFace).
    dtypeCOMBOautoData type (HuggingFace only).
    device_preferenceCOMBOautoDevice preference (cuda/cpu).
    attn_implementationCOMBOautoAttention implementation (HuggingFace).
    auto_gpu_layersBOOLEANtrueAuto-calculate GPU layers based on available VRAM (prevents OOM errors) (GGUF).
    n_gpu_layersINT-1-1–1000Number of GPU layers (GGUF). -1 for all.
    max_new_tokensINT81921–32768Max tokens to generate.
    context_sizeINT4096512–131072Context window size (GGUF).
    temperatureFLOAT0.950–2Sampling temperature.
    top_pFLOAT0.700–1Top-p sampling.
    allow_primitive_nodesBOOLEANfalseInclude primitive nodes in diagram. False removes them for cleaner workflows.
    refine_enabledBOOLEANtrueEnable Step 2 (NodeValidator).
    use_llm_refinementBOOLEANfalseEnable LLM-based node correction (slower but more accurate).
    refine_model_pathCOMBOQwen2.5-7B-Instruct-q8_0.ggufLLM model for refinement.
    embedding_model_pathCOMBOparaphrase-multilingual-MiniLM-L12-v2Embedding model for semantic search.
    catalog_directorySTRINGcatalogDirectory containing node catalog files.
    refine_dtypeCOMBOautoData type for refinement model (HuggingFace).
    refine_device_preferenceCOMBOautoDevice preference for refinement model.
    refine_attn_implementationCOMBOautoAttention implementation for refinement model.
    refine_auto_gpu_layersBOOLEANfalseAuto-calculate GPU layers for refinement model (GGUF).
    refine_n_gpu_layersINT-1-1–1000GPU layers for refinement model (GGUF). -1 for all.
    refine_max_new_tokensINT40961–16384Max tokens for refinement.
    refine_context_sizeINT4096512–32768Context window size for refinement model (GGUF).
    refine_temperatureFLOAT0.950–2Temperature for refinement.
    top_kINT51–20Number of similar nodes to consider.
    refine_top_pFLOAT0.700–1Top-p for refinement.
    save_workflowBOOLEANtrueSave workflow to file.
    filename_prefixSTRINGgenerated_workflowFilename prefix or path for saved workflow.
    seedINT00–4294967295Random seed.

    Outputs (4)

    NameTypeDescription
    workflow_edgesSTRINGInitial workflow diagram (JSON).
    workflow_edges (refined)STRINGRefined workflow diagram (JSON).
    workflow_jsonSTRINGFinal ComfyUI workflow JSON.
    file_pathSTRINGPath to saved file.