Nodes/ComfyUI_PromptStudio/KoboldCpp Apply
ComfyUI Node

KoboldCpp Apply

The one Prompt Studio node that's just a raw KoboldCpp call

By tiko13·Created 2 months ago·Updated 6 days ago· 4
KoboldCpp Apply
    • text
    text
    thinking_modeDisabled
    kobold_urlhttp://localhost:5001
    max_response_tokens300
    temperature0.25
    top_p0.80
    top_k40
    min_p0.00
    rep_pen1.05
    rep_pen_range360
    sampler_seed-1
    stop_sequence
    request_timeout120

    Every other KoboldCpp node in this pack is a prompt engineer with opinions. KoboldCpp Apply is the opposite: a bare wire to your local LLM. You hand it text, it hands the text to KoboldCpp as the complete prompt and context, and it returns whatever the model generates. No model profiles, no style presets, no framing presets, no embellishment rules, no amplification instructions. That's the whole job, and it's the node you reach for when you want a raw local-LLM call inside a ComfyUI graph - not an image-prompt rewrite.

    The workflow pattern this fits is the one the KB calls the LLM-as-a-tool: a language model sitting in the graph doing a text job that isn't diffusion (see llm-in-comfyui.md). Brainstorming a character concept, generating dialogue for a video clip, writing captions, chaining one LLM output into another node - if you can imagine the step, this node just runs it. It's the smallest unit of "make the local model say something" that this pack offers.

    How it works

    Mechanically, Apply is deliberately old-school. It calls KoboldCpp's native /api/v1/generate endpoint rather than the OpenAI-compatible Chat Completions path the rewriting nodes use. The practical consequence: your text input really is the full raw prompt/context, and max_response_tokens is a total raw generation limit, not the "final answer allowance" that the rewrite nodes use. The author kept it on the native endpoint specifically so that semantic survives.

    The inputs that matter for a beginner:

    • text - the complete prompt/context, multiline. This is the only thing most people ever set.
    • kobold_url - default http://localhost:5001. Point it at your KoboldCpp server.
    • max_response_tokens - default 300; 0 falls back to the node default. Cap how much the model may generate.
    • thinking_mode - Disabled through High. Minimal/Low/Medium budget 200/500/1000 reasoning tokens; High uses the available context window.
    • sampler_seed - -1 lets KoboldCpp pick a random seed. Set it to a number to make a run reproducible.
    • stop_sequence - one per line, in case your model rambles past a natural stopping point.

    The rest are your standard KoboldCpp sampler knobs (temperature 0.25, top_p, top_k, min_p, repetition penalty) plus a 120-second request timeout. Defaults are tuned for prompt-style output; if you're asking for a paragraph of prose, you may want to nudge temperature up.

    The single output is text (STRING), so wire it into a text display, a string node, or further processing. Note it's not an output node - it doesn't save anything; it just produces text.

    Installing it

    This node ships inside Prompt Studio, so you install the whole pack once:

    cd ComfyUI/custom_nodes
    git clone https://github.com/tiko13/ComfyUI_PromptStudio
    

    then restart ComfyUI (or install via ComfyUI Manager by searching "ComfyUI_PromptStudio"). There are no pip dependencies - the pack is pure Python that talks HTTP to a local LLM server. You need that server running: KoboldCpp at http://localhost:5001 by default, Ollama at 11434, or llama.cpp at 8080. For KoboldCpp, 1.117.1+ is what the author tests against.

    Where people get burned

    • Nothing happens. The server isn't at the URL, or the endpoint is loopback-locked. Remote hosts are rejected by default; you have to allowlist them via PROMPT_STUDIO_KOBOLD_ALLOWED_HOSTS before ComfyUI starts.
    • VRAM contention. An LLM and a diffusion model sharing one GPU is the classic KoboldCpp+ComfyUI pain. Prompt Studio has a shared-GPU handoff (it unloads the LLM before ComfyUI inference) but it needs KoboldCpp Admin Mode with an Admin Directory configured, or the handoff fails and the status dot turns red. Don't enable "Keep models loaded" unless your LLM and ComfyUI are on separate GPUs - it skips the handoff entirely.
    • Expecting it to write an image prompt. It won't. If you wanted amplification, you grabbed the wrong node - that's KCPP_PromptAmplify.
    CategoryKoboldCpp

    Inputs (13)

    NameTypeDefaultDescription
    textSTRING
    thinking_modeCOMBODisabledPrivate-reasoning limits: Minimal 200 tokens, Low 500, Medium 1000, and High uses the available context window.
    kobold_urlSTRINGhttp://localhost:5001Base URL for the local KoboldCpp server.
    max_response_tokensINT3000–8192Maximum tokens in the raw generated continuation. Use 0 to use the node default.
    temperatureFLOAT0.250–5
    top_pFLOAT0.800–1
    top_kINT400–200
    min_pFLOAT0.000–1
    rep_penFLOAT1.050.5–3
    rep_pen_rangeINT3600–4096
    sampler_seedINT-1-1–999999-1 lets KoboldCpp choose a random seed.
    stop_sequenceSTRINGOptional stop sequences, one per line.
    request_timeoutINT1205–600HTTP timeout in seconds.

    Outputs (1)

    NameTypeDescription
    textSTRING