Getting started
Introduction
What Hubstruct is, what it does with your photos and videos, and how the pieces fit together.
Hubstruct is a media library that does the organizing for you. You upload your photos, GIFs and videos, and it works out what's in each one. The people, the places, the objects, the mood, the text written in the picture and anything else you ask it to look for become tags, descriptions, titles and search results. It also groups the people it sees, finds duplicates and keeps albums up to date by themselves.
It comes in two forms that run the same software:
- Self-hosted, free, on your own hardware with Docker Compose. Your media, the database and the AI models all stay on your machine.
- Hubstruct Cloud, where we run it for you. It's free to start, and Plus is $8 a month.
What it does
Every new media goes through a series of processing steps, each run by an AI model or by plain image code. Here is what you get out of them, and where to read more:
| What you see | How it gets there | Read more |
|---|---|---|
| Thumbnails and previews, with a blurry placeholder while they load | Made from the original | Media |
| Smart tags, applied by themselves when the model is sure | A vision classifier answers "does this tag fit?" for each of your smart tags | Tags |
| A description and a title for every media | A vision-language model (Gemma) looks at it and writes them | Media |
| The text in the picture, such as signs, captions, screenshots and comics | A text detector finds it, then Gemma reads it | Search |
| Faces, grouped into people you can name | A face detector and face embeddings, then clustering | People |
| Search by meaning, by picture, or by any detail | Every media becomes one embedding of its text and pixels, searched with full text too | Search |
| Albums that fill themselves | Album rules re-run as new media is processed | Albums |
| Duplicates and near duplicates | Perceptual hashes and image embeddings, checked against the pixels | Duplicates and stacks |
| NSFW flags, with media hidden until you choose to look | A classifier score against a threshold you set | NSFW |
You can correct all of it. Lock a tag on or off, rewrite a title, say a face isn't someone, or take a media out of an album. Hubstruct keeps your corrections and doesn't overwrite them when it runs again.
What it isn't
- It's not a backup. Hubstruct organizes media. A library does keep its originals in Hubstruct's storage, but you should still back it up like anything else you care about.
- It's not an editor. It doesn't crop, filter or convert your media. Videos play as they were uploaded.
- It doesn't need the internet. Self-hosted, every model runs locally. Nothing is sent anywhere, apart from Google if you turn on Google sign-in.
How the pieces fit together
A self-hosted install is a handful of containers, each with one job:
Browser ──► console (the app) ──► api ──► postgres (+ pgvector)
│
├──► storage (S3: originals, thumbnails, mosaics)
└──► models (search embeddings)
worker ──► postgres, storage
├──► models (Gemma: descriptions, titles, text; d1: smart tags, NSFW; embeddings)
└──► vision (faces, finding text)
- The console is the app you open in the browser. It never talks to the database itself: everything goes through the api.
- The worker does all the background work. There's no job queue: it looks at the data to see what's due, and does it. That's why Hubstruct picks up where it left off after a restart, and why turning a model off simply pauses the steps that need it.
- The models run in their own containers on your GPU: models (llama.cpp) for Gemma, the embeddings and d1 (the tag and NSFW classifier), and vision for faces and text detection.
How it works explains each part in depth.
Libraries
Everything in Hubstruct lives in a library, which keeps its media in Hubstruct's own storage. You upload into it. You can have as many libraries as you like, and nothing mixes between them. Each has its own media, tags, albums, people, groups, duplicates and trash.