Nodes/ComfyUI_PromptStudio/KoboldCpp Prompt Amplify
ComfyUI Node

KoboldCpp Prompt Amplify

Rough idea in, model-ready prompt out

By tiko13·Created 2 months ago·Updated 6 days ago· 4
KoboldCpp Prompt Amplify
    • amplified_text
    • secondary_instructions
    • width
    • height
    text
    additional_instructions
    model_profile
    style_preset
    style_modifier
    framing_preset
    framing_modifier
    thinking_modeDisabled
    embellishment_levelClean
    kobold_urlhttp://localhost:5001
    max_response_tokens0
    temperature0.25
    top_p0.80
    top_k40
    min_p0.00
    rep_pen1.05
    rep_pen_range360
    sampler_seed-1
    stop_sequence
    request_timeout120
    secondary_instructions
    aspect_ratio1:1 (Square)
    megapixels1.0
    multiple8

    This is the flagship node of the pack, and it earns it. KoboldCpp Prompt Amplify takes a short, rough prompt - "a girl in the rain with a red umbrella" - and rewrites it into something a diffusion model can actually paint, using a local LLM running on your own machine. No API key, no cloud, no censorship layer, no per-call cost. The KB calls this the most common LLM-in-the-graph job, and this node is one of the better implementations of it: it's the same rewrite engine Prompt Studio's chat interface uses, exposed as a plain node you can drop into any workflow.

    The typical graph is about as simple as it gets:

    primitive text → KCPP_PromptAmplify → positive text encoder → sampler
    

    Type your idea in a text primitive, let the node expand it, feed the result to the encoder. If you've ever tried to hand-format a prompt for a tag-based anime model and a natural-language photoreal model in the same week, you'll appreciate what this does.

    How it works

    The node talks to KoboldCpp's OpenAI-compatible Chat Completions endpoint (the raw KCPP_Apply node uses the older native endpoint instead). It builds a rewrite request from the inputs, sends it, and returns the model's answer as amplified_text. Native thinking (the thinking_mode input) is kept in Chat Completions' separate reasoning_content field, so only the clean final answer reaches your image workflow - no leaked scratch-work, which is the classic reasoner failure the KB warns about.

    The inputs that matter:

    • text - your rough idea. This is the input to amplify.
    • model_profile - the grammar the rewrite follows: General Natural Language, Tag-Based Anime Model, or Tag-Based Photorealistic Model. This is the single most important setting; pick the one that matches your checkpoint's prompting style.
    • style_preset (111 options) and framing_preset (32 options) - reusable aesthetic and composition guidance. There's real overlap with things like SDXL style/quality tags, but they're tuned as LLM instructions.
    • embellishment_level - how much the rewrite expands your text, from None (no added detail) to Ultra Maximum (~120–160 words). Start at Clean and climb only if you want more prose.
    • thinking_mode - Disabled through High. Reasoning modes cost context and tokens; leave Disabled unless you're chasing quality.
    • secondary_instructions - optional, and important: phrases like LoRA trigger words that pass through to the second output unchanged and never enter the LLM request.
    • aspect_ratio, megapixels, multiple - compute the optional width/height outputs with the same presets as ComfyUI's Resolution Selector.

    The rest are KoboldCpp request knobs (URL, token allowance, temperature, penalties). max_response_tokens of 0 uses the selected profile's default.

    Outputs: amplified_text (→ text encoder), secondary_instructions, and width/height (INT) for latent sizing.

    Installing it

    One clone for the whole pack:

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

    Restart ComfyUI, or search "ComfyUI_PromptStudio" in ComfyUI Manager. No pip dependencies - the node just needs a local KoboldCpp server at http://localhost:5001 (default), Ollama at 11434, or llama.cpp at 8080. For KoboldCpp specifically: use 1.117.1+, enable Use Jinja in the server, and restart it - the node refuses to run with generic chat formatting rather than silently degrading.

    Where people get burned

    • "Use Jinja" not enabled. The node errors out on purpose. Enable it in KoboldCpp and restart the server.
    • VRAM contention on one GPU. This is the classic KoboldCpp+ComfyUI problem: the LLM and the diffusion model fight over your card. Prompt Studio's shared-GPU handoff (which unloads the LLM before ComfyUI queues) requires KoboldCpp Admin Mode with an Admin Directory. Without it, expect OOMs or a red status dot. Don't enable "Keep models loaded" unless the two run on separate GPUs.
    • Double amplification. If this node sits in a [PS] workflow, Prompt Studio converts it to a Prompt Slot in the temporary snapshot it queues - so Studio never amplifies twice. On a normal ComfyUI queue, the amplification happens exactly once, as you'd expect.
    • Wrong profile → wrong vibe. A tag-based anime model doesn't want your natural-language photoreal phrasing. If output looks off, switch model_profile before touching samplers.
    CategoryKoboldCpp

    Inputs (24)

    NameTypeDefaultDescription
    textSTRING
    additional_instructionsSTRINGOptional extra guidance for this run without editing model_profiles.json.
    model_profileCOMBO3 options: General Natural Language, Tag-Based Anime Model, Tag-Based Photorealistic Model
    style_presetCOMBO118 options: None, Neutral, Casual Snapshot, Amateur Photography, Candid Photography, Tag Dense, +112
    style_modifierSTRINGOptional aesthetic/style guidance added to the selected style preset. Select None for modifier-only behavior.
    framing_presetCOMBO32 options: None, Selfie, Mirror Selfie, Candid Unaware, Close-Up Portrait, Medium Shot, +26
    framing_modifierSTRINGOptional framing/composition guidance added to the selected framing preset. Select None for modifier-only behavior.
    thinking_modeCOMBODisabledPrivate-reasoning limits: Minimal 200 tokens, Low 500, Medium 1000, and High uses the available context window.
    embellishment_levelCOMBOCleanControls how much the prompt is expanded or polished after style conversion.
    kobold_urlSTRINGhttp://localhost:5001Base URL for the local KoboldCpp server.
    max_response_tokensINT00–8192Final-answer token allowance. Use 0 to use the profile default. Native reasoning receives an additional budget within the server context window.
    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.
    secondary_instructionsoptSTRINGOptional phrases returned unchanged through the secondary_instructions output, such as LoRA trigger words.
    aspect_ratiooptCOMBO1:1 (Square)The aspect ratio for the output dimensions.
    megapixelsoptFLOAT1.00.1–16Target total megapixels. 1.0 MP ≈ 1024x1024 for square.
    multipleoptINT88–128Nearest multiple of the result to set the selected resolution to.

    Outputs (4)

    NameTypeDescription
    amplified_textSTRING
    secondary_instructionsSTRING
    widthINT
    heightINT