OP Inference

Images

Generate and edit images.

POST /v1/images/generations submits an image job. It answers 202 with a job; see How media jobs work for polling and output.

curl https://api.opinference.com/v1/images/generations \
  -H "Authorization: Bearer $OP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "black-forest-labs/flux-1-schnell",
    "prompt": "A lighthouse at dawn, watercolor.",
    "width": 1024,
    "height": 1024,
    "output_format": "PNG"
  }'

Inputs

Inputs differ per model. Common ones:

InputMeaning
promptWhat to draw
negative_promptWhat to avoid
width, heightSize in pixels. Some models require both
nHow many images. Each one is billed
seedRepeat a result
output_formatFile type, where the model offers a choice
imageA source image to edit or vary, as an https URL
maskThe area of image to repaint

The model's page at opinference.com/models lists exactly which inputs it takes, which are required, and their ranges. See Inputs for how media inputs are passed.

Output

One output[] entry per image, with its type (such as image/png), size and checksum. usage.units.images counts them.

On this page