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 VQGAN via OpenSourceAIs
  1. APIs
  2. AIs
  3. Txt2Img & Img2Img

ai_vqgan

An authenticated client can post a request to VQGAN-CLIP

VQGAN-CLIP stands for Vector Quantized Generative Adversarial Network and Contrastive Language–Image Pre-training. It is an ealier generation AI (pre 2020) for image to image processing

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/vqgan

{
    "engine": "vqgan",
    "name": "VQGAN-CLIP",
    "location": "",
    "ip": "0.0.0.0",
    "port": 5101,
    "version": "1.1.7",
    "description": "Text to Image",
    "github": "https://github.com/nerdyrodent/VQGAN-CLIP",
    "requiresGPU": true,
    "isFree": false,
    "default_cost": 1000,
    "params": [{
        "in": "word",
        "out": "-p",
        "isMandatory": true,
        "type": "string",
        "default": null,
        "ui": {
            "title": "Input (text and/or image)",
            "placeholder": "eg: gold coin from rome 100 BC, full size",
            "widget": "uiEdit",
            "column": 1
        }
    }, {
        "in": "url_upload",
        "out": "-filename",
        "isMandatory": false,
        "type": "string",
        "default": null,
        "accept": {
            "$max": 2048,
            "$ext": [".png", ".jpg", ".jpeg"]
        },
        "ui": {
            "widget": "uiSelectPicture",
            "column": 1
        }
    }, {
        "in": "steps",
        "out": "-i",
        "isMandatory": true,
        "type": "int",
        "default": 25,
        "freeAccess":  {"$max": 100},
        "ui": {
            "title": "Step Count",
            "tooltip": "",
            "min": 1,            
            "max": 200,            
            "unit": "",
            "widget": "uiRangeSlider",
            "column": 1
        }
    }, {
        "in": "saveinterval",
        "out": "-se",
        "isMandatory": true,
        "type": "int",
        "default": 20,
        "freeAccess":  {"$max": 20},
        "ui": {
            "title": "Save every",
            "tooltip": "",
            "min": 1,            
            "max": 20,            
            "unit": "",
            "widget": "uiRangeSlider",
            "column": 1
        }
    }, {
        "in": "width",
        "out": "-width",
        "isMandatory": true,
        "type": "int",
        "default": 384,
        "accept": {
            "$in":[320, 384, 448, 512, 576, 640, 704, 768],
            "display":["320x320", "384x384", "448x448", "512x512", "576x576", "640x640", "704x704", "768x768"]
        },
        "freeAccess":  {"$max": 512},
        "ui": {
            "title": "Output resolution",
            "widget": "uiMultiToggle",
            "unit": "px",    
            "column": 2,
            "autofill": [{"in":"height", "out":"-height"}]
        }
    }, {
        "in": "height",
        "out": "-height",
        "isMandatory": true,
        "type": "int",
        "default": 384,
        "accept": {"$in":[320, 384, 448, 512, 576, 640, 704, 768]},
        "freeAccess":  {"$max": 512},
        "ui": {
            "unit": "px"
        }
    }, {
        "in": "model",
        "out": "-ckpt",
        "isMandatory": false,
        "type": "string",
        "default": "vqgan_imagenet_f16_16384.ckpt"
    }, {
        "in": "yaml",
        "out": "-conf",
        "isMandatory": false,
        "type": "string",
        "default": "vqgan_imagenet_f16_16384.yaml"
    }, {
        "in": "output",
        "out": "-o",
        "isMandatory": true,
        "type": "function",
        "default": "$output_uid.ext"
    }]
}

Post a request to VQGAN via OpenSourceAIs

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

Request Body

Name
Type
Description

width

Number

The width of the output image. Defaults to 320

height

Number

The height of the output image. Defaults to 320

steps

Number

The number of steps requested for generating the output image. High number of steps cost more GPU compute. Defaults to 20. Should not exceed 200.

word*

String

A text input to tell the AI what to generate.

url_upload

String

A well formed URI starting with https://... and accessing a PNG or JPG image. Note that if the image is not of the width and height size passed in parameters, it will be automatically cropped or resized.

saveinterval

Number

A positive number indicating when intermediate images are saved.

model

String

The model used for morphing the image.

{
    "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"
}

Previousai_diffusionNextImg2Vid

Last updated 8 months ago