---
title: "p-judger"
description: "Score how well an image matches a generation prompt"
url: "https://docs.api.pruna.ai/guides/models/p-judger"
image: "https://docs.api.pruna.ai/_og/d/c_Ocean.takumi,title_p-judger,description_Score+how+well+an+image+matches+a+generation+prompt,props_eyJ0aGVtZSI6eyJtb2RlIjoibGlnaHQiLCJjb2xvcnMiOnsicHJpbWFyeSI6IiM3YzNhZWQifX19,p_Ii9ndWlkZXMvbW9kZWxzL3AtanVkZ2VyIg,s_cxPfjKSJ3beoUTl2.png"
---

# p-judger

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

## [Overview](#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](#quickstart)

### [Upload an image](#upload-an-image)

```bash
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](#score-a-single-image)

```bash
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](#score-a-batch-of-images)

```bash
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`:

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

### [Synchronous request](#synchronous-request)

```bash
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](#parameters)

| Parameter | Type            | Default | Description                                                                      |
| :-------- | :-------------- | :------ | :------------------------------------------------------------------------------- |
| prompt    | string          | —       | Text prompt the image was generated for. Required for single-image mode. In batch mode, used for every image when prompts is omitted. |
| image     | string (URI)    | —       | Image to evaluate (single-image mode). Ignored when images is set.               |
| images    | array 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. |
| prompts   | array 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.