Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > comfy-ninfer-api

ComfyUI Extension: comfy-ninfer-api

Repo Name

comfy-ninfer-api

Author
kaerozhi (Account age: 0 days)
Nodes
View all nodes(1)
Latest Updated
2026-10-11
Github Stars
0.0K

How to Install comfy-ninfer-api

Install this extension via the ComfyUI Manager by searching for comfy-ninfer-api
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter comfy-ninfer-api in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

comfy-ninfer-api Description

comfy-ninfer-api adds ComfyUI nodes for local AI chat with text and reference images, reusable prompt skills, response controls, and automatic NInfer server management that frees GPU memory.

comfy-ninfer-api Introduction

comfy-ninfer-api adds ComfyUI nodes for NInfer, a local Qwen3.8-27B server with an OpenAI-compatible chat API and image-understanding support. It lets you use a language model inside an art workflow—for example, to write or refine prompts, discuss reference images, or apply reusable instructions to a creative task.

The extension brings three capabilities into ComfyUI:

  • Chat with a local model: Send a prompt, optionally include reference images, and receive a reply you can use elsewhere in your workflow.
  • Manage GPU memory: Start NInfer when it is needed and stop it after it has been idle, leaving more graphics memory available for image generation.
  • Reuse creative instructions: Select a plain-text “skill” file to guide the model, much like choosing a preset for a particular kind of prompt-writing task.

NInfer is not included with the extension; it is a separate server. The chat nodes can also connect to another OpenAI-compatible endpoint, although the extension’s process-management features are designed for NInfer on Windows.

How comfy-ninfer-api Works

Think of the extension as a bridge between your ComfyUI canvas and a separate assistant:

  1. NInfer - Client identifies the chat server and sets connection preferences.
  2. NInfer - Chat sends your prompt and any connected reference images to that server.
  3. Options nodes adjust how the assistant responds, such as its instructions, response length, or level of randomness.
  4. NInfer - Server Control, when used, starts, stops, or checks the server as part of the workflow.

A skill file works like a reusable creative brief. For example, you could write instructions that ask the assistant to describe a cinematic scene in the order shot type, subject, environment, lighting, and color grade. Selecting that skill applies those instructions without retyping them for every generation.

The server keeps its model in GPU memory while it runs. On a shared GPU, that can leave less memory for ComfyUI’s image-generation work. Because NInfer does not provide a way to unload its model while keeping the server running, the extension frees that memory by stopping the server when appropriate. If you prefer faster follow-up chats, you can instead keep it running.

The author’s measurements on one 24 GB GPU showed NInfer using about 14.8 GiB while a request was in flight. Those figures illustrate the tradeoff, not a memory requirement or a guarantee for every machine.

comfy-ninfer-api Features

Chat and reference images

NInfer - Chat handles one chat completion. Enter your request in Prompt. Its outputs include the visible reply, a separate reasoning output when the model provides one, and the conversation so far.

You can connect up to four reference images through cascading inputs: connect image_1 first, then image_2, and so on. This is useful when asking the model to compare compositions, describe visual elements, or turn reference material into a prompt. Images consume part of the model’s available context; the author estimates roughly 256 prompt tokens for each 512-pixel image, so use only the references you need.

Force Regen controls whether an unchanged workflow produces a fresh answer. Leave it off to reuse ComfyUI’s cached result; turn it on when you want another response from the same inputs.

Connection and automatic server management

NInfer - Client holds the endpoint address and connection settings. Its auto_start option starts NInfer if the server is not responding. If you already started NInfer yourself, the client uses that server rather than launching another one.

  • timeout: How long the client waits for a request. The default is 900 seconds because reasoning-heavy responses can take several minutes.
  • max_retries: How many times the client retries a failed request.
  • idle_seconds: How long an automatically managed server can sit without a generation before it is stopped.
  • keep_alive: Disables the idle shutdown timer and leaves the server running while ComfyUI runs.
  • api_key: NInfer ignores this value, but the underlying client needs a nonempty value. The default, ninfer-local, serves that purpose. Another OpenAI-compatible endpoint may require a real key.

The idle timer does not stop NInfer while ComfyUI has a prompt in its queue.

For direct control, NInfer - Server Control offers ensure running, stop, keep alive, and status actions. Its Run After input and Done output help order workflow steps; they carry an execution signal, not chat text or a model name. The status report appears inside the node rather than on a text output socket.

Response settings

You can chain NInfer - Options nodes through their Options sockets. Their order does not matter; each adds its setting to the options passed along.

Option nodeWhat it changesExample use
System PromptAdds typed instructions, a skill file, or bothAsk for concise prompts with a consistent structure
TemperatureAdjusts response randomness from 0.0 to 2.0Try a lower value for consistency or a higher one for variation
Max TokensSets an upper limit on generated tokensRaise it if a response is cut short
Reasoning EffortSelects low, medium, or xhighUse low for a shorter task; allow more room for complex requests
Top P / Top KAdjusts how the model samples possible next wordsExperiment with how varied the wording feels
SeedControls supported seed behavior, including control_after_generateManage repeatability between runs
Extra BodySends additional settings as raw JSONUse a server option that has no dedicated node

Reasoning Effort defaults to low. The model may spend generated tokens on reasoning before producing a visible reply. If the reply is empty, try increasing Max Tokens or lowering reasoning effort.

Reusable skills

A skill is a short .md or .txt file containing instructions for the model. The System Prompt option lists available skills in a dropdown. When you select one, its contents are added to the system prompt after any instructions you typed yourself.

You can organize skills in subfolders—for example, qwen-image-2.1/prompt_enhancer.md and cinematic-still.md. The dropdown shows each file’s path relative to the skills folder, so files with the same name can live in different groups. Hidden folders are skipped, and the list includes paths up to three components deep, such as a/b/c.md.

A simple skill might say:

# Cinematic Still

When writing a cinematic image prompt, describe the shot type, subject,
environment, lighting, color grade, and finishing details in that order.

Restart ComfyUI after adding or renaming a skill so its dropdown can refresh. If you use a custom skills location, it is selected with NINFER_SKILLS_DIR; otherwise, the extension looks for a skills folder under ComfyUI’s input folder or a neighboring Input/skills folder.

Language support

Node names, labels, categories, and tooltips follow ComfyUI’s English or Chinese interface setting. The Chat and Server Control nodes also have a separate language setting (en or zh) for the text they display in their own previews. That setting does not determine the language of the model’s answer; your prompt does.

comfy-ninfer-api Models

The extension does not bundle model weights or offer a fixed list of model downloads. Its primary intended server is NInfer running Qwen3.8-27B. The exact model ID depends on the model artifact loaded by the server; examples in the author’s documentation include qwen3.8-27b and huihui-qwen3.8-27b-abliterated-swift15-gsq-rco-iq3s.

For most workflows, leave the Chat node’s Model field empty. It will use the first model ID reported by the connected server. If you need to choose a specific model, provide a real model ID rather than a server status message or a descriptive label. Model files found in the configured models folder can also supply IDs through the Client node.

Vision support depends on the server. NInfer normally has vision turned off by default, but the extension enables it when starting the server so you can send reference images. Its vision-residency setting borrows GPU memory while an image is being encoded.

What's New with comfy-ninfer-api

The provided documentation does not include a version-by-version release history. It does describe these changes from earlier behavior:

  • Safer Server Control connections: The node no longer exposes connectable status-text or health-boolean outputs. This prevents its status report from accidentally being sent to Chat as a model ID. Status is now shown in the node, while Done provides a dedicated ordering signal.
  • Better skills-folder discovery: The extension checks locations beyond ComfyUI’s built-in input folder. This addresses a case where a separately configured input directory could leave the skills list unexpectedly empty.
  • English and Chinese interface text: Node labels and tooltips follow ComfyUI’s language setting, with separate preview-language controls for text printed during execution.

Troubleshooting comfy-ninfer-api

Chat reports openai.NotFoundError or HTTP 404

  1. Check the Chat node’s Model field. If you do not need a specific model, clear it so the node can use the server’s reported ID.
  2. If you entered a model name, confirm that it exactly matches the ID reported by the server. A model artifact’s filename or familiar display name may not match its API ID.
  3. Check that the Client points to the intended endpoint. HTTP 404 can also mean the requested API route is missing.

If you are opening an older workflow, do not connect a Server Control status value to Model. Current Server Control nodes use a dedicated Done signal instead.

The Chat node produces no visible reply

  1. Look for output in the reasoning channel.
  2. Increase Max Tokens so the model has room to produce a visible answer after reasoning.
  3. Set Reasoning Effort to low if it is currently higher.

A skill or model dropdown is empty

  1. Read the node’s tooltip for the folder path the extension is using.
  2. Confirm that the expected files are in that folder. Skills must be .md or .txt files, and hidden folders are skipped.
  3. For skills, check that the file is not nested more deeply than the supported dropdown paths.
  4. Restart ComfyUI after adding or renaming a skill.

Reference images are not being used

  1. Connect the first image to image_1 before using later image inputs.
  2. Check that the server supports vision. When the extension starts NInfer, it enables vision; an independently started server needs an appropriate vision configuration.
  3. Try fewer or smaller references if your request is using too much context.

Image generation slows down while NInfer is running

NInfer keeps its model in GPU memory while the server remains active. If ComfyUI also needs that memory, allow the idle_seconds timer to stop NInfer, or use Server Control → stop when chat work is finished. If you make frequent chat requests and have enough GPU memory, keep_alive avoids repeated startup delays.

On the author’s test machine, image generation took roughly 10–12 seconds with NInfer stopped and about 28 seconds with it resident. Your results will depend on your GPU and workflow.

Frequently asked questions

Do I need to enter an API key for local NInfer?
No. NInfer ignores the authorization header. Keep the Client’s default placeholder value rather than leaving the field empty. If you connect to a different service, follow that service’s credential requirements.

Will rerunning the same graph ask the model again?
Not necessarily. ComfyUI can return a cached answer when inputs have not changed. Enable Force Regen in the Chat node when you want a new generation.

Can I run NInfer and image generation on the same GPU?
Yes, but they compete for GPU memory while NInfer is running. Automatic idle shutdown or explicit Server Control steps can free memory between chat and image-generation work.

Does changing the preview language translate the model’s answer?
No. It changes only the node’s displayed usage or status text. Ask for your preferred response language in the prompt or system instructions.

Can I use the chat nodes with a different server?
They are designed around an OpenAI-compatible endpoint and may work with another server that implements the needed API. Automatic NInfer process management and NInfer-specific behavior do not necessarily apply to that server.

Learn More about comfy-ninfer-api

  • Minimal chat workflow: A small example showing Client → Chat → preview.
  • Full chat workflow: An example connecting the options chain and Server Control as well as the chat nodes.
  • Workflow guide: Step-by-step diagrams explaining how the example graphs connect. You can open a workflow JSON by dragging it onto the ComfyUI canvas or using Workflow → Open.
  • NInfer project: Background on the separate server used by this extension.
  • Chinese README: The author’s documentation in Chinese.

comfy-ninfer-api Related Nodes

RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.