2-Stage Optical Stack (~125.8 MB Total) Stage 1: BiRefNet-lite 512 (98.5 MB WASM fp16) Stage 2: Depth Anything v2 Small (27.3 MB WASM q8) MIT + Apache-2.0

Depth-Layered Bokeh & 3D Foreground Pop-Out

Chain Stage 1: BiRefNet-lite 512 (studioludens/birefnet-lite-512, 98.49 MB fp16 WASM) with Stage 2: Depth Anything v2 Small (onnx-community/depth-anything-v2-small, 27.26 MB q8 WASM, sharing cached weights with models/depth-anything/). Stage 1 cuts a clean foreground matte to prevent blur halos; Stage 2 estimates per-pixel scene depth to drive realistic depth-weighted circle-of-confusion bokeh and subtle 3D subject pop-out.

1. Independent Stage Loaders (~125.8 MB Total)

Stage 1 · BiRefNet-lite 512 (98.5 MB WASM fp16)

Not initialised — uses ../worker.js (studioludens/birefnet-lite-512, MIT).

Stage 2 · Depth Anything v2 Small (27.3 MB WASM q8)

Not initialised — uses ../depth-worker.js (onnx-community/depth-anything-v2-small, Apache-2.0).

2. Run Chained Matte + Depth Optical Compositor

Drop a photo here or paste (Ctrl/⌘+V). Once both stages finish, click anywhere on the result canvas to tap-to-focus the synthetic aperture plane at that pixel's real depth!

Initialising Stage 1 (BiRefNet-lite 512) & Stage 2 (Depth Anything v2 Small) loaders…

Stage 1 BiRefNet–
Stage 2 Depth v2–
Bokeh Composite–
FG Alpha Area–
FG Mean Depth–
BG Mean Depth–
Depth Separation–
Combined NaN–

Depth-Layered Bokeh & 3D Pop-Out (Click to Refocus)

Run both stages to unlock depth-weighted optical bokeh

Stage 1 Matte × Stage 2 Depth Diagnostic Pair

Stage 1 · BiRefNet alpha
Stage 2 · Depth Anything v2

Show the code

Show the code — birefnet-core.mjs: composeDepthLayeredBokeh() (halo-free depth bokeh + 3D foreground lift)