# sd-server configuration -- EnvironmentFile for sd-server.service # After changes: systemctl restart sd-server # Base directory for model files. Configurable; on some deployments this may # point to a path under /home or a separate mount (requires a systemd drop-in # for ReadOnlyPaths/ProtectHome, see the .service file). SD_MODELS_DIR=/var/lib/sd-cpp/models # Path to the diffusion model to load (MUST be set before starting the service). # Supported formats: .gguf (quantized), .safetensors, .pt, .pth # For GGUF quantized models use the .gguf path directly. # For original weights sd.cpp loads .safetensors/.pt natively. SD_MODEL=${SD_MODELS_DIR}/model.safetensors # Bind address -- keep internal, control access via nftables or reverse proxy. # Upstream default port is 1234; we use 8080 here for consistency with other # inference servers. Adjust to taste. SD_HOST=127.0.0.1 SD_PORT=8080 # CPU threads -- conservative default of 2. MUST be adjusted to the machine! # Rule of thumb: number of physical cores (NOT SMT/hyperthreads). # sd.cpp's GGML backend scales with physical cores, not with hyperthreads. SD_THREADS=2 # Extra arguments passed to sd-server, for example: # --diffusion-model /path/to/unet.safetensors # --vae /path/to/vae.safetensors # --lora-model-dir /var/lib/sd-cpp/loras # --verbose # --flash-attn SD_EXTRA_ARGS=