# Face Mask Remover

Remove face masks from images to show natural unmasked faces using AI.

## Description

Upload an image with people wearing surgical or medical face masks, and automatically remove the masks to show the natural, unmasked face. The AI preserves facial details and ensures realistic results.

## Authentication

**Required**: x402 payment

This endpoint requires payment via the x402 protocol. See the [Setup](./setup.md) for setup instructions.

## Request

**Endpoint**: `POST /api/face-mask-remover/remove`

**Content-Type**: `multipart/form-data`

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| image | file | Yes | Input image (JPEG, PNG, or WebP, max 10MB) |
| prompt | string | No | Custom instructions (e.g., "show the person without mask") |

## Response

**200 OK**

```json
{
  "imageUrl": "/outputs/uuid-here.png"
}
```

| Field | Type | Description |
|-------|------|-------------|
| imageUrl | string | Path to the processed image with mask removed |

## Error Codes

| Status | Code | Description |
|--------|------|-------------|
| 400 | VALIDATION_ERROR | No image provided |
| 402 | PAYMENT_REQUIRED | x402 payment not completed |
| 413 | FILE_TOO_LARGE | File exceeds 10MB limit |
| 415 | UNSUPPORTED_FORMAT | File type not allowed (only JPEG, PNG, WebP) |
| 500 | INTERNAL_ERROR | AI generation failed |
| 504 | AI_GENERATION_TIMEOUT | AI request timed out |

## Examples

### Remove face mask from image

```bash
npx x402-proxy -X POST \
  -F "image=@person-with-mask.jpg" \
  https://ps.codejar.net/api/face-mask-remover/remove
```

**Response:**
```json
{
  "imageUrl": "/outputs/550e8400-e29b-41d4-a716-446655440004.png"
}
```

## Use Cases

- **Photo Enhancement**: Remove masks from photos to show natural faces
- **Identity Verification**: Prepare images for verification systems
- **Medical Records**: Remove protective equipment from clinical photos
- **Portrait Photography**: Create natural-looking portraits from masked subjects