Moondream (Vision LM to analyze images)
The tiny vision model that answers questions about your image
- image
- text
The Moondream node drops a real vision language model into your graph: give it an image, ask it a question in plain English, and get a text answer out the other side. No API key, no cloud call, no GPU required. Moondream (the model is vikhyatk/moondream2 on HuggingFace) blew up in early 2024 as the "runs on your CPU" captioner that made BLIP look like a caveman, and it's still one of the few vision LMs you can genuinely treat as a utility instead of a project. This node is a fork of ComfyUI-Hangover-Moondream that InstantStudio trimmed to fit their own pipeline - the default prompt asks for a person's gender, age range, hair color and hairstyle, which tells you exactly what their internal workflow was doing.
What you'd actually use it for
Think of it as an interrogation node. Feed it a generated image and ask "is this person wearing glasses?" or "what's in the background?", then wire the text into a string matcher or a switch to route the workflow. That's the classic use in the wider ComfyUI ecosystem - kijai has his own Moondream node, and SUPIR workflows used it as the captioner. It's also handy as a cheap quality gate: batch through 20 images and get a one-line description of each for tagging.
How it works
The node is lazy about loading. On your first run it pulls moondream2 from HuggingFace (the model is under two billion parameters, so "cpu" is the default device for a reason - a laptop can run this, just slowly), then it stays in memory until you change the device or the model revision. Two details make it nicer than the average wrapper:
- One line of the prompt = one question. The node splits your prompt on newlines, asks each one separately, and joins the answers with the
separatorfield (default,). Want four attributes? Type four lines. - The revision dropdown updates itself. On import it fetches
versions.txtfrom the model repo, so themodel_revisionlist is always current, and the newest revision becomes the default. The first entry -ComfyUI/models/moondream2- means "use a copy I put in my models folder myself" instead of downloading.
Temperature works the way you'd hope: 0 (the default) is greedy/deterministic, anything above switches on sampling.
Inputs and outputs that matter
The full input list is image, prompt (multiline), separator, model_revision, temperature, and device. In practice you touch three of them:
- prompt - your questions, one per line
- model_revision - leave it on the latest unless a revision update breaks something
- device - switch from cpu to gpu if you have a card and want it fast
The output is a single text STRING - one line per image in your batch, answers joined by the separator. That's it. Wire it into a text display node to read it, or into a condition/matcher node to branch on it.
Installing it
Via ComfyUI Manager, search for ComfyUI-InstantStudio and install. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/InstantStudioAI/ComfyUI-InstantStudio
cd ComfyUI-InstantStudio
pip install -r requirements.txt
Then restart ComfyUI. (One footgun: the README's install section says cd comfy_instant_studio - that folder doesn't exist; the clone is ComfyUI-InstantStudio.) The model downloads itself on first run, so no separate model setup. Note the requirements list flash_attn and pyvips, but none of the node code imports either - they're inherited from the upstream fork. flash_attn in particular is the classic pain point here: no Windows wheels, compiles from source, and can make pip install -r requirements.txt blow up. If that happens, it's safe to remove it and the other unused deps from the list before installing.
Common issues
- GPU out of memory - the code catches this and suggests CPU or smaller images; the model is small enough that CPU genuinely works.
- Load failures after a model update - newer
moondream2revisions sometimes demand a newer transformers. The error handler hints at "transformer package compatibility," and upgradingtransformersusually fixes it.
Honest take: Moondream's 2024 "best captioner ever" hype faded, but as a self-contained ask-a-question node this still does the job with zero cloud dependency. That's a lot of value for one node.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| prompt | STRING | What is the gender, the age range, hair color, and hairstyle of the person in the image? Respond with only these four attributes. | — |
| separator | STRING | , | — |
| model_revision | COMBO | 2025-06-21 | 13 options: ComfyUI/models/moondream2, 2024-03-04, 2024-03-06, 2024-03-13, 2024-04-02, 2024-05-08, +7 |
| temperature | FLOAT | 0.000–1 | — |
| device | COMBO | cpu | 1 options: cpu |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |