Nodes/ComfyUI/OpenAI ChatGPT Input Files
ComfyUI Node Runs on cloud

OpenAI ChatGPT Input Files

Turning your docs and PDFs into LLM context

By Comfy-Org·Created 4 years ago·Updated about 9 hours ago· 130,493
OpenAI ChatGPT Input Files
  • OPENAI_INPUT_FILES
  • OPENAI_INPUT_FILES
file

An LLM can only answer from what's in its context window. That's the whole problem this node solves: instead of cramming a document into a prompt, you hand the model an actual file and let it read the thing. OpenAI Chat Input Files grabs a .txt or .pdf from your ComfyUI input folder, wraps it in the format the OpenAI ChatGPT node expects, and hands it over. Reached for whenever your prompt needs grounding - a spec, a log dump, a paper, a dataset summary - that you don't want to paste and truncate by hand.

The mechanism

Pick a file in the file dropdown and this node reads it from ComfyUI's input directory (the same folder your input images live in), encodes it as a data URI, and outputs an OPENAI_INPUT_FILES object. The model then gets the file contents as part of its context when it generates a response. The dropdown is built when the node list loads, so a file you just dropped in may not appear until you refresh the frontend - a classic first-run gotcha.

Only text and PDF files are accepted, and anything over 32 MB is filtered out of the list entirely. No hiding a giant file and hoping - it just won't show up.

The inputs that matter

  • file - which file to load, straight from the dropdown.
  • OPENAI_INPUT_FILES - this is the chain port. Plug the output of one Input Files node into this input on another, and you stack multiple files into a single message. The node's own tooltip tells you to do this, and it works exactly as advertised.

The output is the OPENAI_INPUT_FILES type. It wires straight into the files input on OpenAIChatNode, alongside your images and prompt.

Getting it

It ships with ComfyUI core - the OpenAI partner nodes landed back in May 2025. Nothing to install, nothing to configure locally. The catch is the usual one for this family: it's a cloud call billed through your Comfy account, not your own OpenAI key.

Common issues

The real trap is token arithmetic. The file's contents consume tokens from your context window, so a long PDF is also a pricier request - the price badge on the chat node reflects the model rate, not your file size, and it adds up. If responses come back truncated, the fix is usually in OpenAI Chat Advanced Options: raise max_output_tokens or check whether truncation is dropping your context. And remember the chain trick: one file per node, OPENAI_INPUT_FILES daisy-chained, as many files as you need. It's the boring part of a workflow, but it's the part that makes the model actually useful instead of a very confident guesser.

Categorypartner/text/OpenAI

Inputs (2)

NameTypeDefaultDescription
fileCOMBOInput files to include as context for the model. Only accepts text (.txt) and PDF (.pdf) files for now.
OPENAI_INPUT_FILESoptOPENAI_INPUT_FILESAn optional additional file(s) to batch together with the file loaded from this node. Allows chaining of input files so that a single message can include multiple input files.

Outputs (1)

NameTypeDescription
OPENAI_INPUT_FILESOPENAI_INPUT_FILES