Nodes/NeuralBooru/NeuralBooru LLM
ComfyUI Node

NeuralBooru LLM

The raw LLM half of NeuralBooru — no validation, for when you want to see the tag soup first

By ChrisJohnson89·Created 2 months ago·Updated 2 months ago· 14
NeuralBooru LLM
    • raw_tags
    • is_fallback
    user_promptdescribe your scene here
    system_promptYou convert a scene description into Danbooru tags for an anime image model. Output ONLY lowercase tags separated by commas. No sentences, no explanations, no numbering, no category words. Write attributes in real Danbooru tag style: 'blue eyes' not 'eye color blue', 'black hair' not 'hair color black'. Use spaces, not underscores. Use 1girl, 1boy, 2girls, etc. for people. Do NOT add quality tags like masterpiece, best quality, absurdres, score_9 - those are added separately. Example input: a cheerful blonde girl in a red dress on a beach at sunset Example output: 1girl, blonde hair, long hair, smile, red dress, beach, sunset, ocean, sky, cloud, standing Example input: a lone samurai in the rain at night Example output: 1boy, solo, samurai, japanese clothes, katana, rain, night, wet, serious, outdoors Now output tags only for the next description. /no_think
    modelqwen/qwen3-1.7b
    enable_thinkingfalse
    temperature0.40
    max_tokens500
    seed0
    lm_studio_urlhttp://localhost:1234
    timeout120
    api_key
    on_errorraise

    NeuralBooru LLM is the first half of the NeuralBooru pack split in two. Where the all-in-one NeuralBooru node does everything - call the LLM, validate against the real Danbooru vocabulary, wrap in a template - this node stops right after the LLM answers. What you get is raw_tags: the model's tag-ish output, cleaned of reasoning noise, and not a single tag verified.

    Which sounds like a downgrade until you want it. If you've ever wondered what your LLM actually proposes before the whitelist mows it down - or you want to edit the raw output by hand before validation - this is the node that shows its work.

    What it actually does

    It's a thin HTTP client, and the only home of the LLM-calling code in the whole pack. Give it a user_prompt, it sends it to whatever OpenAI-compatible server you point lm_studio_url at, and returns the text. Three details make it less dumb than it sounds:

    • Ollama is auto-detected. The node probes /api/version; if that responds, it drives Ollama's native /api/chat endpoint instead of the OpenAI /v1/chat/completions shape. Point it at http://localhost:11434 and it just works.
    • Reasoning models are handled. With enable_thinking on, Qwen3-style models think before answering and it strips the <think> blocks - including an unterminated one when max_tokens cuts reasoning off mid-stream, so reasoning never leaks into your tags. For non-thinking models the system prompt's /no_think suffix is removed and enable_thinking is sent to the API.
    • There's a fallback signal. If the server is unreachable and on_error is set to use_input_text, raw_tags holds your original description and the is_fallback output flips to True. The workflow still produces an image instead of dying, and anything downstream can react to the flag.

    The inputs and outputs that matter

    Most of the inputs mirror the combined node: user_prompt, system_prompt, model (default qwen/qwen3-1.7b), temperature (0.4 is the sweet spot), max_tokens, seed (re-roll for a fresh variation), lm_studio_url, plus optional timeout, api_key, and on_error. What's missing is everything validation-related - that all lives in the other half.

    The two outputs are the whole story:

    • raw_tags - the LLM's comma-separated output, think-stripped. Feed this into NeuralBooruValidator's tags input to reproduce the full pipeline.
    • is_fallback - True when the call failed and you got your raw description back instead. Wire it to the Validator's is_fallback input and validation gets skipped automatically, matching what the combined node does internally.

    In fact, that's the design: wire raw_tags → tags and is_fallback → is_fallback and the pair behaves exactly like the single NeuralBooru node - because the combined node is just these two wired together under the hood.

    Installation

    It ships in the same pack, so installing NeuralBooru covers all three nodes - Manager search for NeuralBooru, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ChrisJohnson89/ComfyUI-NeuralBooru
    

    Restart ComfyUI; the nodes appear under the NeuralBooru category. No dependencies to install - pure stdlib - and no model to download from the pack. The model you need is a local chat model (Qwen3-1.7B is the recommendation) loaded in LM Studio, Ollama, or whatever you run.

    When to reach for this one

    Honestly, if you just want English-in / tags-out, use the combined NeuralBooru node. Reach for this split when you want to see or edit the raw LLM output before the filter - or when you're running the LLM on a different machine and want the validation and template steps to stay separate in your graph. Just remember the tradeoff the whole validation layer exists to fix: a small general model's output looks like Danbooru tags but isn't guaranteed to be real ones. That's what the other half is for.

    CategoryNeuralBooru

    Inputs (11)

    NameTypeDefaultDescription
    user_promptSTRINGdescribe your scene herePlain-English scene description to convert into tags.
    system_promptSTRINGYou convert a scene description into Danbooru tags for an anime image model. Output ONLY lowercase tags separated by commas. No sentences, no explanations, no numbering, no category words. Write attributes in real Danbooru tag style: 'blue eyes' not 'eye color blue', 'black hair' not 'hair color black'. Use spaces, not underscores. Use 1girl, 1boy, 2girls, etc. for people. Do NOT add quality tags like masterpiece, best quality, absurdres, score_9 - those are added separately. Example input: a cheerful blonde girl in a red dress on a beach at sunset Example output: 1girl, blonde hair, long hair, smile, red dress, beach, sunset, ocean, sky, cloud, standing Example input: a lone samurai in the rain at night Example output: 1boy, solo, samurai, japanese clothes, katana, rain, night, wet, serious, outdoors Now output tags only for the next description. /no_thinkInstructions for the LLM. Edit to change tagging behavior.
    modelSTRINGqwen/qwen3-1.7bModel id as the server reports it (see /v1/models).
    enable_thinkingBOOLEANfalseAllow reasoning-mode models to think before answering. Slower; output is cleaned either way.
    temperatureFLOAT0.400–2
    max_tokensINT50050–2000
    seedINT00–4294967295Change to re-roll the LLM call; also sent to the API.
    lm_studio_urlSTRINGhttp://localhost:1234Base URL of any OpenAI-compatible server: LM Studio (:1234), Ollama (:11434), llama.cpp, vLLM.
    timeoutoptINT12010–600Seconds to wait for the LLM response.
    api_keyoptSTRINGOptional Bearer token for servers that require auth (vLLM, remote endpoints). Leave empty for LM Studio/Ollama.
    on_erroroptCOMBOraiseraise: fail the workflow with a visible error. use_input_text: output your raw description so the workflow still produces an image (sets is_fallback=True).

    Outputs (2)

    NameTypeDescription
    raw_tagsSTRINGThe LLM's tag-ish output, think-stripped and reasoning-fallback applied. Feed into NeuralBooruValidator for Danbooru validation and template wrapping.
    is_fallbackBOOLEANTrue when the LLM call failed and raw_tags holds the original user_prompt (on_error=use_input_text). NeuralBooruValidator skips validation in this case.