DB Load Node
Your reference image, but found by vector search instead of a folder
- Pose image
- Style image
This is the retrieval half of a small RAG experiment. You feed it a text query, and it goes and finds you an actual image - not by matching a filename, but by embedding your text with CLIP, searching a Qdrant vector database, and pulling the top hit out of a MinIO/S3 bucket. Out come two IMAGE tensors, one meant for ControlNet (pose) and one for IP-Adapter (style).
Honest framing first: this pack is a Russian-language diploma project ("RAG for illustrators"), a proof of concept rather than a production tool. It has effectively zero community footprint - nobody is sharing workflows built on it. You're not here because it's popular; you're here because it's the cleanest public example of the idea: use an LLM to split a prompt into search queries, then retrieve real references instead of guessing. Treat it as a blueprint you can steal from.
How it works
The DB Load Node takes the two query strings produced by its sibling, the LLM Node. For each one it runs the same pipeline, straight from the source (services/retrieval_service.py):
ClipModel.embed_text()encodes your query with OpenAI's CLIP ViT-B/32 (this loadsopenai/clipfrom pip and downloads the weights on first use).- Qdrant searches the collection you picked,
limit=1- the single nearest vector. - It builds a key from the hit's ID plus its
filenamepayload and fetches those bytes from S3 (get_image_bytes). - The bytes get decoded into a standard ComfyUI float
IMAGEtensor.
The CLIP model is baked in - you don't choose it, and it's the same encoder family that embedded the images when they were indexed, which is the whole trick of this working at all.
The inputs and outputs that matter
Four inputs, all required:
pose_queryandstyle_query- plainSTRINGsockets with forced inputs. They're designed to be wired from the LLM Node'spose_query/style_queryoutputs, not typed by hand.pose_collectionandstyle_collection- dropdowns listing the collections Qdrant actually has. Watch for the sentinel values: if Qdrant is unreachable when the node loads, the only choice isno_collections_found. If it's reachable but empty, you getempty_collection.
Outputs: Pose image and Style image, both IMAGE. Wire pose into a ControlNet Apply node, style into an IP-Adapter Apply - that's the intended graph.
Installing it
Via ComfyUI Manager, search for the pack title ComfyUiRagCustomNodes, or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/Santat2023/ComfyUiRagNodes.git
Then restart ComfyUI and look under the MyNodes category. The hard part isn't the install, it's the surroundings: the node does nothing until you have Qdrant running on localhost:6333, MinIO on localhost:9000, and - critically - an actual indexed collection. Collections are created by the author's separate ImageManager app, which captions your images and embeds them; without it, there's nothing to search.
There's no requirements.txt in the repo, so dependencies are on you: qdrant-client, boto3, openai-clip, requests, Pillow. Expect to pip install them yourself.
Where people get burned
- The MinIO credentials are hardcoded. In
nodes/db_load_node.pythe S3 client is created withminioadmin/minioadmin,http://localhost:9000, bucketimages. There's no config for this - if your MinIO has real credentials, you're editing source. - The collection list is frozen at load time.
INPUT_TYPESqueries Qdrant when the node class loads, so a collection you create mid-session won't appear until you reload ComfyUI. - A missing collection just throws. Search a collection that doesn't exist and the node errors - there's no graceful "no results" path.
- Search only ever returns the top-1 hit, so garbage in the index means garbage reference. The quality ceiling here is set by ImageManager's captions, not by anything in this node.
If you just want a reference image in your graph, honestly, drag a file in. This node earns its keep only when you've built out the whole retrieval stack - and then it's a genuinely neat demo of the pattern.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| pose_query | STRING | — | |
| pose_collection | COMBO | 1 options: no_collections_found | |
| style_query | STRING | — | |
| style_collection | COMBO | 1 options: no_collections_found |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| Pose image | IMAGE | — |
| Style image | IMAGE | — |