object_remover / HTTP_API_Documentation.txt
LogicGoInfotechSpaces's picture
feat(download): make /download public; docs: add HTTP_API_Documentation.txt
ff3e3e4
raw
history blame
1.91 kB
HTTP API Documentation
- Base URL: https://logicgoinfotechspaces-object-remover.hf.space
- Auth (optional): set API_TOKEN on server; send Authorization: Bearer <API_TOKEN>
Endpoints
- GET /health
- POST /upload-image (form-data: image=file) -> {"id":"<image_id>","filename":"..."}
- POST /upload-mask (form-data: mask=file) -> {"id":"<mask_id>","filename":"..."}
- POST /inpaint (JSON: { "image_id": "...", "mask_id": "..." }) -> returns image/png directly
- POST /inpaint-multipart (form-data: image, mask) -> {"result":"output_xxx.png"}
- GET /download/{filename} (only needed if you have a filename)
Curl examples
Health:
curl -H "Authorization: Bearer <API_TOKEN>" https://logicgoinfotechspaces-object-remover.hf.space/health
Upload image:
curl -H "Authorization: Bearer <API_TOKEN>" \
-F image=@image.png \
https://logicgoinfotechspaces-object-remover.hf.space/upload-image
Upload mask (PNG recommended):
curl -H "Authorization: Bearer <API_TOKEN>" \
-F mask=@mask.png \
https://logicgoinfotechspaces-object-remover.hf.space/upload-mask
Inpaint (IDs) — returns image directly:
curl -H "Authorization: Bearer <API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"image_id":"<image_id>","mask_id":"<mask_id>"}' \
https://logicgoinfotechspaces-object-remover.hf.space/inpaint \
-o result.png
Inpaint (multipart) — returns filename:
curl -H "Authorization: Bearer <API_TOKEN>" \
-F image=@image.png \
-F mask=@mask.png \
https://logicgoinfotechspaces-object-remover.hf.space/inpaint-multipart
Download (only if you have a filename):
curl -H "Authorization: Bearer <API_TOKEN>" \
-L https://logicgoinfotechspaces-object-remover.hf.space/download/output_xxx.png \
-o result.png
Notes
- For masks: RGBA with alpha=0 = remove; otherwise any pixel > 0 = remove.
- 404 Not Found on /inpaint usually means the server restarted and IDs expired — re-upload to get fresh IDs.