Nodes/comfyui-llm-bikeshed/LLM Options: Textgen
ComfyUI Node

LLM Options: Textgen

The full Textgen sampler menu, exposed

By VirusShell·Created 4 months ago·Updated 3 days ago· 1
LLM Options: Textgen
    • options
    ◄enable_temperaturefalse►
    ◄temperature0.70►
    ◄enable_top_pfalse►
    ◄top_p1.00►
    ◄enable_max_tokensfalse►
    ◄max_tokens512►
    ◄enable_seedfalse►
    ◄seed0►
    ◄enable_stop_stringfalse►
    ◄stop_string►
    ◄enable_top_kfalse►
    ◄top_k40►
    ◄enable_min_pfalse►
    ◄min_p0.00►
    ◄enable_repeat_penaltyfalse►
    ◄repeat_penalty1.10►
    ◄enable_presence_penaltyfalse►
    ◄presence_penalty0.00►
    ◄enable_frequency_penaltyfalse►
    ◄frequency_penalty0.00►
    ◄enable_typical_pfalse►
    ◄typical_p1.00►
    ◄enable_tfsfalse►
    ◄tfs1.00►

    LLM Options: Textgen is the most complete of the pack's three options nodes, because oobabooga Textgen exposes the whole llama.cpp-family sampler menu and this node exposes most of it back to you. It's for the same toggle-per-parameter pattern as the others: each parameter has an enable_* Boolean in front of it, everything starts OFF, and only what you enable is sent to the backend. Output is an LLM_OPTIONS object for LLM Generate (Advanced)'s options input. Disconnect it and Textgen uses whatever its own settings say.

    What's on the menu

    The familiar core plus a few Textgen favorites you won't find on the other two nodes:

    • temperature (default 0.7), top_p (1.0), top_k (40), seed (0) - the standard quartet.
    • min_p (default 0) - a newer, increasingly popular filter: drop any token whose probability is below min_p relative to the top token. It's the modern replacement for a lot of top_k fiddling, and Textgen has supported it for ages.
    • repeat_penalty (1.1), presence_penalty / frequency_penalty (0) - the repetition controls.
    • typical_p (1.0) - typical sampling, which trims tokens based on how "surprising" they are relative to the expected distribution. A Textgen staple.
    • tfs (1.0) - tail-free sampling, the entropy-based cutoff that was all the rage in the early local-LLM days and still lives in Textgen's UI. Values below 1.0 trim more aggressively.
    • max_tokens (default 512) and stop_string (mapped to the stop API parameter).

    That's twelve toggles total, which is a lot of knobs - and the honest guidance is that you don't need most of them. The ones people actually reach for: temperature for general randomness, min_p as the single "crank this to clean up garbage output" control, and repeat_penalty when a model starts looping. The rest are the fun-zone of the sampling hobby, not the load-bearing defaults. Start with everything off, let Textgen's own settings do their thing, and only enable what a specific model misbehaves on.

    Why it exists

    Textgen is the pack's first-class citizen (the README's product direction says "Textgen-first"), so it gets the full sampler surface while LM Studio and OpenAI get trimmed sets. If you run oobabooga, this node is how you bring per-node sampling control into the graph instead of editing the Textgen UI between runs. Combined with the dedicated LLM Provider: Textgen and its integrated VRAM handling, it's the intended "everything for Textgen" stack. Unsupported parameters are dropped silently (info-level log), same as the other options nodes.

    Install

    Pack standard: ComfyUI Manager search "comfyui-llm-bikeshed", or clone into custom_nodes/ and pip install -r requirements.txt. Only pyyaml and requests, already in ComfyUI core - no model downloads, no config needed here. The node only builds a dict; your Textgen URL and any --api-key / --admin-key live on the provider and in config.yaml.

    CategoryLLM Bikeshed/options

    Inputs (24)

    NameTypeDefaultDescription
    enable_temperatureoptBOOLEANfalse—
    temperatureoptFLOAT0.700–2—
    enable_top_poptBOOLEANfalse—
    top_poptFLOAT1.000–1—
    enable_max_tokensoptBOOLEANfalse—
    max_tokensoptINT5120–128000Output cap. 0 omits the field (host default).
    enable_seedoptBOOLEANfalse—
    seedoptINT00–18446744073709550000—
    enable_stop_stringoptBOOLEANfalse—
    stop_stringoptSTRING—
    enable_top_koptBOOLEANfalse—
    top_koptINT400–500—
    enable_min_poptBOOLEANfalse—
    min_poptFLOAT0.000–1—
    enable_repeat_penaltyoptBOOLEANfalse—
    repeat_penaltyoptFLOAT1.100–5—
    enable_presence_penaltyoptBOOLEANfalse—
    presence_penaltyoptFLOAT0.00-2–2—
    enable_frequency_penaltyoptBOOLEANfalse—
    frequency_penaltyoptFLOAT0.00-2–2—
    enable_typical_poptBOOLEANfalse—
    typical_poptFLOAT1.000–1—
    enable_tfsoptBOOLEANfalse—
    tfsoptFLOAT1.000–2—

    Outputs (1)

    NameTypeDescription
    optionsLLM_OPTIONS—