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

LLM Options: OpenAI

Cloud sampling knobs for the OpenAI path

By VirusShell·Created 4 months ago·Updated 3 days ago· 1
LLM Options: OpenAI
    • options
    ◄enable_temperaturefalse►
    ◄temperature0.70►
    ◄enable_top_pfalse►
    ◄top_p1.00►
    ◄enable_max_tokensfalse►
    ◄max_tokens1024►
    ◄enable_max_completion_tokensfalse►
    ◄max_completion_tokens1024►
    ◄enable_seedfalse►
    ◄seed0►
    ◄enable_stop_stringfalse►
    ◄stop_string►
    ◄enable_presence_penaltyfalse►
    ◄presence_penalty0.00►
    ◄enable_frequency_penaltyfalse►
    ◄frequency_penalty0.00►

    LLM Options: OpenAI is the sampling node for when your provider URL points at api.openai.com rather than a localhost server. It's the same toggle-per-parameter pattern as the other options nodes - every parameter has an enable_* Boolean in front of it, everything starts OFF, and only what you explicitly enable gets sent to the API. Disconnect it entirely and the model uses its own defaults. It outputs an LLM_OPTIONS object for LLM Generate (Advanced)'s options input.

    The parameter list

    The OpenAI node carries the core Chat Completions sampling set:

    • temperature (default 0.7) and top_p (default 1.0) - the standard randomness pair.
    • seed (default -1) - for reproducible cloud calls; note that OpenAI's seed is "best effort," not a guarantee, so don't treat it like a local seed.
    • max_tokens (default 1024) - the classic reply ceiling.
    • max_completion_tokens (default 1024) - OpenAI's newer token cap, which is what some modern models actually honor. This is the trap of this node: with both exposed, it's easy to toggle both on and get them fighting over the budget. Pick the one your model uses, leave the other off.
    • stop_string - a string that halts generation when produced (sent as the stop parameter).
    • presence_penalty / frequency_penalty (both default 0) - the penalty pair for nudging away from repetition.

    Unsupported parameters are dropped silently (logged at info level), which matters here because the cloud API surface changes more often than the local ones - a param a model ignores won't crash your run.

    When you'd actually use this

    The honest answer, from the KB's framing in llm-in-comfyui.md and external-api-nodes.md: this path is for when you want frontier-chat quality and genuinely don't care about local or uncensored. An 8B local model is free and private; the OpenAI path costs per call and filters content at the source, and a node cannot bypass that. The pack's design reflects this by keeping the cloud path as a URL you choose, not a special setup - same provider node, same generation node, different config.yaml block. The one thing this node buys you over just using the model's defaults is control over cost and output shape: capping max_completion_tokens tightly on a paid API is the difference between a cheap run and a surprise bill, and setting a stop_string keeps a chatty model from rambling past where you need it.

    Keys

    There's no key widget anywhere - the OpenAI API key lives in config.yaml (providers.openai.api_key) or the LLM_BIKESHED_OPENAI_API_KEY environment variable, resolved at request time. That's a genuinely better security posture than the paste-a-key-into-the-node packs, and worth preferring given the category's history (external-api-nodes.md covers the credential-in-workflow risk).

    Install

    Pack standard: ComfyUI Manager search "comfyui-llm-bikeshed", or clone into custom_nodes/ and pip install -r requirements.txt. Only pyyaml and requests, no model downloads. Just make sure your provider URL, not just your options, points at OpenAI - the options node doesn't pick the backend.

    CategoryLLM Bikeshed/options

    Inputs (16)

    NameTypeDefaultDescription
    enable_temperatureoptBOOLEANfalse—
    temperatureoptFLOAT0.700–2—
    enable_top_poptBOOLEANfalse—
    top_poptFLOAT1.000–1—
    enable_max_tokensoptBOOLEANfalse—
    max_tokensoptINT10240–128000Legacy output cap. 0 omits the field. Prefer max_completion_tokens for new OpenAI paths.
    enable_max_completion_tokensoptBOOLEANfalse—
    max_completion_tokensoptINT10240–128000Output cap for newer OpenAI models. 0 omits the field.
    enable_seedoptBOOLEANfalse—
    seedoptINT00–18446744073709550000—
    enable_stop_stringoptBOOLEANfalse—
    stop_stringoptSTRING—
    enable_presence_penaltyoptBOOLEANfalse—
    presence_penaltyoptFLOAT0.00-2–2—
    enable_frequency_penaltyoptBOOLEANfalse—
    frequency_penaltyoptFLOAT0.00-2–2—

    Outputs (1)

    NameTypeDescription
    optionsLLM_OPTIONS—