nœuds / builtin / ai / localai
Caption Image
Describe an image in words, on-device
Ce contenu n’est pas encore disponible dans votre langue.
Describe an image in a short sentence with a model that runs in your browser, so the image never leaves your device.
What it does
Section titled “What it does”Caption Image runs the Image through an image-to-text model, such as ViT-GPT2 captioning, and returns one caption, for example “a dog sitting on a couch”. The image can be a web address, a data URL, raw base64, or a file passed from an earlier node. There is no cost per run and no API key.
Captioning models are small: expect a short, plain description, not a detailed analysis.
When to use it
Section titled “When to use it”- Write draft alt text for images on a page.
- Turn a screenshot or photo into words that a text step can store, search or summarize.
To get labels with scores, use Classify Image. To count or locate things, use Detect Objects.
Inputs and settings
Section titled “Inputs and settings”| Réglage | Type | Ce que cela fait |
|---|---|---|
| Model | Model picker | Any installed image-captioning model. |
| Image | Media | Image URL, data URL, or $binary from a previous node. |
Image has four tabs. From input takes an expression that points to an image from an earlier node, such as {{ $input.dataUrl }} after Screenshot Page or {{ $binary }} for an attached file. URL takes a web address. Upload and Base64 store a fixed image with the node, handy for trying a model.
Outputs
Section titled “Outputs”-
Output
Each output item has these fields:
| Field | Type | What it holds |
|---|---|---|
| text | Text |
{ "text": "…"}text is the caption. Use it as {{ $input.text }} in the next node.
Dependencies and credentials
Section titled “Dependencies and credentials”None. This node needs no connection and has no slots for other nodes.
The Model picker lists your installed models first, then models that download on first use. Manage them on the Local AI page.
Example workflow
Section titled “Example workflow”Copy alt text for any image you right-click:
- Context Menu with Menu Contexts set to Image.
- Caption Image with Model ViT-GPT2 captioning and Image (From input)
{{ $input.srcUrl }}. - Clipboard Write with Text
{{ $input.text }}.
Common issues
Section titled “Common issues”- “Choose a captioning model.” Model is empty. Pick one.
- “No image provided. Pass an image URL, a data URL, or a $binary image from a previous node.” Image is empty, or its expression returned nothing. Check that the field you point to exists on the incoming item.
- The caption is vague or off. Small captioning models miss details. Crop to the subject with Edit Image, or use Classify Image for labels.
- The first run is slow. The model downloads and loads on first use; later runs are fast.
Related nodes
Section titled “Related nodes”- Classify Image: labels with confidence scores.
- Detect Objects: find and count objects.
- Screenshot Page: capture the page to caption.
- Generate Text: rewrite or translate the caption on-device.