Replicate lucataco/moondream2
The tiny fast image captioner, via API
- image
- STRING
Moondream2 is the small, fast vision-language model - a tiny VLM that punches well above its size for quick image captioning and simple visual questions. Where LLaVA-13B is the heavyweight, Moondream is the featherweight you reach for when you want a fast, cheap "what's in this picture" and don't need paragraphs. This is lucataco's packaging run through Replicate: REPLICATE_API_TOKEN, pay-per-run, nothing downloaded.
In a ComfyUI graph the job is the same as any captioner - image in, text out - but Moondream's speed and low cost make it the natural pick for batch captioning or a quick auto-prompt where you don't want to wait on a big model.
How it works
Moondream pairs a vision encoder with a compact language model, small enough to be genuinely quick. You send it an image and an instruction; it returns a STRING. As with any VLM, the prompt is your question or instruction to the model, not an image-generation prompt. The node relays everything to the hosted model on Replicate and hands back the text.
The inputs and outputs that matter
There are really only two things to set:
image(required) - the picture to caption or ask about.prompt(default "Describe this image") - what you want. Leave the default for a plain caption, or ask something specific ("Is there a dog?", "What's the main color?").
force_rerun forces a fresh run instead of a cached one. Output is a single STRING - wire it into a text node or a downstream prompt input.
That's the whole surface, and that's the appeal: it's a captioner with no dials to fuss over.
How to install it
One install covers every Replicate node.
- ComfyUI Manager: search ComfyUI-Replicate, install, restart.
- Manual:
then restart.cd ComfyUI/custom_nodes git clone https://github.com/replicate/comfyui-replicate cd comfyui-replicate pip install -r requirements.txt
Nothing lands on your GPU - Moondream runs on Replicate's servers, so the only install is the replicate Python client. Set your token before launching ComfyUI: export REPLICATE_API_TOKEN="r8_..." (replicate.com/account/api-tokens). No token, no runs.
Common issues & troubleshooting
Auth error first run. REPLICATE_API_TOKEN must be set before ComfyUI launches. Set it, restart.
It gave me text, not an image. Correct - this is a captioner. Image in, STRING out. Send the string wherever you consume text.
The answer missed detail or got something wrong. It's a small model; that's the trade. Moondream is great for a fast general caption and simple yes/no visual questions, weaker on fine detail, counting, and reading text in the image. If you need depth, step up to LLaVA-13B or Qwen-VL; if you need speed and volume, this is the one.
Same answer on re-run. Replicate cached identical inputs. Change the prompt or set force_rerun.
It bills per call. Each caption is a paid Replicate prediction. Moondream is about as cheap as these get, which is exactly why it's good for batches - but it's still metered.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| promptopt | STRING | Describe this image | — |
| force_rerunopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |