Skip to main content

Self-hosting

docker run -p 3000:3000 -v ./data:/app/storage ghcr.io/tracefinity/tracefinity

The -v ./data:/app/storage mount persists your data between container restarts. Everything is served on port 3000 (frontend and API).

Environment variables

VariableDefaultDescription
TRACERSisnetComma-separated list of tracing models to load
GOOGLE_API_KEYGemini API key for LLM-assisted tracing
GEMINI_IMAGE_MODELgemini-3.1-flash-image-previewGemini model for tracing (Docker default: gemini-3-pro-image-preview)
REPLICATE_API_TOKENReplicate API token for remote tracing
REPLICATE_MODELmen1scus/birefnetModel to run on Replicate
REPLICATE_RESOLUTIONResolution for Replicate processing
FAL_KEYfal.ai API key for remote tracing
FAL_MODELfal-ai/birefnet/v2Model to run on fal.ai
FAL_OPERATING_RESOLUTION1024x1024Resolution for fal.ai processing
STORAGE_PATH./storageData directory path

Local tracers

Local tracers run saliency models in-process. They require ONNX Runtime and AVX CPU instructions. On non-AVX CPUs, local tracers are unavailable; use a remote tracer instead.

TracerQualitySpeedMin RAM
isnet (default)Good~0.8s/image2 GB
inspyrenetGood~2.8s/image6 GB
birefnet-liteBest~3.6s/image8 GB

RAM figures are combined (tracer + U2-Net paper detection model) and tested in Linux containers.

Remote tracers

Remote tracers offload the saliency step to a hosted GPU. All OpenCV processing stays local. User photos transit the provider when a remote tracer is active.

ProviderEnv varNotes
ReplicateREPLICATE_API_TOKENAPI predictions auto-purge after ~1h
fal.aiFAL_KEYUses mask_only + sync_mode (result not stored in history)

When no TRACERS env var and no LLM key is set, the provider is auto-detected from whichever token is present.

Tech stack

LayerTechnology
FrontendNext.js 16, React 19, TypeScript
3D previewreact-three-fiber, Three.js
BackendPython, FastAPI
3D geometrymanifold3d, trimesh
Image processingOpenCV
Local modelsONNX Runtime
Export formatsSTL, 3MF

Building from source

git clone https://github.com/tracefinity/tracefinity.git
cd tracefinity

# backend
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# frontend
cd ../frontend
pnpm install

# run both
cd ..
make dev

Backend runs on port 8000, frontend on port 4001.

Linting

make lint # run all linters
make lint-backend # ruff only
make lint-frontend # eslint + tsc --noEmit
make lint-fix # auto-fix where possible