OpenSourceAIs
OpenSourceAIs
OpenSourceAIs
  • Open Source AIs
  • AI configuration
    • Preparing your environment
    • Installing a Daemon
    • AI config file
  • Client Tokens
    • Configuration
  • APIs
    • System status
    • Client Apps
      • Authenticate into OSAIS
      • Update notification params
      • Check a request
    • AIs
      • Integration Test
        • ai_ping
      • Txt2Img & Img2Img
        • ai_cnet
        • ai_diffusion
        • ai_vqgan
      • Img2Vid
        • ai_vtoonify
        • ai_sadtalker
      • Image Utilities
        • ai_rembg
        • ai_gfpgan
      • TTS & STT
        • ai_coquitts
  • Sample App
    • NodeJS sample
Powered by GitBook
On this page
  • Get the JSON config file for this AI
  • Post a request to restore an image via OpenSourceAIs
  1. APIs
  2. AIs
  3. Image Utilities

ai_gfpgan

An authenticated client can post a request to this AI to improve the quality of an image, mostly used for face restoration and enlarging images of faces.

Previousai_rembgNextTTS & STT

Last updated 8 months ago

This AI can run AI alongside a Daemon on GPU only

Get the JSON config file for this AI

GET https://opensourceais.com/api/v1/public/config/gfpgan

You should not need to call this endpoint. This is just a FYI to understand all input parameters sent to the AI.

{
    "data": {
        "engine": "gfpgan",
        "version": "1.0.3",
        "name": "Face Restauration & Hi-Res",
        "description": "Image Utility",
        "isFree": false,
        "requiresGPU": true,
        "aParam": [
            {
                "in": "url_upload",
                "out": "-filename",
                "isMandatory": true,
                "type": "string",
                "default": null,
                "accept": {
                    "$max": 2048
                },
                "ui": {
                    "title": "Image input",
                    "widget": "uiSelectPicture",
                    "column": 1
                }
            },
            {
                "in": "res",
                "out": "-s",
                "isMandatory": true,
                "type": "int",
                "default": 1,
                "accept": {
                    "$in": [
                        1,
                        2,
                        4
                    ],
                    "display": [
                        "x1",
                        "x2",
                        "x4"
                    ]
                },
                "freeAccess": {
                    "$max": 1
                },
                "ui": {
                    "title": "Output resolution",
                    "widget": "uiMultiToggle",
                    "unit": "px",
                    "column": 2
                }
            },
            {
                "in": "weight",
                "out": "-w",
                "isMandatory": false,
                "type": "float",
                "default": 0.5
            },
            {
                "in": "ver",
                "out": "-v",
                "isMandatory": false,
                "type": "string",
                "default": "1.3"
            },
            {
                "in": "output",
                "out": "-o",
                "isMandatory": true,
                "type": "function",
                "default": "$output_uid.ext"
            },
            {
                "in": "idir",
                "out": "-idir",
                "isMandatory": false,
                "type": "string",
                "default": "./_input/"
            },
            {
                "in": "odir",
                "out": "-odir",
                "isMandatory": false,
                "type": "string",
                "default": "./_output/"
            }
        ]
    }
}

Post a request to restore an image via OpenSourceAIs

POST https://opensourceais.com/api/v1/private/client/ai/gfpgan

Request Body

Name
Type
Description

url_upload*

String

A well formed URI starting with https://... and accessing a PNG or JPG image.

res

int

the output resolution, either 1, 2, or 4. A value of 1 keeps the same resolution, a value of 2 doubles the size of the image. Default is 1.

{
    "data": {
        "uid": 1678361974000,
        "created_at": "2023-03-09T11:39:44.000Z"
    }
}
{
     data: null,
     status: 400,
     statusText: "A client token is required"
}
{
     data: null,
     status: 409,
     statusText: "Could not add to backlog"
}
GitHub - TencentARC/GFPGAN: GFPGAN aims at developing Practical Algorithms for Real-world Face Restoration.GitHub
Official github repo where this AI was taken from
Logo