A lightweight, self-hosted booru-style image and video gallery application.
Organize your personal media collection with tags, pools, favorites, and more.
browser-extension/)cat dog-unwanted_tagBackend: FastAPI, SQLAlchemy, SQLite, Pillow, FFmpeg (optional)
Frontend: Vue.js 3, Vite, Pinia, Vue Router
Windows:
start-dev.bat
Linux / macOS:
chmod +x start-dev.sh
./start-dev.sh
Windows:
start.bat
Linux / macOS:
chmod +x start.sh
./start.sh
# Create virtual environment
python -m venv venv
# Activate (Windows)
venv\Scripts\activate
# Activate (Linux/macOS)
source venv/bin/activate
# Install dependencies
pip install -r backend/requirements.txt
# Run server
cd backend
python run.py
cd frontend
npm install
npm run dev
nekobooru/
├── backend/
│ ├── app/
│ │ ├── main.py # FastAPI app
│ │ ├── config.py # Configuration
│ │ ├── database.py # Database setup
│ │ ├── routers/ # API endpoints
│ │ ├── models/ # SQLAlchemy models
│ │ └── services/ # Business logic
│ ├── run.py # Dev server
│ └── requirements.txt
├── frontend/
│ ├── src/
│ │ ├── views/ # Page components
│ │ ├── components/ # Reusable components
│ │ ├── stores/ # Pinia stores
│ │ ├── api/ # API client
│ │ └── router/ # Vue Router
│ └── package.json
├── data/ # Media storage
│ ├── posts/ # Original files
│ ├── thumbs/ # Thumbnails
│ └── nekobooru.db # Database
└── config/
└── settings.json # User settings
| Endpoint | Description |
|---|---|
| GET /api/posts | List posts with search and pagination |
| POST /api/uploads | Upload a file |
| GET /api/tags | List tags |
| GET /api/pools | List pools |
| GET /api/settings/stats | Storage statistics |
Full API documentation is available at /docs when the server is running.
NEKO_PORT=8772 # Backend port
NEKO_HOST=0.0.0.0 # Backend host
NEKO_DEBUG=True # Debug mode
The data directory can be configured in the Settings page or by editing config/settings.json.
AI tagging is off by default and not part of the base install or the shipped binary — the model stack (torch/CUDA, onnxruntime, transformers) is large, so you install it only where you want it.
The easiest way is the installer script, which creates/uses the project venv, installs everything, and verifies torch/onnxruntime:
# Windows (auto-detects the GPU and installs the matching stack):
.\install-ai.ps1 # auto: standard / legacy / CPU based on the GPU
.\install-ai.ps1 -CPU # force CPU only
.\install-ai.ps1 -Legacy # force older Pascal GPU (GTX 10-series, CUDA 12.6)
.\install-ai.ps1 -GPU # force standard CUDA 12.8
# Linux / macOS:
./install-ai.sh # auto-detect
./install-ai.sh --cpu / --legacy / --gpu
The installer is idempotent and self-healing: it detects the GPU's compute
capability via nvidia-smi (7.0+ → CUDA 12.8, 6.x Pascal → CUDA 12.6, else CPU),
skips work if the right build is already present, and if an installed build can't
launch a kernel on your GPU it uninstalls it and installs the correct one (auto
falling back standard → legacy → CPU).
Or install manually into the Python environment running NekoBooru:
# NVIDIA GPU (CUDA 12.8):
pip install -r backend/requirements-tagger.txt
# Older Pascal GPU — GTX 10-series / sm_61 (CUDA 12.6):
pip install -r backend/requirements-tagger-legacy.txt
# CPU only (slower; large models may be impractical):
pip install -r backend/requirements-tagger-cpu.txt
Then open Settings → Auto Tagging, toggle Enable AI features, and download the models you want. The web UI also shows these commands and a CPU/GPU picker when the runtime isn't installed yet.
CL Tagger v2 is a SigLIP2-based Danbooru tagger with a 108k-tag vocabulary (characters, copyrights, general, rating). It is gated, so before downloading it:
Its thresholds are floored at 0.55 — the value the model card recommends — regardless of the lower app-wide general/character thresholds, because a 108k-tag vocabulary over-tags badly below that.
To see how fast tagging runs on your hardware (and the GPU vs CPU speedup), run the benchmark with the venv that has the AI stack:
# Windows
venv\Scripts\python.exe benchmark-tagger.py
# Linux / macOS
venv/bin/python benchmark-tagger.py
It times the default WD tagger (preprocess + inference) on CPU and GPU and prints
per-image latency, throughput, and projected times for bulk runs. Use
--images <folder> to benchmark your own files, or --device cpu|gpu|both.
ONNX taggers on the GPU:
onnxruntime-gpuships no CUDA libraries of its own — it loads cuDNN 9 and the CUDA 12 runtime by name at session creation. Those DLLs already come with thetorchwheel, but on Windows they sit in a directory Windows never searches, so without help onnxruntime reports "Require cuDNN 9.* and CUDA 12.*" and every ONNX tagger (WD, Camie, CL, PixAI) silently runs on CPU. NekoBooru preloads them automatically from the installed torch (ornvidia-*) wheels, so no separate CUDA Toolkit or cuDNN install is needed.
Older NVIDIA GPUs: PyTorch's default CUDA 12.8 builds dropped Maxwell/Pascal/Volta support, so on a GTX 10-series card (e.g. 1060,
sm_61) the standard GPU install fails with "no kernel image is available for execution on the device". Use the Legacy option above (CUDA 12.6 wheels, which still includesm_61). Maxwell cards (GTX 9-series,sm_50/52) aren't in CUDA 12.6 either — use the CPU stack there.
Packaged Windows note: the shipped Windows
nekobooru.exestill keeps torch/onnxruntime/transformers out of the main frozen process, but the installer can create a managed local AI worker venv. Local AI requests are forwarded to that worker, while source checkouts can still run AI directly or through a remote GPU worker.
If your GPU is on a different LAN machine, keep the main server light and offload tagging to a worker:
pip install -r backend/requirements-tagger.txt), reachable on the LAN
(NEKO_HOST=0.0.0.0), and set a shared secret:
NEKO_TAGGER_WORKER_TOKEN=<your-secret>
Download/load the models there via its own Settings → Auto Tagging.http://192.168.1.50:8772) and the
same token, then click Test connection.All tagging (uploads, per-post, and bulk backfill jobs) is then forwarded to the worker's
/api/auto-tags/infer endpoint. If the worker is offline, uploads are still saved — just untagged —
and you'll see a warning. Setting NEKO_TAGGER_WORKER_TOKEN is recommended since the worker has no
authentication otherwise.
Windows:
build-windows.bat
Linux:
./build-ubuntu.sh [version]
sudo bash install-service.sh [username]
sudo systemctl enable nekobooru
sudo systemctl start nekobooru
Python
44.5%
Vue
27.0%
JavaScript
14.4%
Kotlin
8.1%
Shell
2.0%
PowerShell
1.3%
A lightweight, self-hosted booru-style image and video gallery application.
Organize your personal media collection with tags, pools, favorites, and more.
browser-extension/)cat dog-unwanted_tagBackend: FastAPI, SQLAlchemy, SQLite, Pillow, FFmpeg (optional)
Frontend: Vue.js 3, Vite, Pinia, Vue Router
Windows:
start-dev.bat
Linux / macOS:
chmod +x start-dev.sh
./start-dev.sh
Windows:
start.bat
Linux / macOS:
chmod +x start.sh
./start.sh
# Create virtual environment
python -m venv venv
# Activate (Windows)
venv\Scripts\activate
# Activate (Linux/macOS)
source venv/bin/activate
# Install dependencies
pip install -r backend/requirements.txt
# Run server
cd backend
python run.py
cd frontend
npm install
npm run dev
nekobooru/
├── backend/
│ ├── app/
│ │ ├── main.py # FastAPI app
│ │ ├── config.py # Configuration
│ │ ├── database.py # Database setup
│ │ ├── routers/ # API endpoints
│ │ ├── models/ # SQLAlchemy models
│ │ └── services/ # Business logic
│ ├── run.py # Dev server
│ └── requirements.txt
├── frontend/
│ ├── src/
│ │ ├── views/ # Page components
│ │ ├── components/ # Reusable components
│ │ ├── stores/ # Pinia stores
│ │ ├── api/ # API client
│ │ └── router/ # Vue Router
│ └── package.json
├── data/ # Media storage
│ ├── posts/ # Original files
│ ├── thumbs/ # Thumbnails
│ └── nekobooru.db # Database
└── config/
└── settings.json # User settings
| Endpoint | Description |
|---|---|
| GET /api/posts | List posts with search and pagination |
| POST /api/uploads | Upload a file |
| GET /api/tags | List tags |
| GET /api/pools | List pools |
| GET /api/settings/stats | Storage statistics |
Full API documentation is available at /docs when the server is running.
NEKO_PORT=8772 # Backend port
NEKO_HOST=0.0.0.0 # Backend host
NEKO_DEBUG=True # Debug mode
The data directory can be configured in the Settings page or by editing config/settings.json.
AI tagging is off by default and not part of the base install or the shipped binary — the model stack (torch/CUDA, onnxruntime, transformers) is large, so you install it only where you want it.
The easiest way is the installer script, which creates/uses the project venv, installs everything, and verifies torch/onnxruntime:
# Windows (auto-detects the GPU and installs the matching stack):
.\install-ai.ps1 # auto: standard / legacy / CPU based on the GPU
.\install-ai.ps1 -CPU # force CPU only
.\install-ai.ps1 -Legacy # force older Pascal GPU (GTX 10-series, CUDA 12.6)
.\install-ai.ps1 -GPU # force standard CUDA 12.8
# Linux / macOS:
./install-ai.sh # auto-detect
./install-ai.sh --cpu / --legacy / --gpu
The installer is idempotent and self-healing: it detects the GPU's compute
capability via nvidia-smi (7.0+ → CUDA 12.8, 6.x Pascal → CUDA 12.6, else CPU),
skips work if the right build is already present, and if an installed build can't
launch a kernel on your GPU it uninstalls it and installs the correct one (auto
falling back standard → legacy → CPU).
Or install manually into the Python environment running NekoBooru:
# NVIDIA GPU (CUDA 12.8):
pip install -r backend/requirements-tagger.txt
# Older Pascal GPU — GTX 10-series / sm_61 (CUDA 12.6):
pip install -r backend/requirements-tagger-legacy.txt
# CPU only (slower; large models may be impractical):
pip install -r backend/requirements-tagger-cpu.txt
Then open Settings → Auto Tagging, toggle Enable AI features, and download the models you want. The web UI also shows these commands and a CPU/GPU picker when the runtime isn't installed yet.
CL Tagger v2 is a SigLIP2-based Danbooru tagger with a 108k-tag vocabulary (characters, copyrights, general, rating). It is gated, so before downloading it:
Its thresholds are floored at 0.55 — the value the model card recommends — regardless of the lower app-wide general/character thresholds, because a 108k-tag vocabulary over-tags badly below that.
To see how fast tagging runs on your hardware (and the GPU vs CPU speedup), run the benchmark with the venv that has the AI stack:
# Windows
venv\Scripts\python.exe benchmark-tagger.py
# Linux / macOS
venv/bin/python benchmark-tagger.py
It times the default WD tagger (preprocess + inference) on CPU and GPU and prints
per-image latency, throughput, and projected times for bulk runs. Use
--images <folder> to benchmark your own files, or --device cpu|gpu|both.
ONNX taggers on the GPU:
onnxruntime-gpuships no CUDA libraries of its own — it loads cuDNN 9 and the CUDA 12 runtime by name at session creation. Those DLLs already come with thetorchwheel, but on Windows they sit in a directory Windows never searches, so without help onnxruntime reports "Require cuDNN 9.* and CUDA 12.*" and every ONNX tagger (WD, Camie, CL, PixAI) silently runs on CPU. NekoBooru preloads them automatically from the installed torch (ornvidia-*) wheels, so no separate CUDA Toolkit or cuDNN install is needed.
Older NVIDIA GPUs: PyTorch's default CUDA 12.8 builds dropped Maxwell/Pascal/Volta support, so on a GTX 10-series card (e.g. 1060,
sm_61) the standard GPU install fails with "no kernel image is available for execution on the device". Use the Legacy option above (CUDA 12.6 wheels, which still includesm_61). Maxwell cards (GTX 9-series,sm_50/52) aren't in CUDA 12.6 either — use the CPU stack there.
Packaged Windows note: the shipped Windows
nekobooru.exestill keeps torch/onnxruntime/transformers out of the main frozen process, but the installer can create a managed local AI worker venv. Local AI requests are forwarded to that worker, while source checkouts can still run AI directly or through a remote GPU worker.
If your GPU is on a different LAN machine, keep the main server light and offload tagging to a worker:
pip install -r backend/requirements-tagger.txt), reachable on the LAN
(NEKO_HOST=0.0.0.0), and set a shared secret:
NEKO_TAGGER_WORKER_TOKEN=<your-secret>
Download/load the models there via its own Settings → Auto Tagging.http://192.168.1.50:8772) and the
same token, then click Test connection.All tagging (uploads, per-post, and bulk backfill jobs) is then forwarded to the worker's
/api/auto-tags/infer endpoint. If the worker is offline, uploads are still saved — just untagged —
and you'll see a warning. Setting NEKO_TAGGER_WORKER_TOKEN is recommended since the worker has no
authentication otherwise.
Windows:
build-windows.bat
Linux:
./build-ubuntu.sh [version]
sudo bash install-service.sh [username]
sudo systemctl enable nekobooru
sudo systemctl start nekobooru
Python
44.5%
Vue
27.0%
JavaScript
14.4%
Kotlin
8.1%
Shell
2.0%
PowerShell
1.3%