Skip to main content

Endpoint

POST /generate/photos
Generate photo variations from an existing document image (PNG or PDF).

Request Body

image_path
string
required
Absolute path to the source document image (PNG/PDF). Must exist on the server filesystem.
presets
string[]
List of preset names to generate. Options: full_picture, folded_skewed, zoomed_detail, blurry, cropped_header, strong_oblique, coffee_stain, stapled_stack. If omitted, generates all 8 presets.
variations
object[]
Custom variation configs (alternative to presets). Each object follows the PhotoVariation schema.
doc_description
string
default:""
Key fields to preserve in the photos. Helps the image generator maintain accuracy.

Response

run_id
string
Unique identifier for this generation run
results
array
Array of results, one per variation.

Example

curl -X POST http://localhost:8000/generate/photos \
  -H "Content-Type: application/json" \
  -d '{
    "image_path": "/path/to/document.png",
    "presets": ["full_picture", "blurry", "coffee_stain"],
    "doc_description": "dispatch guide 00054321, 2 items"
  }'
Response
{
  "run_id": "f8e7d6c5b4",
  "results": [
    {"name": "full_picture", "path": "output/f8e7d6c5b4/photos/photo_full_picture.png", "ok": true},
    {"name": "blurry", "path": "output/f8e7d6c5b4/photos/photo_blurry.png", "ok": true},
    {"name": "coffee_stain", "path": "output/f8e7d6c5b4/photos/photo_coffee_stain.png", "ok": true}
  ]
}