Skip to content

v1.6.0

Choose a tag to compare

@github-actions github-actions released this 03 May 23:05
· 292 commits to main since this release

Browser-based preview, better AI models, and a smoother interactive experience.

This release adds visual preview workflows for image optimization and background removal, two new segmentation models (including state-of-the-art BiRefNet), a quick browser image viewer, and quality-of-life improvements to the interactive media browser.


🖥️ Browser Preview for Optimize and Remove-bg

The headline feature: pass --preview to either optimize or remove-bg to open a local web UI in your browser where you can adjust settings visually before committing the result to WordPress.

# Adjust quality, format, and resize in the browser
localpress optimize 123 --preview

# Tweak model, alpha threshold, and background color
localpress remove-bg 456 --preview

The preview UI includes:

  • Before/after comparison with a draggable slider
  • Live parameter adjustment — change quality, format, model, threshold, background color
  • One-click apply — uploads the result to WordPress when you're happy
  • Stats panel — file size reduction, inference time, applied processing steps

The server runs on localhost with an auto-assigned port, opens your browser automatically, and shuts down cleanly when you close the tab (via WebSocket heartbeat) or click Cancel. No lingering processes.

From the interactive media browser (list -i), use [O] for optimize-with-preview or [R] for remove-bg-with-preview. The lowercase [o] and [r] remain the fast non-preview paths.

🧠 Better Background Removal Models

Two new models join the registry, both significantly better than the original U2-Net:

Model Size License Quality Input Resolution
birefnet-lite ~224 MB MIT State-of-the-art 1024×1024
isnet-general-use ~176 MB Apache-2.0 Great edges 1024×1024
u2net (default) ~176 MB Apache-2.0 Good 320×320
silueta ~44 MB Apache-2.0 Balanced 320×320
u2netp ~4.7 MB Apache-2.0 Basic 320×320

BiRefNet uses a Swin Transformer backbone with bilateral reference — it handles hair, fur, transparent objects, and complex edges dramatically better than U2-Net. The model is MIT licensed and downloaded from the HuggingFace ONNX community on first use.

ISNet uses 1024×1024 input resolution (vs U2-Net's 320×320), which alone produces noticeably sharper masks.

# Use the best model
localpress remove-bg 123 --model birefnet-lite

# Use ISNet for a good balance of quality and speed
localpress remove-bg 123 --model isnet-general-use

The browser preview defaults to birefnet-lite. The CLI default remains u2net for backward compatibility.

🔍 Quick Browser Image Viewer

Press [P] (shift-P) in the interactive media browser to open the selected image in your system browser. This is a terminal-agnostic alternative to the inline iTerm2/Kitty preview — works in any terminal.

The viewer runs on a lightweight localhost server that auto-shuts down when you close the tab, returning you to the TUI seamlessly.

📌 Position Persistence in Interactive List

The interactive media browser now remembers your last page and cursor position across sessions. Quit with [q], come back later with localpress list -i, and you're right where you left off.

Position is stored in the per-site SQLite database via a new preferences key-value table (schema v2 migration, applied automatically).

All Changes

Added

  • optimize --preview — browser-based optimization preview with quality/format/resize controls
  • remove-bg --preview — browser-based background removal preview with model/threshold/color controls
  • birefnet-lite model — state-of-the-art segmentation (MIT, ~224 MB, Swin Transformer backbone)
  • isnet-general-use model — better edge quality than U2-Net (Apache-2.0, ~176 MB, 1024×1024 input)
  • [P] keybinding in list -i — quick browser image viewer
  • [O] keybinding in list -i — optimize with browser preview
  • [R] keybinding in list -i — remove-bg with browser preview
  • Interactive list position persistence (page + cursor saved to SQLite)
  • WebSocket heartbeat for browser close detection in preview server
  • Per-model input sizes in the remove-bg engine
  • Schema v2 migration (adds preferences table)

Changed

  • Default model in preview UI is birefnet-lite (CLI default unchanged: u2net)
  • Schema version bumped to v2

Stats

  • 19 files changed, 2,113 insertions, 56 deletions
  • 4 new source files: server.ts, ui-optimize.ts, ui-remove-bg.ts, quick-view.ts

Install / Upgrade

brew upgrade localpress
# or
brew install gfargo/localpress/localpress

Pre-built binaries for macOS (arm64/x64), Linux (arm64/x64), and Windows (x64) are attached below.

Full Changelog: v1.5.0...v1.6.0