p-judger

Image quality judge that scores how well an image matches a text prompt

Overview

p-judger evaluates one image or a batch of images against a generation prompt. A completed prediction returns a JSON score object (not an image file). Use single-image mode with image + prompt, or batch mode with images and either one shared prompt or a matching list of prompts.

Rate Limit: 500 requests per minute

Category: Image Quality

Pricing: $0.005 per input image

Quickstart

Upload an image

curl -X POST "https://api.pruna.ai/v1/files" \
  -H "apikey: YOUR_API_KEY" \
  -F "content=@/path/to/your/image.jpg"

Score a single image

curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Model: p-judger' \
  -d '{
    "input": {
      "prompt": "A typographic travel poster for the French Riviera",
      "image": "https://api.pruna.ai/v1/files/abc123xyz789"
    }
  }'

Score a batch of images

curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Model: p-judger' \
  -d '{
    "input": {
      "prompt": "A typographic travel poster for the French Riviera",
      "images": [
        "https://api.pruna.ai/v1/files/abc123xyz789",
        "https://api.pruna.ai/v1/files/def456uvw012"
      ]
    }
  }'

Both requests above are asynchronous. Their response contains an id and get_url. Poll the status endpoint until status is succeeded:

curl 'https://api.pruna.ai/v1/predictions/status/PREDICTION_ID' \
  -H 'apikey: YOUR_API_KEY'

Synchronous request

curl -X POST 'https://api.pruna.ai/v1/predictions' \
  -H 'Content-Type: application/json' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Model: p-judger' \
  -H 'Try-Sync: true' \
  -d '{
    "input": {
      "prompt": "A typographic travel poster for the French Riviera",
      "image": "https://api.pruna.ai/v1/files/abc123xyz789"
    }
  }'

Try-Sync: true attempts to return the completed result immediately. If the response instead contains an id and get_url, use the status endpoint above.

When the prediction succeeds, generation_url contains the JSON score payload rather than a download URL. A single-image response is a score object with fields including total, level1, level2, level3, and detailed. A batch response has the form { "results": [ ... ] }.

Parameters

ParameterTypeDefaultDescription
promptstringText prompt the image was generated for. Required for single-image mode. In batch mode, used for every image when prompts is omitted.
imagestring (URI)Image to evaluate (single-image mode). Ignored when images is set.
imagesarray of URI[]Batch of images to score in one forward pass. When set, enables batch mode and returns a results list instead of a single score dict.
promptsarray of string[]Optional per-image prompts for batch mode (same length as images). If omitted, the single prompt is reused for every image.

Valid input combinations:

  • Single image: image and prompt.
  • Batch with one shared prompt: images and prompt.
  • Batch with individual prompts: images and prompts, with both arrays having the same length.