Prodia AI

Prodia AI · GPT アクション

Prodia API

API for generating and upscaling images on Prodia.

  • POST /sd/generateCreate a generation

    Use this endpoint to start generating an image on Prodia.

  • GET /job/{jobId}Retrieve upscaled image

    Get information about an upscaling job, including status.

  • POST /upscaleUpscale an image

    Create a higher resolution version of an image.

元の API スキーマ
{
  "openapi": "3.1.0",
  "info": {
    "title": "Prodia API",
    "description": "API for generating and upscaling images on Prodia.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.prodia.com/v1",
      "description": "Main (production) server"
    }
  ],
  "paths": {
    "/sd/generate": {
      "post": {
        "operationId": "createGeneration",
        "summary": "Create a generation",
        "description": "Use this endpoint to start generating an image on Prodia.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Generation Parameters"
          },
          "401": {
            "description": "Key Not Recognised"
          },
          "402": {
            "description": "API Access Not Enabled"
          }
        }
      }
    },
    "/job/{jobId}": {
      "get": {
        "operationId": "getUpscaledImage",
        "summary": "Retrieve upscaled image",
        "description": "Get information about an upscaling job, including status.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "88ea3a6f-c6d8-46e6-b19f-f106a993d409"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobStatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "Key Not Recognised"
          },
          "402": {
            "description": "API Access Not Enabled"
          }
        }
      }
    },
    "/upscale": {
      "post": {
        "operationId": "upscaleImage",
        "summary": "Upscale an image",
        "description": "Create a higher resolution version of an image.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpscaleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpscaleResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Generation Parameters"
          },
          "401": {
            "description": "Key Not Recognised"
          },
          "402": {
            "description": "API Access Not Enabled"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "GenerationRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "example": "v1-5-pruned-emaonly.safetensors [d7049739]"
          },
          "prompt": {
            "type": "string",
            "example": "puppies in a cloud, 4k"
          },
          "negative_prompt": {
            "type": "string",
            "example": "badly drawn"
          },
          "style_preset": {
            "type": "string",
            "example": "cinematic"
          },
          "steps": {
            "type": "integer",
            "example": 20
          },
          "cfg_scale": {
            "type": "number",
            "format": "float",
            "example": 7
          },
          "seed": {
            "type": "integer",
            "example": -1
          },
          "upscale": {
            "type": "boolean",
            "example": false
          },
          "sampler": {
            "type": "string",
            "example": "DPM++ 2M Karras"
          },
          "width": {
            "type": "integer",
            "example": 512
          },
          "height": {
            "type": "integer",
            "example": 512
          }
        }
      },
      "GenerationResponse": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "example": "cc289422-1ec9-4da5-b050-e5f25dfab106"
          },
          "status": {
            "type": "string",
            "example": "queued"
          }
        }
      },
      "JobStatusResponse": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "example": "cc289422-1ec9-4da5-b050-e5f25dfab106"
          },
          "status": {
            "type": "string",
            "example": "succeeded"
          },
          "imageUrl": {
            "type": "string",
            "example": "https://images.prodia.xyz/cc289422-1ec9-4da5-b050-e5f25dfab106.png"
          }
        }
      },
      "UpscaleRequest": {
        "type": "object",
        "properties": {
          "resize": {
            "type": "integer",
            "example": 2
          },
          "model": {
            "type": "string",
            "example": "ESRGAN_4x"
          },
          "imageUrl": {
            "type": "string",
            "example": "https://images.prodia.xyz/cc289422-1ec9-4da5-b050-e5f25dfab106.png"
          }
        }
      },
      "UpscaleResponse": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "example": "88ea3a6f-c6d8-46e6-b19f-f106a993d409"
          },
          "status": {
            "type": "string",
            "example": "queued"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ]
}