Images

Use SDXL with loras to generate images of a character, the world around you, and anything in between using a single text prompt.

Generate an image

Once an image generation request is sent, a job is created and the corresponding job ID is sent back.

Generate an image based on a prompt

POST https://api.vana.com/api/v0/images

Request Body

NameTypeDescription

prompt*

String

Description of the characters and things you want in the generated image. To reference a character, use <character-id> in the prompt.

negativePrompt

String

Description of the things you don't want in the generated image

width

Number

Width in pixels of the generated image. Maximum 1024

height

Number

Height in pixels of the generated image. Maximum 1024

samples

Number

Number of images to be returned in the response, maximum 4

seed

Number

Used to reproduce results, same seed will give you same image again

guidanceScale

Number

A lower number incorporates more creativity while a higher number indicates that the image is closely tied to the text prompt (minimum: 1; maximum: 20)

loraScale

Number

LoRA additive scale only applicable for images with a trained subject. (minimum: 0, maximum: 1)

synchronous

Boolean

Enabling syncrhonous mode will allow the user to await the API call and get the generated images, instead of returning only the job ID and having to poll the job to fetch the generated images.

Note: synchronous mode may take anywhere from 30 seconds to 2 minutes to return a response, depending on the input. Defaults to false.

Sample Request Body

{
    "prompt": "a painting of <6320a05b-548f-4c8a-aaf9-15c38e46dbbd> with a green apple in their mouth, surrealism aesthetic"
}

Sample Response Body

{
    "success": true,
    "jobId": "f2c95e57-c831-40e0-b108-f86d2cdc3cbd",
    "transactionId": "50f5f981-76fe-4713-8f87-0b606a4270ec",
    
    // If synchronous is set to true, images will also be returned.
    "output": [
        "https://storage.googleapis.com/vana-gotchi-jobs/e7877783-4d1c-4cc5-b52f-e55f4c79be5b/out-0.png"
    ]
}

Get generated images

To retrieve the images from a generation request, a job can be queried, and the outputFiles of the job will contain the list of images once the job is complete.

Retreives the outputs from a job

GET https://api.vana.com/api/v0/jobs/:job-id

Path Parameters

NameTypeDescription

job-id*

uuid

ID of the job to retreive

Sample Response Body

{
    "success": true,
    "job": {
        "id": "e7877783-4d1c-4cc5-b52f-e55f4c79be5b",
        "accountId": "11416021-4c6b-409c-9dc9-f44ee1215cc9",
        "clientId": null,
        "created": 1708967813771,
        "type": "IMAGE_INFERENCE",
        "payload": {
            "seed": 806262083982079,
            "width": 768,
            "height": 1024,
            "lora_1": "https://storage.googleapis.com/vana-gotchi-jobs/57845afc-ab1b-4be8-bdc4-1296cc376a02/trained_model.tar?GoogleAccessId=vana-app-user@corsali-development.iam.gserviceaccount.com&Expires=1709054213&Signature=iqMvWEXnLIoxCvDpNv2QkaejDn7boGF5QqBNlbH54PvsImwwfhnapCEZdZfT%2FxAqGeJ%2BknV%2BH3Gxzo4JzshDDuPZqIjA1erQ9XgxreaItec9whxvxZc%2BZSmtbdL73ENSn5rY6IVlP7FRNZ6C2XPD6qp1ziVwZCDBEcJuKy2NigQNzo21Jh98n0S%2BeNfU%2BTjEHVlI2izOWmMfmSlWjzCNGHEkus5Rm0Cx9Mssb6cZd%2FTsbh7UAUqNQo95OSQLDg3wrUHe5HMU3A6gZHgqau7WO5YPM9k07VQgNX6vcgb%2BLxp51cv28vq9vaiVrGiNxBG5QSWGEY55Ebkq5EaGoVycmw%3D%3D",
            "prompt": "Pixel art character of TOK man, retro gaming style, 8-bit graphics, nostalgic vibes, vibrant palette, pixel animation, trending on game development forums, by a renowned pixel artist like Paul Robertson, Henk Nieborg, Simon Anderson, or Pedro Medeiros., male, 30 years, short, straight and black hair, brown eyes, wearing glasses",
            "num_outputs": 1,
            "guidance_scale": 7.5,
            "negative_prompt": "low quality, duplicate faces, deformed iris, distorted eyes, text, cropped, out of frame, jpeg artifacts, duplicate, mutilated, extra fingers, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, clone, disfigured, fused fingers",
            "prompt_strength": 0.8,
            "num_inference_steps": 35,
            "max_face_inpaint_size": 80,
            "enable_face_inpainting": true,
            "face_inpainting_prompt": "<s0><s1> face. male, 30 years, short, straight and black hair, brown eyes, wearing glasses, ",
            "face_inpainting_negative_prompt": "frame, mask, surgical, ui, ugly, distorted eyes, deformed iris, toothless, squint, deformed iris, deformed pupils, low quality, jpeg artifacts, ugly, mutilated"
        },
        "outputFiles": [
            {
                "name": "out-0.png",
                "path": "e7877783-4d1c-4cc5-b52f-e55f4c79be5b/out-0.png",
                "created": 1708967870982,
                "size": 964006,
                "url": "https://storage.googleapis.com/vana-gotchi-jobs/e7877783-4d1c-4cc5-b52f-e55f4c79be5b%2Fout-0.png",
                "feedback": {
                    "like": null,
                    "feedback": null
                }
            }
        ],
        "status": "SUCCESS",
        "statuses": [
            {
                "id": "c19f650e-c1f5-4efc-b369-424b7921c42b",
                "status": "SUCCESS",
                "created": 1708967871957
            },
            {
                "id": "80a647f1-365b-49c6-b242-36876aa9393c",
                "status": "IN_PROGRESS",
                "created": 1708967815600
            },
            {
                "id": "d888638e-e917-4885-bffe-768cf9c9eef0",
                "status": "CREATED",
                "created": 1708967814838
            }
        ]
    }
}

Check if the user has a trained face model

To create personalized images, a user's character must have a trained character face model. A single model here represents a LoRA file, used to personalize an SDXL image.

Having one or more models in the models response list with status SUCCESS means an image containing a character's face can be created. A model with status IN_PROGRESS means the image model is currently training (which takes about 10 minutes to complete).

Retreives a list of LoRA models a character has

GET https://api.vana.com/api/v0/characters/:character-id/images/models

Path Parameters

NameTypeDescription

character-id*

uuid

ID of the character to check

Sample Response Body

{
    "success": true,
    "models": [
        {
            "id": "c0d2d5b6-5215-4170-8685-dc98b034d2cc",
            "jobId": "57845afc-ab1b-4be8-bdc4-1296cc376a02",
            "created": 1705614705360,
            "status": "IN_PROGRESS"
        },
        {
            "id": "6ad158aa-7129-40e2-addf-50c7a1839113",
            "url": "https://storage.googleapis.com/vana-gotchi-jobs/7761dbe7-84fd-4807-bbfb-f3bc515d40c7/trained_model.tar?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=vana-app-user%40corsali-development.iam.gserviceaccount.com%2F20240226%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20240226T174614Z&X-Goog-Expires=86401&X-Goog-SignedHeaders=host&X-Goog-Signature=077e0ca5f9b78e77c8c187485fa500b941abc39ec6d5b25e17775b6ceb20f8db2f2836dad65a64f85d892df9b0a2f0160c3620ea4e33787b57f775fa098f9a3ac385dd7843bb5f30d44a1b52306463222319ff5ddc42975bffd3e0cb6225258f65b5ef012a2e75ecdcd9b420e35edff2bb18aaeaba1c777b2f1f51c8a46f1b9f98c41e6961ef205d71b399b58374cc0daab23b937df80feef2ae673df2c37feb85d9fbafc96a364eba3db7855a4ebe57d125f792f505b5f1185715448d6862487f4f0bdccf6a0d1af7d6aaddfb705135bf0fe895764e595e2283686d09fe0b76c3e1e4885741c503eeaf875e9abf33544b8eb1f145e7cafbd5b5f295de451bd9",
            "jobId": "7761dbe7-84fd-4807-bbfb-f3bc515d40c7",
            "created": 1704323766628,
            "status": "SUCCESS"
        }
    ]
}

Last updated