{
 "openapi": "3.0.3",
 "info": {
  "title": "Photo restoration (default): RealRestorer (Step1X-Edit based)",
  "version": "2026-11-21",
  "description": "Curated ZeroGPU tool from the ZeroGPU lineup catalog. Calls go straight to the upstream Space dericky286/RealRestorer-Demo; send your own HF token as a bearer token so the call uses your ZeroGPU quota."
 },
 "servers": [
  {
   "url": "https://dericky286-realrestorer-demo.hf.space"
  }
 ],
 "x-zerogpu": {
  "category": "Image utilities and perception",
  "slot": "Photo restoration",
  "need": "Denoise, deblur, remove JPEG artifacts, dehaze and repair old photos.",
  "role": "default",
  "space": "dericky286/RealRestorer-Demo",
  "space_url": "https://huggingface.co/spaces/dericky286/RealRestorer-Demo",
  "model": "RealRestorer (Step1X-Edit based)",
  "license": "Apache-2.0",
  "license_class": "open",
  "gpu_seconds_booked": "180",
  "notes": "The official demo for a March 2026 model, with 12 restoration presets.",
  "caveats": "Pass prompt=\"\" or it overrides the preset. The 180 s booking is heavy.",
  "lineup_call": "/run_inference(image, task_name=\"Deblurring\"|\"Denoising\"|\"Compression Artifact Removal\"|\"Old Photo Restoration\"|\u2026 (default \"Low-light Enhancement\"), prompt=\"\", steps=28, guidance_scale=3.0, seed=42) \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/run_inference": {
   "post": {
    "description": "Denoise, deblur, remove JPEG artifacts, dehaze and repair old photos. Step 1 of 2: returns {\"event_id\"}; then GET /gradio_api/call/run_inference/{event_id} reads an SSE stream whose `event: complete` data is the JSON output array (`event: error` on failure). Upstream: https://huggingface.co/spaces/dericky286/RealRestorer-Demo. License: Apache-2.0. Caveats: Pass prompt=\"\" or it overrides the preset. The 180 s booking is heavy. \n\nUpstream description: \nReturns, in order: Restored Result: filepath; value_25: str; value_28: str",
    "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. image: filepath (required)\n1. task_name: Literal['Low-light Enhancement', 'Deblurring', 'Deraining', 'Compression Artifact Removal', 'Deflare', 'Demoire', 'Dehazing', 'Denoising', 'Reflection Removal', 'Underwater Image Enhancement', 'Old Photo Restoration', 'Desnowing'] (default \"Low-light Enhancement\")\n2. prompt: str (required: the default is demo text, so send your own or \"\")\n3. steps: float (default 28)\n4. guidance_scale: float (default 3.0)\n5. seed: int (default 42)"
         }
        }
       }
      }
     }
    },
    "x-gradio-parameters": [
     {
      "name": "image",
      "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": "task_name",
      "schema": {
       "type": "string",
       "enum": [
        "Low-light Enhancement",
        "Deblurring",
        "Deraining",
        "Compression Artifact Removal",
        "Deflare",
        "Demoire",
        "Dehazing",
        "Denoising",
        "Reflection Removal",
        "Underwater Image Enhancement",
        "Old Photo Restoration",
        "Desnowing"
       ]
      },
      "required": false,
      "default": "Low-light Enhancement"
     },
     {
      "name": "prompt",
      "schema": {
       "type": "string"
      },
      "required": false,
      "default": "Please restore this low-quality image, recovering its normal brightness and clarity."
     },
     {
      "name": "steps",
      "schema": {
       "type": "number",
       "description": "numeric value between 12 and 40"
      },
      "required": false,
      "default": 28
     },
     {
      "name": "guidance_scale",
      "schema": {
       "type": "number",
       "description": "numeric value between 1.0 and 6.0"
      },
      "required": false,
      "default": 3.0
     },
     {
      "name": "seed",
      "schema": {
       "type": "integer"
      },
      "required": false,
      "default": 42
     }
    ],
    "operationId": "image_utils_photo_restoration",
    "tags": [
     "Image utilities and perception"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ],
    "summary": "Photo restoration (default): RealRestorer (Step1X-Edit based)",
    "responses": {
     "200": {
      "description": "Job accepted.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "event_id"
         ],
         "properties": {
          "event_id": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/gradio_api/call/run_inference/{event_id}": {
   "get": {
    "summary": "Read the result stream for /run_inference",
    "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_photo_restoration_result",
    "tags": [
     "Image utilities and perception"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ]
   }
  }
 }
}