# Makeup Generator

Apply makeup to a face photo using AI.

## Description

Upload a photo of a face and choose a makeup style (or provide a custom description) to generate a new image with the specified makeup applied. Supports 8 preset styles plus custom text descriptions.

## Authentication

**Required**: x402 payment

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

## Request

**Endpoint**: `POST /api/makeup-generator/generate`

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

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| image | file | Yes | Photo with the person (JPG, PNG, or WebP, max 10MB) |
| makeupStyle | string | No | Preset makeup style (see Presets below) |
| makeupDescription | string | No | Custom makeup description |

**Note**: Either `makeupStyle` OR `makeupDescription` must be provided.

## Response

**200 OK**

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

| Field | Type | Description |
|-------|------|-------------|
| success | boolean | Operation succeeded |
| imageUrl | string | Path to the generated image |

## Error Codes

| Status | Code | Description |
|--------|------|-------------|
| 400 | VALIDATION_ERROR | Invalid request parameters or missing required fields |
| 402 | PAYMENT_REQUIRED | x402 payment not completed |
| 413 | FILE_TOO_LARGE | File exceeds 10MB limit |
| 415 | UNSUPPORTED_FORMAT | Invalid file type (must be JPG, PNG, or WebP) |
| 422 | INVALID_IMAGE_DATA | Unable to process image |
| 500 | INTERNAL_ERROR | AI generation failed |
| 504 | AI_GENERATION_TIMEOUT | AI request timed out |

## Example

### Using a preset

```bash
npx x402-proxy -X POST \
  -F "image=@photo.jpg" \
  -F "makeupStyle=natural" \
  https://ps.codejar.net/api/makeup-generator/generate
```

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

### Using custom description

```bash
npx x402-proxy -X POST \
  -F "image=@photo.jpg" \
  -F "makeupDescription=bold red lipstick and winged eyeliner" \
  https://ps.codejar.net/api/makeup-generator/generate
```

## Presets

The following makeup presets are available:

| Preset | Description |
|--------|-------------|
| **natural** | Subtle everyday makeup - tinted moisturizer, light blush, minimal eye makeup with defined lashes, soft pink lip color |
| **soft-glam** | Matte foundation, peach blush on cheeks, warm brown eyeshadow, nude lip color with slight sheen, soft contour |
| **full-glam** | Bold eyeshadow with wing, heavy eyeliner, dramatic lashes, strong contour and highlight, bold lip color |
| **editorial** | Dramatic sculpted cheekbones, bold graphic liner, statement lip color, editorial lighting - magazine cover quality |
| **anime** | Large sparkling eyes with catchlights, flawless porcelain skin, cute pink blush on apples of cheeks, anime-style lip color - kawaii Japanese animation aesthetic |
| **kpop** | Flawless glass skin, gradient lip technique, soft pink and peach eyeshadow, precise eyeliner, youthful and radiant finish - Korean entertainment industry standard |
| **vintage** | Red classic lip color, perfectly winged eyeliner, soft wave curls, golden age film star glow - old Hollywood elegance |
| **cinematic** | Moody dramatic lighting, rich colors, smoldering eye makeup, muted lip - film noir quality, movie still aesthetic |

## Use Cases

- **Portrait Enhancement**: Apply professional makeup to selfies or portraits
- **Style Experimentation**: Try different makeup looks before applying in real life
- **Content Creation**: Generate makeup looks for social media or marketing content
- **Virtual Makeover**: Preview how different makeup styles would look on a face