Skip to main content

txt2img

2img API

Basic minimum workflow

Request Body:

{
"request_id": "unique_key",
"stages": [
{
"type": "INPUT_INITIALIZE",
"inputInitialize": {
"seed": -1,
"count": 2
}
},
{
"type": "DIFFUSION",
"diffusion": {
"width": 512,
"height": 512,
"prompts": [
{
"text": "1girl"
}
],
"sampler": "DPM++ 2M Karras",
"sdVae": "Automatic",
"steps": 15,
"sd_model": "600423083519508503",
"clip_skip": 2,
"cfg_scale": 7
}
}
]
}

Add Adetailer

Request Body:

{
"request_id": "unique_key",
"stages": [
{
"type": "INPUT_INITIALIZE",
"inputInitialize": {
"seed": -1,
"count": 2
}
},
{
"type": "DIFFUSION",
"diffusion": {
"width": 512,
"height": 512,
"prompts": [
{
"text": "1girl"
}
],
"sampler": "DPM++ 2M Karras",
"sdVae": "Automatic",
"steps": 15,
"sd_model": "600423083519508503",
"clip_skip": 2,
"cfg_scale": 7
}
},
{
"type": "IMAGE_TO_ADETAILER",
"image_to_adetailer": {
"args": [
{
"ad_model": "face_yolov8s.pt",
"ad_confidence": 0.7,
"ad_dilate_erode": 4,
"ad_denoising_strength": 0.4,
"ad_inpaint_only_masked": true,
"ad_inpaint_only_masked_padding": 32
}
]
}
}
]
}

Add Upscaler

Request Body:

{
"request_id": "unique_key",
"stages": [
{
"type": "INPUT_INITIALIZE",
"inputInitialize": {
"seed": -1, // RANDOM SEED
"count": 2 // GENERATE COUNT
}
},
{
"type": "DIFFUSION",
"diffusion": {
"width": 512,
"height": 512,
"prompts": [
{
"text": "1girl"
}
],
"sampler": "DPM++ 2M Karras",
"sdVae": "Automatic",
"steps": 15,
"sd_model": "600423083519508503", //checkpoint, the id ref from website
"clip_skip": 2,
"cfg_scale": 7
}
},
{
"type": "IMAGE_TO_UPSCALER",
"image_to_upscaler": {
"hr_upscaler": "Latent",
"hr_scale": 2,
"hr_second_pass_steps": 10,
"denoising_strength": 0.3
}
}
]
}