@lowwattlabs/lfit
v1.0.3
Published
⚡ LFIT — Local Free Image Tool. Local HD image generation via stable-diffusion.cpp on Vulkan/iGPU. Free, private, on your hardware.
Downloads
62
Maintainers
Readme
⚡ LFIT — Local Free Image Tool
Local HD image generation. Free. Private. On your hardware.
LFIT runs stable-diffusion.cpp on your Vulkan-capable GPU. No cloud API keys, no per-image fees, no data leaving your machine. Three locked presets — pick by name, get consistent results.
Two tools, both free:
lfit-quick— Pollinations cloud FLUX, ~1.4s. Fast drafts and iteration. Lower fidelity, public service.lfit— Local sd-server on your Vulkan GPU. HD, private, real assets. Pick a preset, get a PNG.
Install
npm install -g @lowwattlabs/lfitQuick Start
# 1. Set up the server (first time only — downloads binary, verifies model/LoRA files)
lfit-server setup
# 2. Start the server
lfit-server start # foreground
lfit-server start --daemon # background
# 3. Generate
lfit --preset standard --prompt "a knight at a castle gate"
lfit --preset background --prompt "misty pine valley at dawn"
lfit --preset hero --prompt "ancient dragon, key art" --yes
# 4. Quick drafts (no server needed)
lfit-quick --prompt "neon cyberpunk alley, game key art"The Three Presets
| Preset | Use for | Size | Steps | LoRA | Time |
|--------|---------|------|-------|------|------|
| standard (default) | Characters, items, single subjects | 1024×1024 | 8 | 8-step Lightning | ~2.5 min |
| background | Scenes, environments, wallpapers, tiles | 1344×768 | 8 | 8-step Lightning | ~2.5 min |
| hero | Final/max-quality key art | 1024×1024 | 32 | None (base SDXL) | ~13 MINUTES |
- Default to
standard. Usebackgroundfor any scene/environment. herorequires--yesflag — it takes ~13 minutes and blocks the server queue.backgroundauto-appends deep-focus phrasing unless you pass--shallow-dof.
How LoRA Actually Works (read this)
The sd-server intentionally ignores <lora:...> prompt tags. Writing <lora:sdxl_lightning_8step_lora:1.0> into the prompt does nothing — it passes through as literal text and you get base SDXL at 8 steps = blurry mush.
The LoRA is applied via a structured "lora" JSON field in the txt2img request. lfit does this automatically per preset. You do not hand-build payloads or call the server directly — just run lfit.
The server's LoRA path-cache is built only on GET /sdapi/v1/loras. lfit warms it automatically before each generation. Without this warm-up, a freshly-restarted server rejects the LoRA path with "invalid lora path."
hero sends no LoRA field → pristine base SDXL with no cumulative drift.
Self-Check: How to Tell It's Working
- A correct
standard/backgroundimage is SHARP. If output is soft/hazy/mushy, the LoRA did not apply — that is a failure, not "just how it looks." lfitdetects LoRA failure two ways:- Small output warning — image data under 1000 bytes
- Fast completion warning — standard/background finishing under 30 seconds means LoRA didn't apply
- Verify manually:
curl -s http://127.0.0.1:7860/sdapi/v1/loras— should listsdxl_lightning_8step_lora
What Was Fixed (2026-05-31)
Before the fix, standard/background were silently running base SDXL at 8 steps because the server ignores prompt-tag LoRAs. The fix: lfit sends the structured "lora" field and warms the path-cache.
--lora-apply-mode at_runtime applies the LoRA non-destructively per request, so no-LoRA requests (hero) get pristine base SDXL with zero cumulative drift. The default immediately mode merges into the f16 weights; the apply/remove round-trip drifts ~0.55/255 and accumulates on a long-running server.
Server Management
lfit-server setup # Download binary, verify model/LoRA files
lfit-server status # Check if server is running
lfit-server start # Start (foreground)
lfit-server start --daemon # Start (background)
lfit-server stop # Stop running serverAPI endpoint: http://127.0.0.1:7860 — A1111-compatible: POST /sdapi/v1/txt2img, GET /sdapi/v1/loras
Check LoRAs: curl -s http://127.0.0.1:7860/sdapi/v1/loras
Server flags (set by lfit-server start automatically):
sd-server \
--listen-ip 127.0.0.1 --listen-port 7860 \
--model /path/to/sd_xl_base_1.0.safetensors \
--lora-model-dir /path/to/loras/ \
--type f16 --vae-tiling --lora-apply-mode at_runtimeKey flags:
--lora-apply-mode at_runtime— Applies LoRA non-destructively per request. No-LoRA requests get pristine base SDXL with zero drift.--vae-tiling— Avoids VAE OOM at 1024+ resolutions on smaller VRAM GPUs.--type f16— Keeps memory usage sane for UMA/integrated GPUs.
Telegram push (optional): Set TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID in your environment. Images auto-push on generation. Pass --no-telegram to skip.
Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| LFIT_SERVER_URL | http://127.0.0.1:7860 | sd-server URL |
| LFIT_MODEL_DIR | ~/.lfit/models/ | SDXL model directory |
| LFIT_LORA_DIR | ~/.lfit/models/loras/ | LoRA directory |
| LFIT_OUT_DIR | ~/.lfit/output/ | Output directory |
| LFIT_SD_BIN | ~/.lfit/bin/sd-server | sd-server binary path |
| LFIT_ENV_FILE | (none) | Env file for Telegram credentials |
Troubleshooting
Image is blurry/soft/mushy on standard or background → The LoRA did not apply. This is the #1 failure mode. Check:
curl -s http://127.0.0.1:7860/sdapi/v1/loras— should listsdxl_lightning_8step_lora- If the lora list is empty, restart the server with
--lora-model-dirpointing to the correct directory - Generation completed in under 30 seconds? That's base SDXL at 8 steps — way too fast for LoRA mode
"invalid lora path" error → The server's path-cache is stale. Restart the server, or trigger a cache refresh with GET /sdapi/v1/loras.
Vulkan OOM at 1024+ → Add --vae-tiling to the server flags. Without it, the VAE allocates a single ~4.8GB buffer at 1024+.
Server not found / connection refused → Is sd-server running? Check with curl -s http://127.0.0.1:7860/sdapi/v1/loras. Start it with lfit-server start or manually.
Very slow generation on hero → Expected. Hero runs 32 steps of full base SDXL with no LoRA. ~13 minutes on a mid-range iGPU.
Requirements
- Python 3.8+
- Vulkan-capable GPU with suitable drivers (minimum 4GB VRAM for standard/background, 8GB recommended for hero)
- stable-diffusion.cpp server binary (
sd-server) with Vulkan support compiled in - SDXL base 1.0 model file (
sd_xl_base_1.0.safetensors) — download from HuggingFace - SDXL Lightning 8-step LoRA — download from HuggingFace
If LFIT saves you time or makes you money, buy us a coffee.
