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 seeHow it gets thereRead more
Thumbnails and previews, with a blurry placeholder while they loadMade from the originalMedia
Smart tags, applied by themselves when the model is sureA vision classifier answers "does this tag fit?" for each of your smart tagsTags
A description and a title for every mediaA vision-language model (Gemma) looks at it and writes themMedia
The text in the picture, such as signs, captions, screenshots and comicsA text detector finds it, then Gemma reads itSearch
Faces, grouped into people you can nameA face detector and face embeddings, then clusteringPeople
Search by meaning, by picture, or by any detailEvery media becomes one embedding of its text and pixels, searched with full text tooSearch
Albums that fill themselvesAlbum rules re-run as new media is processedAlbums
Duplicates and near duplicatesPerceptual hashes and image embeddings, checked against the pixelsDuplicates and stacks
NSFW flags, with media hidden until you choose to lookA classifier score against a threshold you setNSFW

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:

text
 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.

Where to next