2. NodeValidator (Optional)
The Referee That Stops Your Generated Workflow from Being Full of Ghost Nodes
- workflow_edges (refined)
- llm_prompts (debug)
- candidate_nodes (debug)
The middle stage of the WorkflowGenerator chain - labeled "2. NodeValidator (Optional)" - and the one that deserves its "optional" tag more than any other node in the pack. Step 1's language model is trained on roughly 13,000 workflows from a 2024-era snapshot of the ecosystem, so it will happily write down node names that either don't exist or don't exist on your machine. NodeValidator is the referee that checks every name in the diagram against the catalog of what's actually installed and corrects the misses. It's the difference between a generated workflow that loads and one that opens as a wall of "unknown node" errors.
How it works: two modes
The node runs in two modes, and the default is the smart one.
Semantic search only (use_llm_refinement off - the default). Every node name in your diagram gets embedded with a sentence-transformers model (paraphrase-multilingual-MiniLM-L12-v2, a small multilingual embedding model) and compared against the names in your node catalog using cosine similarity. For each miss it proposes up to top_k (default 5) candidates. This is how "Load Image" becomes "Image Loader" and "Text Encode" becomes "CLIP Text Encode (Prompt)". It's fast, deterministic, and runs fine on CPU - no LLM needed.
LLM refinement (use_llm_refinement on). For the misses that semantic similarity can't confidently fix, it loads a Qwen2.5-7B-Instruct model (GGUF, also q8_0) and asks the LLM to pick the right node, optionally using your original instruction as context. Slower - it's a second model load and second inference pass - but noticeably more accurate on ambiguous names. You only need the 7B model file if you enable this; semantic-only mode works without it.
Both modes need the catalog files (node_list.json + node_info.json), which is why the pack insists you run UpdateNodeCatalog first.
Inputs and outputs
- workflow_edges - the diagram from Step 1. Required.
- instruction - optional context for LLM refinement. Wire the
instructionoutput of WorkflowGenerator here, or add your own guidance ("use the Wan video nodes"). - use_llm_refinement - the big toggle. Off = fast semantic search; on = slower but sharper.
- top_k - how many candidate nodes to consider per miss.
- embedding_model_path - defaults to the MiniLM model in
models/LLM/. - catalog_directory - where the catalog lives;
catalogby default.
Outputs: workflow_edges (refined) (the corrected diagram - wire this into WorkflowBuilder), plus two debug outputs, llm_prompts and candidate_nodes, which show you what was sent to the LLM and which nodes it considered. Ignore those unless you're debugging.
Install and the honest caveats
Same pack install as the others: clone into custom_nodes, pip install -r requirements.txt, and drop the embedding model (and optionally the 7B validator GGUF) into ComfyUI/models/LLM/. The embedding model is a sentence-transformers download, a few hundred MB - nothing like the 14B generator.
Two things worth knowing. First, semantic search fixes names, not signatures - it can match a plausible-looking node that exists but has completely wrong input/output types, and the builder will then quietly skip those edges. Second, its knowledge is bounded by your catalog: if you installed a new custom node pack and never re-ran UpdateNodeCatalog, the validator can't know about it. That stale-catalog trap is the #1 cause of "it still generated wrong nodes" complaints. If validation feels weak, update the catalog before you flip on the 7B model - usually the cheaper fix. And if you're on a small GPU or just impatient, remember this whole stage is optional: you can wire Step 1 straight into Step 3 and accept the ghost nodes.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| instruction | STRING | Optional context for LLM refinement. Connect 'instruction' output from Step 1 or add your own instructions to guide refinement. | |
| workflow_edges | STRING | Input diagram from Step 1 (WorkflowGenerator). | |
| use_llm_refinement | BOOLEAN | false | Enable LLM-based correction for better accuracy (slower). False uses only semantic search. |
| refine_model_path | COMBO | Qwen2.5-7B-Instruct-q8_0.gguf | LLM model for refinement (if enabled). |
| embedding_model_path | COMBO | paraphrase-multilingual-MiniLM-L12-v2 | Embedding model for semantic search. |
| catalog_directory | STRING | catalog | Directory containing node catalog files. |
| dtype | COMBO | auto | Data type for refinement model (HuggingFace). |
| device_preference | COMBO | auto | Device preference for refinement model. |
| 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 | 40961–16384 | Max tokens for refinement. |
| context_size | INT | 4096512–32768 | 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_k | INT | 51–20 | Number of similar nodes to consider. |
| top_p | FLOAT | 0.700–1 | Top-p sampling. |
| seed | INT | 00–4294967295 | Random seed. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| workflow_edges (refined) | STRING | Refined workflow diagram with corrected names. |
| llm_prompts (debug) | STRING | Prompts sent to LLM (debug). |
| candidate_nodes (debug) | STRING | Candidate nodes found (debug). |