Nodes/ComfyUI-llamacpp-helper/Load llama.cpp Model
ComfyUI Node

Load llama.cpp Model

The llama.cpp loader that actually starts the server — point it at a GGUF and walk away

By bbaudio-2025·Created 3 days ago·Updated 3 days ago· 0
Load llama.cpp Model
    • model
    server_exeC:\Users\bbaudio\MyApps\AItemp\llama-bin-win-cuda-13.3-x64\llama-server.exe
    model_path
    mmproj_path
    host127.0.0.1
    port8080
    n_gpu_layers99
    context_size4096
    auto_starttrue
    mmproj_gpu_offloadtrue
    advanced_launch_args
    model_namellamacpp-helper

    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-server binary. 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 .gguf it finds under the folders in config.json's model_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 .gguf files 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-mmap or a grammar file.
    • model_name is cosmetic-ish: it's passed as --alias and 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:

    1. 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.
    2. 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.
    3. Open config.json in the pack folder and set model_roots (and mmproj_roots) to real directories holding your .gguf files. 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.

    CategoryLLM/llama.cpp

    Inputs (11)

    NameTypeDefaultDescription
    server_exeSTRINGC:\Users\bbaudio\MyApps\AItemp\llama-bin-win-cuda-13.3-x64\llama-server.exe
    model_pathCOMBO1 options:
    mmproj_pathCOMBO1 options:
    hostSTRING127.0.0.1
    portINT80801–65535
    n_gpu_layersINT990–9999
    context_sizeINT4096256–131072
    auto_startoptBOOLEANtrue
    mmproj_gpu_offloadoptBOOLEANtrue
    advanced_launch_argsoptSTRING
    model_nameoptSTRINGllamacpp-helper

    Outputs (1)

    NameTypeDescription
    modelLLAMACPP_MODEL