Kokon
一款免费的本地化方案,可替代 Nano Banana 和 Generative Fill。涂抹区域,输入更改,由您自己的 GPU 进行编辑。提供 Windows、Mac 和 Linux 的单一安装程序。
AI 翻译
尚未检测到更新。GitHub 发布版本后会显示在这里。
Private, unlimited background removal that runs in your browser.
翻译准备中
正在加载完整 README。
查看完整 README ↗Background → zero.
BG0 is an open-source background remover that runs locally in the browser. It uses WebGPU when available, falls back to WebAssembly, and produces a transparent PNG without uploading the source image.
@bg0/browser can add the same private flow to another web application.Install Bun 1.4, then:
bun install --frozen-lockfile
bun run dev
The web app starts on port 3000 and the docs start on port 4321. During
development, the web app serves the docs at /docs.
bun run lint
bun run typecheck
bun run test
bun run build
With the web app running locally, run:
bunx playwright install chromium
bun run --cwd apps/web test:layout
This uses the licensed cat sample and real model inference, then checks export
controls at 11 viewport widths, transparent output, download, reset, and an
invalid upload. The first run needs network access for the model. Set
BG0_TEST_URL for a different local port, BG0_TEST_BROWSER to firefox or
webkit (install that Playwright engine first), and optionally
BG0_TEST_SCREENSHOTS to an output directory outside the repository.
import { removeBackground } from '@bg0/browser'
const result = await removeBackground(file, {
quality: 'quality',
onProgress: ({ progress, message }) => console.log(progress, message),
})
const url = URL.createObjectURL(result.blob)
The package owns capability detection, model loading and caching, preprocessing, ONNX inference, mask postprocessing, alpha compositing, progress, cancellation, and useful errors. Application code does not depend on ONNX internals.
| Area | Responsibility |
|---|---|
apps/web | TanStack Start site and anonymous local remover |
apps/docs | Blume documentation served at bg0.dev/docs |
packages/browser | Reusable WebGPU/WASM inference and PNG output |
ARCHITECTURE.md | Runtime, privacy, and deployment boundaries |
No backend is needed for background removal. See
ARCHITECTURE.md for the complete data flow.
Read AGENTS.md before changing the application. Keep the product focused on
local background removal, never send image contents or metadata to analytics,
and run the root checks before opening a pull request.
BG0 source is licensed under Apache License 2.0. Model weights retain
the licenses listed in
THIRD_PARTY_NOTICES.md.