Nodes/NInfer API/NInfer - Client
ComfyUI Node

NInfer - Client

The node that decides when a 27B LLM is allowed to exist

By kaerozhi·Created 22 days ago·Updated 22 days ago· 1
NInfer - Client
    • Client
    ◄base_urlhttp://127.0.0.1:8080/v1►
    ◄auto_starttrue►
    ◄model_fileHuihui-Qwen3.8-27B-abliterated-Swift-1.5-GSQ-RCO-IQ3_S-mtp.ninfer►
    ◄idle_seconds120►
    ◄keep_alivefalse►
    ◄api_keyninfer-local►
    ◄max_retries1►
    ◄timeout900►

    The Client node doesn't generate anything. It holds an endpoint, and - the part that actually matters - it decides when the NInfer server process is allowed to be alive. On a 24 GB card that's the whole game.

    NInfer is a local server for a Qwen3.8-27B model with an OpenAI-compatible API and a vision tower. It is not bundled with this pack; you build or download it separately and point the pack at the binary. Residency is the problem: the author measures roughly 18 GiB of VRAM while NInfer sits there, against ~3.7 GiB with it stopped, and image generation goes from 10–12 s to ~28 s per image. And NInfer cannot unload a model - the weights and KV arena are built at startup and there is no eject API. The only way to give VRAM back is to kill the process. That constraint is why this node exists at all.

    What it does

    It's a thin wrapper over the openai Python SDK pointed at NInfer's /v1, exported on a custom NINFER_CLIENT socket that only the Chat node accepts. So you set the endpoint, the timeout, and the start/stop policy in exactly one place.

    With Auto Start on (the default), executing this node calls the pack's lifecycle manager: if something already answers /health, it adopts that server instead of spawning a second one, which means it composes fine with a server you launched yourself. Otherwise it spawns ninfer-serve.exe with the selected .ninfer artifact and waits up to three minutes for it to become healthy.

    Then a background reaper thread checks once a second and stops the process when three things are true: nothing is in flight, no ComfyUI prompt is queued or running, and Idle Shutdown (s) has elapsed. That middle condition is the clever bit. ComfyUI evaluates edges lazily, so a graph can ask NInfer for a prompt and then spend a minute sampling. Without that check the reaper would kill the server mid-workflow and the next LLM call would pay a cold start. Keep Alive disables the timer entirely for the session.

    The inputs beginners actually touch

    • Base URL - http://127.0.0.1:8080/v1 by default. Point it elsewhere and you're driving any OpenAI-compatible endpoint, which is the other half of this node's job.
    • Model File - the .ninfer artifact to load when this node starts the server. The dropdown is built by scanning NINFER_MODELS_DIR on disk, so an empty list means the directory wasn't found.
    • Idle Shutdown (s) - default 120, floor of 30. The README's own arithmetic: for a single image, leave NInfer running; for a batch, the 0.7 s stop plus ~9 s start pays for itself after roughly one image.
    • API Key - the tooltip is blunt: never leave it empty, an empty key makes the openai client fail to connect. Worth knowing that the shipped code actually falls back to the ninfer-local placeholder regardless, so a blank field won't bite you here. NInfer ignores the Authorization header completely; the field is a placeholder for the local case and a real field for anything else you point base_url at.
    • Timeout (s) - 900 by default, and that isn't arbitrary. These generations run for minutes.

    One output: Client, type NINFER_CLIENT, wired into a Chat node's client input. That's it.

    Installing

    ComfyUI Manager → search NInfer API (publisher kaerozhi), or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kaerozhi/comfy-ninfer-api
    # restart ComfyUI
    

    No pip install step. The pack has exactly one dependency, openai, and ComfyUI already ships it. The things you do need to arrange are the NInfer binary and its model file, which come from the separate NInfer project, not from this repo and not from HuggingFace. The paths are discovered relative to the pack and overridden by environment variables:

    export NINFER_SERVE_EXE="D:/AI/Ninfer-gsq/build-win/apps/ninfer-serve.exe"
    export NINFER_MODELS_DIR="D:/AI/Ninfer/models"
    export NINFER_BASE_URL="http://127.0.0.1:8080/v1"
    

    Where people get burned

    Process control is Windows-only. The graceful shutdown uses GenerateConsoleCtrlEvent, which has no equivalent in the pack. The chat and option nodes will talk to an already-running server anywhere, but auto_start and the Server Control node are Windows territory - on Linux you start NInfer yourself and turn Auto Start off.

    Stale dropdowns. The model list and skill list are read at import time, and ComfyUI caches node definitions. Drop a new .ninfer file in and the combo won't show it until you restart.

    An old ComfyUI. The pack is written against the newer V3 node API (comfy_api.latest). If the nodes never appear in the Add Node menu, that's the first thing to check.

    There's no crowd of people who've hit these yet - this is a one-author pack released for exactly one server, and it barely exists in public discussion. Treat the README as the manual and the tooltips as ground truth; they're unusually good.

    CategoryNInfer

    Inputs (8)

    NameTypeDefaultDescription
    base_urlSTRINGhttp://127.0.0.1:8080/v1NInfer's OpenAI-compatible endpoint
    auto_startBOOLEANtrueStart the server if it is not running. Turn this off to use a server you launched yourself with infer.ps1.
    model_fileCOMBOHuihui-Qwen3.8-27B-abliterated-Swift-1.5-GSQ-RCO-IQ3_S-mtp.ninferArtifact to load when this node starts the server
    idle_secondsINT12030–3600Stop the server after this long with no request. NInfer cannot unload a model, so stopping the process is the only way to give the VRAM back to ComfyUI.
    keep_aliveBOOLEANfalseNever shut down automatically
    api_keySTRINGninfer-localNInfer itself ignores this header entirely, so the default placeholder is fine locally. It is here so the same nodes can talk to any OpenAI-compatible endpoint that does check credentials. Never leave it empty: an empty api_key makes the openai client fail to connect.
    max_retriesINT10–10Retries on connection errors and 5xx responses
    timeoutINT9001–3600Whole-request budget. Generations here run for minutes, so keep this generous.

    Outputs (1)

    NameTypeDescription
    ClientNINFER_CLIENTPass to a NInfer chat node