Load llama.cpp Model
The llama.cpp loader that actually starts the server — point it at a GGUF and walk away
- model
Every other node in this pack exists because of this one. "Load llama.cpp Model" doesn't load a model into ComfyUI at all - it configures and launches the external llama-server process the whole pack is built around, then hands you a handle to feed into the "LLM (llama.cpp server)" node. Get this node right and the rest is easy; get it wrong and you'll stare at a FileNotFoundError for a while.
How it works. Behind the scenes it assembles a llama-server command line - -m <model> --host <host> --port <port> -ngl <layers> -c <context> --alias <name>, plus --mmproj if you gave a multimodal projector - spawns it as a separate process, and polls the /health endpoint for up to 180 seconds until the server reports ready. ComfyUI never touches the model weights; the server owns them. That's also why the pack needs zero Python dependencies - just the standard library and urllib.
The inputs that actually matter. Only a few of these are things you'll touch:
- server_exe - the full path to your
llama-serverbinary. This is the trap. The default is the author's own Windows path (C:\Users\bbaudio\...\llama-server.exe), which doesn't exist on your machine. You will change this, and on Linux or macOS you'll be pasting a path like/home/you/llama.cpp/build/bin/llama-server. - model_path - a dropdown of every
.ggufit finds under the folders inconfig.json'smodel_roots. If the dropdown is empty, that config is wrong (more below). You can also paste a full path manually. - mmproj_path - only for multimodal models. The dropdown only lists
.gguffiles with "mmproj" in the filename, so name your projector file sensibly. - n_gpu_layers - 99 (the default) means "offload every layer to GPU"; 0 is pure CPU. For a big model on a small card, dropping this is how you stay in VRAM instead of crashing.
- context_size - 4096 default; raise it if the model's context is bigger and you're doing long prompts or history. Each token of context costs memory, so don't just max it out.
- host / port - 127.0.0.1:8080 by default. Change the port if something else squats on 8080; the LLM node must use the same one.
- auto_start (default on) launches the server on load. advanced_launch_args lets you bolt on extra llama-server flags, one per line - e.g.
--no-mmapor a grammar file. - model_name is cosmetic-ish: it's passed as
--aliasand shows up as the model name in server responses.
Output: one model output of the custom LLAMACPP_MODEL type. It carries the whole launch config through, so the LLM node can restart or stop the server later.
Install, the real way. Two downloads, one edit:
- Get the model loader itself: ComfyUI Manager → search "ComfyUI-llamacpp-helper", or
cd ComfyUI/custom_nodes && git clone https://github.com/bbaudio-2025/ComfyUI-llamacpp-helper, then restart ComfyUI. - Download llama-server from the llama.cpp releases - pick the CUDA build if you're on an NVIDIA card, the CPU build if not. It's a standalone binary; unzip it anywhere.
- Open
config.jsonin the pack folder and setmodel_roots(andmmproj_roots) to real directories holding your.gguffiles. The shipped defaults are paths from the author's machine, so treat them as examples.
Troubleshooting. llama-server executable not found - check server_exe, and note the shipped default is a Windows path. "Did not become healthy within 180s" means the server crashed on startup; read llama_server.log in the pack folder for the real reason (usually a wrong model path, an out-of-memory context size, or a CPU build choking on -ngl). Models must be GGUF - llama-server cannot load safetensors, full stop. And the quantization matters: Q8 is basically fp16 at half the size, Q4_K_M is the accepted compromise for a 12GB card. If your card can take Q8 without swapping, just use it.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| server_exe | STRING | C:\Users\bbaudio\MyApps\AItemp\llama-bin-win-cuda-13.3-x64\llama-server.exe | — |
| model_path | COMBO | 1 options: | |
| mmproj_path | COMBO | 1 options: | |
| host | STRING | 127.0.0.1 | — |
| port | INT | 80801–65535 | — |
| n_gpu_layers | INT | 990–9999 | — |
| context_size | INT | 4096256–131072 | — |
| auto_startopt | BOOLEAN | true | — |
| mmproj_gpu_offloadopt | BOOLEAN | true | — |
| advanced_launch_argsopt | STRING | — | |
| model_nameopt | STRING | llamacpp-helper | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | LLAMACPP_MODEL | — |