ai_cnet

An authenticated client can post a request to Control Net v1.1

This Control Net AI works on top of Stable Diffusion v1.5 which is bundled into it. Control Net requires an image in input, as such is is an IMG2IMG AI. Its parameters add on top of the Stable Diffusion v1.5 parameters.

Check more details about Stable Diffusion and its parameters on wikipedia

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

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

{
    "engine": "cnet",
    "name": "Control Net",
    "location": "http://0.0.0.0",
    "port": 5108,
    "version": "1.0.2",
    "description": "Text to Image",
    "github": "https://github.com/lllyasviel/ControlNet",
    "requiresGPU": true,
    "isFree": false,
    "default_cost": 1000,
    "params": [{
        "in": "word",
        "out": "--prompt",
        "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,
        "ui": {
            "widget": "uiSelectPicture",
            "column": 1
        }
    }, {
        "in": "steps",
        "out": "--ddim_steps",
        "isMandatory": true,
        "type": "int",
        "default": 20,
        "freeAccess":  {"$max": 100},
        "ui": {
            "title": "Step Count",
            "tooltip": "",
            "min": 1,            
            "max": 100,            
            "unit": "",
            "widget": "uiRangeSlider",
            "column": 1
        }
    }, {
        "in": "guidance",
        "out": "--scale",
        "isMandatory": true,
        "type": "float",
        "default": 9,
        "ui": {
            "title": "Guidance scale",
            "tooltip": "",
            "displayAsPercent": true,            
            "unit": "",            
            "min": 0.1,            
            "max": 30,
            "widget": "uiRangeSlider",
            "column": 1,
            "conditional": {"$null": "url_upload"}
        }
    }, {
        "in": "strength",
        "out": "--strength",
        "isMandatory": true,
        "type": "float",
        "default": 1,
        "ui": {
            "title": "Strength",
            "tooltip": "",
            "displayAsPercent": true,            
            "unit": "",            
            "min": 0,            
            "max": 2,
            "widget": "uiRangeSlider",
            "column": 1,
            "conditional": {"$exist": "url_upload"}
        }
    }, {
        "in": "res",
        "out": "--res",
        "isMandatory": true,
        "type": "int",
        "default": 512,
        "accept": {
            "$in":[320, 384, 448, 512, 640, 768],
            "display":["320x320", "384x384", "448x448", "512x512", "640x640", "768x768"]
        },
        "freeAccess": {"$max": 512},
        "ui": {
            "title": "Output resolution",
            "unit": "px",
            "widget": "uiMultiToggle",
            "column": 2
        }
    }, {
        "in": "cimg",
        "out": "--n_samples",
        "isMandatory": true,
        "type": "int",
        "default": 1,
        "accept": {
            "$in":[1, 2, 3, 4],
            "display":["1", "2", "3", "4"]
        },
        "ui": {
            "title": "Number of images to generate",
            "widget": "uiMultiToggle",
            "column": 2
        }
    }, {
        "in": "saveinterval",
        "out": "--se",
        "isMandatory": false,
        "type": "int",
        "default": 0,
        "freeAccess":  {"$max": 20},
        "ui": {
            "title": "Save every",
            "tooltip": "",
            "min": 0,            
            "max": 20, 
            "unit": "",
            "widget": "uiRangeSlider",
            "column": 2
        }
    }, {
        "in": "seed",
        "out": "--seed",
        "isMandatory": true,
        "type": "function",
        "default": "$random"
    }, {
        "in": "model",
        "out": "--ckpt",
        "isMandatory": true,
        "type": "string",
        "default": "v1-5-pruned.ckpt"
    }, {
        "in": "output",
        "out": "--output",
        "isMandatory": true,
        "type": "function",
        "default": "$output_uid.ext"
    }]
}

Post a request to Control Net via OpenSourceAIs

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

Request Body

Name
Type
Description

res

Number

The resolution of the output image. Defaults to 512 (for 512x512)

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 100.

seed

Number

A random number between 1 and

2,147,483,647. Same seed and exact same params delivers same output. Defaults to 12345. Should send random values for better experience.

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.

strength

Float

A float between 0 and 2, corresponding to a % of strength applied. Defaults to 1.

guidance

Float

A float between 0.1 and 30, corresponding to the guidance scale applied. Defaults to 9.

cimg

Number

The number of images to produce. Defaults to 1. Note that more images to produce will cost proportionally more in GPU compute.

{
    "data": {
        "uid": 1678361974000,
        "created_at": "2023-03-09T11:39:44.000Z"
    }
}

Last updated