|
|
---
|
|
|
title: Remove Photo Object
|
|
|
emoji: ⚡
|
|
|
colorFrom: pink
|
|
|
colorTo: purple
|
|
|
sdk: docker
|
|
|
pinned: false
|
|
|
license: mit
|
|
|
hardware: cpu-basic
|
|
|
---
|
|
|
|
|
|
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
## Inpainting API (FastAPI)
|
|
|
- Auth: optional Bearer via env `API_TOKEN`. If set, send `Authorization: Bearer <token>`.
|
|
|
|
|
|
Endpoints:
|
|
|
- `GET /health` → {"status":"healthy"}
|
|
|
- `POST /upload-image` (form-data: image=file) → {"id":"<image_id>","filename":"name.png"}
|
|
|
- `POST /upload-mask` (form-data: mask=file) → {"id":"<mask_id>","filename":"mask.png"}
|
|
|
- `POST /inpaint` (JSON: {image_id, mask_id}) → {"result":"output_xxx.png"}
|
|
|
- `POST /inpaint-url` (JSON: {image_id, mask_id}) → {"result":"output_xxx.png","url":"https://.../download/output_xxx.png"}
|
|
|
- `POST /inpaint-multipart` (form-data: image=file, mask=file) → {"result":"output_xxx.png"}
|
|
|
- `GET /download/{filename}` → image file (public; optional for ID-based inpaint)
|
|
|
- `GET /result/{filename}` → view result image in browser (public)
|
|
|
- `GET /logs` → recent uploads/results
|
|
|
|
|
|
Note:
|
|
|
- `POST /inpaint` returns simple JSON with just the filename.
|
|
|
- `POST /inpaint-url` returns JSON with filename and shareable URL.
|
|
|
- Use `/download/{filename}` or `/result/{filename}` to access the result image.
|
|
|
|
|
|
Local run:
|
|
|
- Install deps: `python3 -m pip install -r requirements.txt`
|
|
|
- Run API: `python3 -m uvicorn api.main:app --host 0.0.0.0 --port 7860`# o b j e c t _ r e m o v e r
|
|
|
|