mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
All 181 docs markdown files translated into 20 languages (apps/docs/<locale>/**). Companion to the i18n code PR; admin-merged because the file count exceeds GitHub's per-PR CI trigger limit. Validated by pnpm i18n:check (all surfaces, 0 stale/missing) and a clean all-locale docs build.
3.0 KiB
3.0 KiB
description, i18n_source_hash, i18n_provenance, i18n_output_hash
| description | i18n_source_hash | i18n_provenance | i18n_output_hash |
|---|---|---|---|
| 消去したい領域のマスクに従い、AIインペインティング(LaMa)で画像から不要なオブジェクトを削除します。 | 8e2e42a5e4f9 | human | c8fd8664cb28 |
オブジェクト消去
AIインペインティング(LaMaモデル)を使って画像から不要なオブジェクトを削除します。画像と、消去する領域を示すマスクを受け付けます。
API エンドポイント
POST /api/v1/tools/image/erase-object
処理: 非同期(202を返し、SSE経由でステータスを取得するには /api/v1/jobs/{jobId}/progress をポーリング)
モデルバンドル: object-eraser-colorize(1〜2 GB)
パラメータ
| パラメータ | 型 | 必須 | デフォルト | 説明 |
|---|---|---|---|---|
| file | file | はい | - | ソース画像ファイル(multipart) |
| mask | file | はい | - | マスク画像(白 = 消去する領域、黒 = 保持)。フィールド名 mask でアップロードする必要があります |
| format | string | いいえ | "auto" |
出力形式: auto、png、jpg、jpeg、webp、tiff、gif、avif、heic、heif、jxl |
| quality | integer | いいえ | 95 |
出力品質(1〜100) |
リクエスト例
curl -X POST http://localhost:1349/api/v1/tools/image/erase-object \
-F "file=@photo.jpg" \
-F "mask=@mask.png" \
-F "format=png" \
-F "quality=95"
レスポンス
初回レスポンス(202 Accepted)
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"async": true
}
進捗(/api/v1/jobs/{jobId}/progress でのSSE)
event: progress
data: {"phase":"processing","stage":"Inpainting...","percent":70}
最終結果(SSE経由)
{
"phase": "complete",
"percent": 100,
"result": {
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/{jobId}/photo_erased.png",
"previewUrl": "/api/v1/download/{jobId}/preview.webp",
"originalSize": 245000,
"processedSize": 230000
}
}
補足
object-eraser-colorizeモデルバンドル(1〜2 GB)のインストールが必要です。- マスクはソース画像と同じ寸法でなければなりません。白いピクセルは消去する領域を示し、AIがそれらをもっともらしい内容で埋めます。
- 高品質なオブジェクト削除にLaMa(Large Mask Inpainting)を使用します。
- ブラウザでプレビューできない出力形式の場合、メイン出力と併せてWebPプレビューが生成されます。
- HEIC/HEIF、RAW、TGA、PSD、EXR、HDR の入力形式に自動デコードで対応します。