knoten / builtin / ai / localai
Classify Image
Label an image on-device with any installed image-classification model
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Label what an image shows, with confidence scores, using a model that runs in your browser so the image never leaves your device.
What it does
Section titled “What it does”Classify Image runs the Image through the image-classification model you pick, such as MobileNet v2 (TensorFlow.js) or ViT base (patch16) (transformers.js). It returns the labels the model knows, each with a score from 0 to 1. The labels come from the model; the built-in ones recognise everyday objects and animals, such as “golden retriever” or “laptop”.
Labels below Confidence threshold are dropped, the rest are sorted best first and cut to Top-K results. There is no cost per run and no API key.
When to use it
Section titled “When to use it”- Tag screenshots or downloaded images with what they contain.
- Branch a workflow on the content of an image, for example only save photos of a product type.
To find several objects and where they are, use Detect Objects. For a sentence describing the image, use Caption Image.
Inputs and settings
Section titled “Inputs and settings”| Einstellung | Typ | Was es bewirkt |
|---|---|---|
| Model | Model picker | Any installed image-classification model, across engines. |
| Image | Media | Image URL, data URL, or $binary from a previous node. |
| Confidence threshold | Number | Drop predictions below this score. Standard: 0.1 |
| Top-K results | Number | Standard: 5 |
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 | Typ | What it holds |
|---|---|---|
| predictions | List of entries | Labels above the threshold, best first |
| top | Text | The best label, or null when none passed |
| score | Number |
{ "predictions": [], "top": "…", "score": 0}Each entry in predictions is { label, score }, and score is the score of top. Branch on {{ $input.top }} with an IF that checks whether it contains a word, since labels often hold several names (“tabby, tabby cat”).
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”Tag the image you right-click:
- Context Menu with Menu Contexts set to Image.
- Classify Image with Model ViT base (patch16), Image (From input)
{{ $input.srcUrl }}, Confidence threshold 0.2 and Top-K results 3. - Show Notification with Title
Looks likeand Message{{ $input.top }}.
Common issues
Section titled “Common issues”- “Choose a model to classify with.” 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 the field you point to.
topis null orpredictionsis empty. No label reached Confidence threshold. Lower it, or try ViT base (patch16) instead of MobileNet v2.- The first run is slow. The model downloads and loads on first use; later runs are fast.
Related nodes
Section titled “Related nodes”- Detect Objects: find, count and locate objects.
- Caption Image: describe the image in a sentence.
- Screenshot Page: capture the page to classify.
- Run Local Model: segmentation, depth maps and custom models.