{
 "openapi": "3.0.3",
 "info": {
  "title": "Face restoration (commercial): PMRF",
  "version": "2026-11-21",
  "description": "Curated ZeroGPU tool from the ZeroGPU lineup catalog. Calls go straight to the upstream Space ohayonguy/PMRF; send your own HF token as a bearer token so the call uses your ZeroGPU quota."
 },
 "servers": [
  {
   "url": "https://ohayonguy-pmrf.hf.space"
  }
 ],
 "x-zerogpu": {
  "category": "Image utilities and perception",
  "slot": "Face restoration",
  "need": "Repair faces in old, compressed or generated images.",
  "role": "commercial",
  "space": "ohayonguy/PMRF",
  "space_url": "https://huggingface.co/spaces/ohayonguy/PMRF",
  "model": "PMRF",
  "license": "MIT",
  "license_class": "open",
  "gpu_seconds_booked": "60",
  "notes": "The commercially usable choice.",
  "caveats": "",
  "lineup_call": "/predict(img, randomize_seed, aligned=false, scale=1, num_flow_steps=25, seed) \u2192 image",
  "api_style": "v1"
 },
 "components": {
  "securitySchemes": {
   "hfToken": {
    "type": "http",
    "scheme": "bearer",
    "description": "Your own Hugging Face token (read scope is enough). It is sent only to the upstream Space and bills that call to your account's ZeroGPU quota. Without it the call runs on the small anonymous quota."
   }
  },
  "schemas": {}
 },
 "paths": {
  "/gradio_api/call/predict": {
   "post": {
    "description": "Repair faces in old, compressed or generated images. Step 1 of 2: returns {\"event_id\"}; then GET /gradio_api/call/predict/{event_id} reads an SSE stream whose `event: complete` data is the JSON output array (`event: error` on failure). Upstream: https://huggingface.co/spaces/ohayonguy/PMRF. License: MIT. \n\nUpstream description: \nReturns, in order: Output: dict(path: str | None (Path to a local file), url: str | None (Publicly available url or base64 encoded image), size: int | None (Size of image in bytes), orig_name: str | None (Original filename), mime_type: str | None (mime type of image), is_stream: bool (Can always be set to False), meta: dict(str, Any)); Restored faces gallery: list[dict(image: dict(path: str | None (Path to a local file), url: str | None (Publicly available url or base64 encoded image), size: int | None (Size of image in bytes), orig_name: str | None (Original filename), mime_type: str | None (mime type of image), is_stream: bool (Can always be set to False), meta: dict(str, Any)), caption: str | None) | dict(video: filepath, caption: str | None)]",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "data"
        ],
        "properties": {
         "data": {
          "type": "array",
          "minItems": 1,
          "maxItems": 6,
          "items": {},
          "description": "Positional inputs, in this order:\n0. img: dict(path: str | None (Path to a local file), url: str | None (Publicly available url or base64 encoded image), size: int | None (Size of image in bytes), orig_name: str | None (Original filename), mime_type: str | None (mime type of image), is_stream: bool (Can always be set to False), meta: dict(str, Any)) (required)\n1. randomize_seed: bool (default true)\n2. aligned: bool (default false)\n3. scale: float (default 1)\n4. num_flow_steps: float (default 25)\n5. seed: float (default 42)"
         }
        }
       }
      }
     }
    },
    "x-gradio-parameters": [
     {
      "name": "img",
      "schema": {
       "type": "object",
       "required": [
        "path",
        "meta"
       ],
       "description": "A file. Set path to a public https URL (or a path returned by POST /gradio_api/upload on the same Space) and meta to {\"_type\": \"gradio.FileData\"}.",
       "properties": {
        "path": {
         "type": "string"
        },
        "url": {
         "type": "string"
        },
        "orig_name": {
         "type": "string"
        },
        "meta": {
         "type": "object",
         "properties": {
          "_type": {
           "type": "string",
           "enum": [
            "gradio.FileData"
           ]
          }
         }
        }
       }
      },
      "required": true,
      "default": null
     },
     {
      "name": "randomize_seed",
      "schema": {
       "type": "boolean"
      },
      "required": false,
      "default": true
     },
     {
      "name": "aligned",
      "schema": {
       "type": "boolean"
      },
      "required": false,
      "default": false
     },
     {
      "name": "scale",
      "schema": {
       "type": "number",
       "description": "numeric value between 1 and 4"
      },
      "required": false,
      "default": 1
     },
     {
      "name": "num_flow_steps",
      "schema": {
       "type": "number",
       "description": "numeric value between 1 and 200"
      },
      "required": false,
      "default": 25
     },
     {
      "name": "seed",
      "schema": {
       "type": "number",
       "description": "numeric value between 0 and 10000"
      },
      "required": false,
      "default": 42
     }
    ],
    "operationId": "image_utils_face_restoration_commercial",
    "tags": [
     "Image utilities and perception"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ],
    "summary": "Face restoration (commercial): PMRF",
    "responses": {
     "200": {
      "description": "Job accepted.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "event_id"
         ],
         "properties": {
          "event_id": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/gradio_api/call/predict/{event_id}": {
   "get": {
    "summary": "Read the result stream for /predict",
    "description": "Server-sent events. The final `event: complete` carries a JSON array of outputs; `event: error` means the call failed.",
    "parameters": [
     {
      "name": "event_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "SSE stream",
      "content": {
       "text/event-stream": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    },
    "operationId": "image_utils_face_restoration_commercial_result",
    "tags": [
     "Image utilities and perception"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ]
   }
  }
 }
}