Nodes/ComfyUI-Hangover-Moondream/Moondream Interrogator
ComfyUI Node

Moondream Interrogator

Ask a tiny vision model anything about your image — no API key, no cloud

By Hangover3832·Created 3 years ago·Updated about a year ago· 45
Moondream Interrogator
  • image
  • description
promptPlease provide a detailed description of this image.
separator\n
model_revision2025-06-21
temperature0.00
devicecpu
trust_remote_codefalse

If you've ever wanted a node that just looks at your image and tells you what's there, this is it. The Moondream Interrogator wraps Moondream 2, a small (~2B parameter) vision-language model from vikhyatk, and runs it entirely on your machine. No API key, no cloud call, no per-image cost. You feed it an image, it answers a question in plain English and hands you the text on a STRING output.

Where does that fit in a real workflow? The obvious one is captioning for training data - the kind of natural-language captions Flux and the newer LLM-encoder bases want, as opposed to the Danbooru tags a WD14 tagger spits out. The community consensus on captioners is roughly "JoyCaption if you want quality, Florence 2 if you want speed, and Moondream if you want something lightweight that's also a genuinely good OCR reader." It won't beat Florence 2 on throughput and it won't match a dedicated tagger for booru tags, but for a "describe this image and dump it to a text file" loop it's more than adequate - and it's the one that runs on CPU without complaint.

How it works

On the first run the node downloads vikhyatk/moondream2 from HuggingFace and loads it through transformers with trust_remote_code=True. That flag matters - Moondream isn't a stock transformers architecture, so its modeling_phi.py and friends are fetched and executed from the Hub. The README is blunt about it: "Additional python code will be downloaded from huggingface and executed. You have to trust this creator if you want to use this node!" If you leave trust_remote_code off, the node just refuses with "You have to trust remote code to use this node!" - by design.

It encodes your image once, then runs your prompt through the model's tokenizer and generates an answer. Clever bit: the prompt field is multiline, and each line becomes a separate question, so you can ask three things in one pass ("Describe this image.", "What text is visible?", "What is the mood?") and get all three answers joined by the separator string. The model stays loaded in memory between runs, so subsequent executions are fast.

The inputs that matter

The full list is small, and most of it you'll leave alone:

  • image (IMAGE) - wire in your Load Image node.
  • prompt (STRING) - your question, one per line.
  • model_revision - this one you might actually touch. It's a dropdown of Moondream snapshots; 2024-07-23 (Thundermoon) is the famous one, because that revision has notably strong OCR. There's also a ComfyUI/models/moondream2 option if you downloaded the files manually.
  • temperature - 0 (default) uses the model's own default sampling; anything above 0 gives you more creative answers.
  • device (cpu/gpu) - pick GPU if you have it; it'll happily chug along on CPU either way.
  • trust_remote_code - must be True, see above.

The single output is description (STRING), which you wire into a Save Text node, a text encoder, or anything else that eats a string. For a batch, each image's answer lands on its own line.

Installing it

ComfyUI Manager is the easy path - search "Moondream" or the pack title. Manual install:

cd ComfyUI/custom_nodes
git clone https://github.com/Hangover3832/ComfyUI-Hangover-Moondream

Then restart ComfyUI. The requirements.txt pulls in transformers>=4.44.0, timm, accelerate, einops, torchvision and - the surprise guest - pyvips. On Windows, the 2025 model revisions need the libvips binaries (libvips-42.dll) on your PATH or dropped into the ComfyUI portable root folder, or those newer snapshots won't load.

Where people get burned

First, the elephant in the room: the repo is no longer maintained - the README says so right at the top. It works today, but it's a time bomb against future transformers changes.

Second, the "Tensor size mismatch" error. That's the classic symptom of an old cached model colliding with a newer transformers. Fix: pick the newest model_revision in the node (which forces re-download of the matching files) and, if you want the disk space back, delete the old cache under user\.cache\huggingface - models--vikhyatk--moondream1 and modules\transformers_modules\vikhyatk\moondream1 can both go. Older moondream1 support was dropped entirely when the pack went Apache 2.0.

Third, don't hand-place a manually downloaded 2025 model into ComfyUI/models/moondream2 - the node explicitly refuses those local 2025 revisions. Downloading via the revision dropdown works; that path doesn't.

Final honest caveat: for serious training-caption work you'll usually reach for something stronger. But for a "what's in this image, and what does it say?" node that lives entirely on your box, Moondream is hard to beat.

CategoryHangover

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
promptSTRINGPlease provide a detailed description of this image.
separatorSTRING\n
model_revisionCOMBO2025-06-2113 options: ComfyUI/models/moondream2, 2024-03-04, 2024-03-06, 2024-03-13, 2024-04-02, 2024-05-08, +7
temperatureFLOAT0.000–1
deviceCOMBOcpu1 options: cpu
trust_remote_codeBOOLEANfalse

Outputs (1)

NameTypeDescription
descriptionSTRING