EasyRAG - Document Loader
The unglamorous first step that makes RAG possible
- Documents
- summary
Every RAG pipeline in ComfyUI starts the same boring way: you need to get a document into the graph as something a vector store can chew on. That's this node. It's called EasyRAG - Document Loader in the menu, and it's the least exciting node in the pack - one dropdown, two outputs, nothing else. You'll use it for about ten seconds per workflow, and then you'll stop noticing it. That's fine. It's doing the unglamorous job of turning a real file into the RAG_DOCUMENTS format that the whole rest of the EasyRAG chain depends on.
What it actually does
The node reads a single file from ComfyUI's input folder and parses it into text. Supported formats are exactly four: txt, md, json, and pdf - that's hardcoded in the pack's source, so don't expect docx or xlsx to work. PDFs go through pypdf, JSON gets flattened to text so its keys and values survive as retrievable content, and plain text/markdown are read as-is. On the output side you get two things: the parsed Documents (the RAG_DOCUMENTS type) and a summary string that tells you how many files made it through.
The wire that matters is the first one. Documents plugs straight into the EasyRAG - Vector Store Builder (FAISS) node's documents input, which is where the actual embedding and indexing happen. The summary string is informational - handy if you're building a "show me what loaded" workflow, ignorable otherwise.
The one input you actually touch
document is an enum listing every supported file sitting in your input folder. If you don't see your file there, use the Upload Document button the node adds to its own widget - the pack ships a small web extension that pushes a file into ComfyUI/input for you, which is the author's answer to the classic "wait, I need to restart to see my file?" friction. The tooltip says exactly this: select a doc, and if it's not in the list, upload it first.
Two gotchas worth knowing before you hit Queue:
- The dropdown is populated from the input folder at load time. If you dump a file into
inputwhile ComfyUI is already running, it won't show up until you refresh. The upload button dodges this for you; manual file drops don't. - Unsupported types are rejected at validation time, not with a confusing mid-run crash - you'll get a "不支持的文件类型" (unsupported file type) error in the node itself. The 0.3% of the time this happens it's because someone tried to load a
.csvor a.docx.
Installing it
You get this node as part of the whole ComfyUI Easy RAG pack, so install the pack, not the node. Easiest is ComfyUI Manager - search "ComfyUI Easy RAG" and hit install. Or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/nregret/Comfyui-Easy-RAG
cd Comfyui-Easy-RAG
pip install -r requirements.txt
Then restart ComfyUI. The dependencies (faiss-cpu, sentence-transformers, requests, pypdf) are all pull-only - nothing heavyweight here, and everything runs on CPU for the embedding side anyway. The nodes land under the RagPrompt category in the node menu.
The honest take: this loader is the part of EasyRAG you could replace with any other document-reading node in about five minutes. Its real value is that it speaks the pack's RAG_DOCUMENTS type natively, so there's no adapter to build. If you already have a folder of prompt text you'd rather pull in wholesale instead of one file at a time, skip this node and go straight to the Prebuilt Document Loader - same output type, but it reads whole directories from the pack's bundled corpus. This one is for the single PDF or text file you want to ground a conversation in.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| document | COMBO | Select a document (txt/json/md/pdf). Use the Upload Document button below to put a file into the input folder first. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| Documents | RAG_DOCUMENTS | — |
| summary | STRING | — |