Nodes/ComfyUI Assistant Node/PVL Call OpenAI Assistant
ComfyUI Node

PVL Call OpenAI Assistant

The node this whole pack is named after

By pvlprk·Created about a year ago·Updated 8 months ago· 1
PVL Call OpenAI Assistant
  • image
  • assistant_response
  • error
assistant_id
seed42
modelgpt-4.1
reasoning_effortdisabled
retry_count3
timeout_seconds25
debugoff
api_key
input_text

Here's a plot twist: the pvlprk/comfyui-pvl-api-nodes pack is called "ComfyUI Assistant Node" - singular - because this is the node it was built around. The README describes exactly one feature ("Call OpenAI Assistant from within ComfyUI") and everything else in the pack grew around it. So when you find PVL Call OpenAI Assistant in your node list, you're looking at the origin of the pack.

What it does: you give it an OpenAI assistant ID and some text (optionally an image), it runs the assistant - thread creation, run, polling, the whole dance - and returns the assistant's text reply plus an error flag. Why would you want that inside ComfyUI? The same reason people put LLMs anywhere in a generation graph: prompt routing, style selection, describing a reference image back to yourself, generating a prompt from a sketch before you hand it to an image model. It turns your workflow's text plumbing into a smart assistant call.

How it works

It uses the OpenAI Assistants API (thread + run), with model defaulting to gpt-4.1. The supported-model list in the source is gpt-4, gpt-4.1, gpt-4o, gpt-4-turbo, gpt-3.5-turbo. It retries failed calls with exponential backoff up to retry_count (3), honors timeout_seconds (25), and an optional image input is attached to the message - so the assistant can actually see what you're working on. seed and reasoning_effort (disabled/low/medium/high) are passed through where the model supports them. The error boolean output is the escape hatch: wire it into your routing logic so a failed call doesn't silently poison the workflow.

Inputs that matter

  • assistant_id (required) - create the assistant in the OpenAI dashboard first, paste its ID.
  • api_key (optional) - leave empty to use the OPENAI_API_KEY env var, which is the safer path.
  • input_text and image (optional) - the message you're sending.
  • model (default gpt-4.1), reasoning_effort, retry_count, timeout_seconds, debug (off/on).

Outputs: assistant_response (STRING) and error (BOOLEAN).

Install

cd ComfyUI/custom_nodes
git clone https://github.com/pvlprk/comfyui-pvl-api-nodes

Restart, and either set OPENAI_API_KEY in the environment or type a key into the api_key input. The pack's requirements.txt includes openai>=1.3, so Manager will get it.

Where people get burned

  • It needs a real Assistant, not just an API key. You must create the assistant in the OpenAI dashboard (or via API) and paste its ID - people skip this and stare at a "no assistant" error for a while.
  • Every call is paid OpenAI usage, and an assistant run can take longer than the default timeout_seconds of 25 on a busy day. Raise it for long jobs.
  • The error boolean is worth honoring. It's there precisely because cloud calls fail; route on it instead of assuming the response text is always valid.
  • The model field defaults to gpt-4.1 but the list is fixed - don't expect arbitrary model names to pass through unless they're in the supported set.
CategoryPVL_tools

Inputs (10)

NameTypeDefaultDescription
assistant_idSTRING
seedINT420–999999
modelSTRINGgpt-4.1
reasoning_effortCOMBOdisabled4 options: disabled, low, medium, high
retry_countINT31–10Number of retry attempts if API fails
timeout_secondsINT255–600Timeout for assistant run in seconds
debugCOMBOoffEnable verbose debug logging
api_keyoptSTRING
input_textoptSTRING
imageoptIMAGE

Outputs (2)

NameTypeDescription
assistant_responseSTRING
errorBOOLEAN