Text to Image V2
curl --request POST \
--url https://api.novita.ai/v2/txt2img \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"extra": {
"enable_nsfw_detection": true,
"nsfw_detection_level": 123,
"enable_progress_info": {},
"response_image_type": "<string>"
},
"prompt": "<string>",
"negative_prompt": "<string>",
"sampler_name": "<string>",
"batch_size": 123,
"n_iter": 123,
"steps": 123,
"cfg_scale": 123,
"seed": 123,
"height": 123,
"width": 123,
"model_name": "<string>",
"restore_faces": true,
"restore_faces_model": null,
"sd_vae": {},
"clip_skip": 123,
"enable_hr": {},
"hr_upscaler": {},
"hr_scale": {},
"hr_resize_x": {},
"hr_resize_y": {},
"img_expire_ttl": {},
"sd_refiner": {
"checkpoint": "<string>",
"switch_at": 123
},
"controlnet_units": {
"model": "<string>",
"weight": {},
"input_image": "<string>",
"module": "<string>",
"control_mode": {},
"mask": {},
"resize_mode": {},
"processor_res": 123,
"threshold_a": 123,
"threshold_b": 123,
"guidance_start": 123,
"guidance_end": 123,
"pixel_perfect": true
}
}
'import requests
url = "https://api.novita.ai/v2/txt2img"
payload = {
"extra": {
"enable_nsfw_detection": True,
"nsfw_detection_level": 123,
"enable_progress_info": {},
"response_image_type": "<string>"
},
"prompt": "<string>",
"negative_prompt": "<string>",
"sampler_name": "<string>",
"batch_size": 123,
"n_iter": 123,
"steps": 123,
"cfg_scale": 123,
"seed": 123,
"height": 123,
"width": 123,
"model_name": "<string>",
"restore_faces": True,
"restore_faces_model": None,
"sd_vae": {},
"clip_skip": 123,
"enable_hr": {},
"hr_upscaler": {},
"hr_scale": {},
"hr_resize_x": {},
"hr_resize_y": {},
"img_expire_ttl": {},
"sd_refiner": {
"checkpoint": "<string>",
"switch_at": 123
},
"controlnet_units": {
"model": "<string>",
"weight": {},
"input_image": "<string>",
"module": "<string>",
"control_mode": {},
"mask": {},
"resize_mode": {},
"processor_res": 123,
"threshold_a": 123,
"threshold_b": 123,
"guidance_start": 123,
"guidance_end": 123,
"pixel_perfect": True
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
extra: {
enable_nsfw_detection: true,
nsfw_detection_level: 123,
enable_progress_info: {},
response_image_type: '<string>'
},
prompt: '<string>',
negative_prompt: '<string>',
sampler_name: '<string>',
batch_size: 123,
n_iter: 123,
steps: 123,
cfg_scale: 123,
seed: 123,
height: 123,
width: 123,
model_name: '<string>',
restore_faces: true,
restore_faces_model: null,
sd_vae: {},
clip_skip: 123,
enable_hr: {},
hr_upscaler: {},
hr_scale: {},
hr_resize_x: {},
hr_resize_y: {},
img_expire_ttl: {},
sd_refiner: {checkpoint: '<string>', switch_at: 123},
controlnet_units: {
model: '<string>',
weight: {},
input_image: '<string>',
module: '<string>',
control_mode: {},
mask: {},
resize_mode: {},
processor_res: 123,
threshold_a: 123,
threshold_b: 123,
guidance_start: 123,
guidance_end: 123,
pixel_perfect: true
}
})
};
fetch('https://api.novita.ai/v2/txt2img', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.novita.ai/v2/txt2img",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'extra' => [
'enable_nsfw_detection' => true,
'nsfw_detection_level' => 123,
'enable_progress_info' => [
],
'response_image_type' => '<string>'
],
'prompt' => '<string>',
'negative_prompt' => '<string>',
'sampler_name' => '<string>',
'batch_size' => 123,
'n_iter' => 123,
'steps' => 123,
'cfg_scale' => 123,
'seed' => 123,
'height' => 123,
'width' => 123,
'model_name' => '<string>',
'restore_faces' => true,
'restore_faces_model' => null,
'sd_vae' => [
],
'clip_skip' => 123,
'enable_hr' => [
],
'hr_upscaler' => [
],
'hr_scale' => [
],
'hr_resize_x' => [
],
'hr_resize_y' => [
],
'img_expire_ttl' => [
],
'sd_refiner' => [
'checkpoint' => '<string>',
'switch_at' => 123
],
'controlnet_units' => [
'model' => '<string>',
'weight' => [
],
'input_image' => '<string>',
'module' => '<string>',
'control_mode' => [
],
'mask' => [
],
'resize_mode' => [
],
'processor_res' => 123,
'threshold_a' => 123,
'threshold_b' => 123,
'guidance_start' => 123,
'guidance_end' => 123,
'pixel_perfect' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.novita.ai/v2/txt2img"
payload := strings.NewReader("{\n \"extra\": {\n \"enable_nsfw_detection\": true,\n \"nsfw_detection_level\": 123,\n \"enable_progress_info\": {},\n \"response_image_type\": \"<string>\"\n },\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"sampler_name\": \"<string>\",\n \"batch_size\": 123,\n \"n_iter\": 123,\n \"steps\": 123,\n \"cfg_scale\": 123,\n \"seed\": 123,\n \"height\": 123,\n \"width\": 123,\n \"model_name\": \"<string>\",\n \"restore_faces\": true,\n \"restore_faces_model\": null,\n \"sd_vae\": {},\n \"clip_skip\": 123,\n \"enable_hr\": {},\n \"hr_upscaler\": {},\n \"hr_scale\": {},\n \"hr_resize_x\": {},\n \"hr_resize_y\": {},\n \"img_expire_ttl\": {},\n \"sd_refiner\": {\n \"checkpoint\": \"<string>\",\n \"switch_at\": 123\n },\n \"controlnet_units\": {\n \"model\": \"<string>\",\n \"weight\": {},\n \"input_image\": \"<string>\",\n \"module\": \"<string>\",\n \"control_mode\": {},\n \"mask\": {},\n \"resize_mode\": {},\n \"processor_res\": 123,\n \"threshold_a\": 123,\n \"threshold_b\": 123,\n \"guidance_start\": 123,\n \"guidance_end\": 123,\n \"pixel_perfect\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.novita.ai/v2/txt2img")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"extra\": {\n \"enable_nsfw_detection\": true,\n \"nsfw_detection_level\": 123,\n \"enable_progress_info\": {},\n \"response_image_type\": \"<string>\"\n },\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"sampler_name\": \"<string>\",\n \"batch_size\": 123,\n \"n_iter\": 123,\n \"steps\": 123,\n \"cfg_scale\": 123,\n \"seed\": 123,\n \"height\": 123,\n \"width\": 123,\n \"model_name\": \"<string>\",\n \"restore_faces\": true,\n \"restore_faces_model\": null,\n \"sd_vae\": {},\n \"clip_skip\": 123,\n \"enable_hr\": {},\n \"hr_upscaler\": {},\n \"hr_scale\": {},\n \"hr_resize_x\": {},\n \"hr_resize_y\": {},\n \"img_expire_ttl\": {},\n \"sd_refiner\": {\n \"checkpoint\": \"<string>\",\n \"switch_at\": 123\n },\n \"controlnet_units\": {\n \"model\": \"<string>\",\n \"weight\": {},\n \"input_image\": \"<string>\",\n \"module\": \"<string>\",\n \"control_mode\": {},\n \"mask\": {},\n \"resize_mode\": {},\n \"processor_res\": 123,\n \"threshold_a\": 123,\n \"threshold_b\": 123,\n \"guidance_start\": 123,\n \"guidance_end\": 123,\n \"pixel_perfect\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novita.ai/v2/txt2img")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"extra\": {\n \"enable_nsfw_detection\": true,\n \"nsfw_detection_level\": 123,\n \"enable_progress_info\": {},\n \"response_image_type\": \"<string>\"\n },\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"sampler_name\": \"<string>\",\n \"batch_size\": 123,\n \"n_iter\": 123,\n \"steps\": 123,\n \"cfg_scale\": 123,\n \"seed\": 123,\n \"height\": 123,\n \"width\": 123,\n \"model_name\": \"<string>\",\n \"restore_faces\": true,\n \"restore_faces_model\": null,\n \"sd_vae\": {},\n \"clip_skip\": 123,\n \"enable_hr\": {},\n \"hr_upscaler\": {},\n \"hr_scale\": {},\n \"hr_resize_x\": {},\n \"hr_resize_y\": {},\n \"img_expire_ttl\": {},\n \"sd_refiner\": {\n \"checkpoint\": \"<string>\",\n \"switch_at\": 123\n },\n \"controlnet_units\": {\n \"model\": \"<string>\",\n \"weight\": {},\n \"input_image\": \"<string>\",\n \"module\": \"<string>\",\n \"control_mode\": {},\n \"mask\": {},\n \"resize_mode\": {},\n \"processor_res\": 123,\n \"threshold_a\": 123,\n \"threshold_b\": 123,\n \"guidance_start\": 123,\n \"guidance_end\": 123,\n \"pixel_perfect\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"msg": "<string>",
"data": {
"task_id": "<string>",
"warn": "<string>"
}
}Deprecated
Text to Image V2
POST
/
v2
/
txt2img
Text to Image V2
curl --request POST \
--url https://api.novita.ai/v2/txt2img \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"extra": {
"enable_nsfw_detection": true,
"nsfw_detection_level": 123,
"enable_progress_info": {},
"response_image_type": "<string>"
},
"prompt": "<string>",
"negative_prompt": "<string>",
"sampler_name": "<string>",
"batch_size": 123,
"n_iter": 123,
"steps": 123,
"cfg_scale": 123,
"seed": 123,
"height": 123,
"width": 123,
"model_name": "<string>",
"restore_faces": true,
"restore_faces_model": null,
"sd_vae": {},
"clip_skip": 123,
"enable_hr": {},
"hr_upscaler": {},
"hr_scale": {},
"hr_resize_x": {},
"hr_resize_y": {},
"img_expire_ttl": {},
"sd_refiner": {
"checkpoint": "<string>",
"switch_at": 123
},
"controlnet_units": {
"model": "<string>",
"weight": {},
"input_image": "<string>",
"module": "<string>",
"control_mode": {},
"mask": {},
"resize_mode": {},
"processor_res": 123,
"threshold_a": 123,
"threshold_b": 123,
"guidance_start": 123,
"guidance_end": 123,
"pixel_perfect": true
}
}
'import requests
url = "https://api.novita.ai/v2/txt2img"
payload = {
"extra": {
"enable_nsfw_detection": True,
"nsfw_detection_level": 123,
"enable_progress_info": {},
"response_image_type": "<string>"
},
"prompt": "<string>",
"negative_prompt": "<string>",
"sampler_name": "<string>",
"batch_size": 123,
"n_iter": 123,
"steps": 123,
"cfg_scale": 123,
"seed": 123,
"height": 123,
"width": 123,
"model_name": "<string>",
"restore_faces": True,
"restore_faces_model": None,
"sd_vae": {},
"clip_skip": 123,
"enable_hr": {},
"hr_upscaler": {},
"hr_scale": {},
"hr_resize_x": {},
"hr_resize_y": {},
"img_expire_ttl": {},
"sd_refiner": {
"checkpoint": "<string>",
"switch_at": 123
},
"controlnet_units": {
"model": "<string>",
"weight": {},
"input_image": "<string>",
"module": "<string>",
"control_mode": {},
"mask": {},
"resize_mode": {},
"processor_res": 123,
"threshold_a": 123,
"threshold_b": 123,
"guidance_start": 123,
"guidance_end": 123,
"pixel_perfect": True
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
extra: {
enable_nsfw_detection: true,
nsfw_detection_level: 123,
enable_progress_info: {},
response_image_type: '<string>'
},
prompt: '<string>',
negative_prompt: '<string>',
sampler_name: '<string>',
batch_size: 123,
n_iter: 123,
steps: 123,
cfg_scale: 123,
seed: 123,
height: 123,
width: 123,
model_name: '<string>',
restore_faces: true,
restore_faces_model: null,
sd_vae: {},
clip_skip: 123,
enable_hr: {},
hr_upscaler: {},
hr_scale: {},
hr_resize_x: {},
hr_resize_y: {},
img_expire_ttl: {},
sd_refiner: {checkpoint: '<string>', switch_at: 123},
controlnet_units: {
model: '<string>',
weight: {},
input_image: '<string>',
module: '<string>',
control_mode: {},
mask: {},
resize_mode: {},
processor_res: 123,
threshold_a: 123,
threshold_b: 123,
guidance_start: 123,
guidance_end: 123,
pixel_perfect: true
}
})
};
fetch('https://api.novita.ai/v2/txt2img', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.novita.ai/v2/txt2img",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'extra' => [
'enable_nsfw_detection' => true,
'nsfw_detection_level' => 123,
'enable_progress_info' => [
],
'response_image_type' => '<string>'
],
'prompt' => '<string>',
'negative_prompt' => '<string>',
'sampler_name' => '<string>',
'batch_size' => 123,
'n_iter' => 123,
'steps' => 123,
'cfg_scale' => 123,
'seed' => 123,
'height' => 123,
'width' => 123,
'model_name' => '<string>',
'restore_faces' => true,
'restore_faces_model' => null,
'sd_vae' => [
],
'clip_skip' => 123,
'enable_hr' => [
],
'hr_upscaler' => [
],
'hr_scale' => [
],
'hr_resize_x' => [
],
'hr_resize_y' => [
],
'img_expire_ttl' => [
],
'sd_refiner' => [
'checkpoint' => '<string>',
'switch_at' => 123
],
'controlnet_units' => [
'model' => '<string>',
'weight' => [
],
'input_image' => '<string>',
'module' => '<string>',
'control_mode' => [
],
'mask' => [
],
'resize_mode' => [
],
'processor_res' => 123,
'threshold_a' => 123,
'threshold_b' => 123,
'guidance_start' => 123,
'guidance_end' => 123,
'pixel_perfect' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.novita.ai/v2/txt2img"
payload := strings.NewReader("{\n \"extra\": {\n \"enable_nsfw_detection\": true,\n \"nsfw_detection_level\": 123,\n \"enable_progress_info\": {},\n \"response_image_type\": \"<string>\"\n },\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"sampler_name\": \"<string>\",\n \"batch_size\": 123,\n \"n_iter\": 123,\n \"steps\": 123,\n \"cfg_scale\": 123,\n \"seed\": 123,\n \"height\": 123,\n \"width\": 123,\n \"model_name\": \"<string>\",\n \"restore_faces\": true,\n \"restore_faces_model\": null,\n \"sd_vae\": {},\n \"clip_skip\": 123,\n \"enable_hr\": {},\n \"hr_upscaler\": {},\n \"hr_scale\": {},\n \"hr_resize_x\": {},\n \"hr_resize_y\": {},\n \"img_expire_ttl\": {},\n \"sd_refiner\": {\n \"checkpoint\": \"<string>\",\n \"switch_at\": 123\n },\n \"controlnet_units\": {\n \"model\": \"<string>\",\n \"weight\": {},\n \"input_image\": \"<string>\",\n \"module\": \"<string>\",\n \"control_mode\": {},\n \"mask\": {},\n \"resize_mode\": {},\n \"processor_res\": 123,\n \"threshold_a\": 123,\n \"threshold_b\": 123,\n \"guidance_start\": 123,\n \"guidance_end\": 123,\n \"pixel_perfect\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.novita.ai/v2/txt2img")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"extra\": {\n \"enable_nsfw_detection\": true,\n \"nsfw_detection_level\": 123,\n \"enable_progress_info\": {},\n \"response_image_type\": \"<string>\"\n },\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"sampler_name\": \"<string>\",\n \"batch_size\": 123,\n \"n_iter\": 123,\n \"steps\": 123,\n \"cfg_scale\": 123,\n \"seed\": 123,\n \"height\": 123,\n \"width\": 123,\n \"model_name\": \"<string>\",\n \"restore_faces\": true,\n \"restore_faces_model\": null,\n \"sd_vae\": {},\n \"clip_skip\": 123,\n \"enable_hr\": {},\n \"hr_upscaler\": {},\n \"hr_scale\": {},\n \"hr_resize_x\": {},\n \"hr_resize_y\": {},\n \"img_expire_ttl\": {},\n \"sd_refiner\": {\n \"checkpoint\": \"<string>\",\n \"switch_at\": 123\n },\n \"controlnet_units\": {\n \"model\": \"<string>\",\n \"weight\": {},\n \"input_image\": \"<string>\",\n \"module\": \"<string>\",\n \"control_mode\": {},\n \"mask\": {},\n \"resize_mode\": {},\n \"processor_res\": 123,\n \"threshold_a\": 123,\n \"threshold_b\": 123,\n \"guidance_start\": 123,\n \"guidance_end\": 123,\n \"pixel_perfect\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novita.ai/v2/txt2img")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"extra\": {\n \"enable_nsfw_detection\": true,\n \"nsfw_detection_level\": 123,\n \"enable_progress_info\": {},\n \"response_image_type\": \"<string>\"\n },\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"sampler_name\": \"<string>\",\n \"batch_size\": 123,\n \"n_iter\": 123,\n \"steps\": 123,\n \"cfg_scale\": 123,\n \"seed\": 123,\n \"height\": 123,\n \"width\": 123,\n \"model_name\": \"<string>\",\n \"restore_faces\": true,\n \"restore_faces_model\": null,\n \"sd_vae\": {},\n \"clip_skip\": 123,\n \"enable_hr\": {},\n \"hr_upscaler\": {},\n \"hr_scale\": {},\n \"hr_resize_x\": {},\n \"hr_resize_y\": {},\n \"img_expire_ttl\": {},\n \"sd_refiner\": {\n \"checkpoint\": \"<string>\",\n \"switch_at\": 123\n },\n \"controlnet_units\": {\n \"model\": \"<string>\",\n \"weight\": {},\n \"input_image\": \"<string>\",\n \"module\": \"<string>\",\n \"control_mode\": {},\n \"mask\": {},\n \"resize_mode\": {},\n \"processor_res\": 123,\n \"threshold_a\": 123,\n \"threshold_b\": 123,\n \"guidance_start\": 123,\n \"guidance_end\": 123,\n \"pixel_perfect\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"msg": "<string>",
"data": {
"task_id": "<string>",
"warn": "<string>"
}
}The Text-to-Image V2 API is deprecated and will be removed in the future. Please migrate to Text-to-Image V3.
POST Text to Image V2
The text-to-image endpoint will return only atask_id. You should use the task_id to call the /v2/progress API endpoint to retrieve the image generation results. We will gradually phase out the V2 endpoints. It is recommended to use the V3 endpoints to generate images.
Request Headers
Request Body
Show properties
Show properties
When set to true, NSFW detection will be enabled, incurring an additional cost of $0.0015 for each generated image.
*** 0 - Explicit Nudity, Explicit Sexual Activity, Sex Toys; Hate Symbols.*** 1 - Explicit Nudity, Explicit Sexual Activity, Sex Toys; Hate Symbols; Non-Explicit Nudity, Obstructed Intimate Parts, Kissing on the Lips.*** 2 - Explicit Nudity, Explicit Sexual Activity, Sex Toys; Hate Symbols; Non-Explicit Nudity, Obstructed Intimate Parts, Kissing on the Lips; Female Swimwear or Underwear, Male Swimwear or Underwear.
Enum:
Enum:
0, 1, 2You will receive empty preview images if
enable_progress_info is set to false.The format of the returned images; default: png
Enum:
Enum:
png, jpegPositive prompt words, separated by
,. If you want to use LoRA, you can call the /v3/model endpoint with the parameter filter.types=lora to retrieve the sd_name_in_api field as the model_name. Remember that the format for LoRA models is <lora:$sd_name:$weight>.Negative prompt words, separated by
,.This denoising process is called sampling because Stable Diffusion generates a new sample image at each step.
Enum:
Enum:
DPM++ 2M Karras, DPM++ SDE Karras, DPM++ 2M SDE Exponential, DPM++ 2M SDE Karras, Euler a, Euler, LMS, Heun, DPM2, DPM2 a, DPM++ 2S a, DPM++ 2M, DPM++ SDE, DPM++ 2M SDE, DPM++ 2M SDE Heun, DPM++ 2M SDE Heun Karras, DPM++ 2M SDE Heun Exponential, DPM++ 3M SDE, DPM++ 3M SDE Karras, DPM++ 3M SDE Exponential, DPM fast, DPM adaptive, LMS Karras, DPM2 Karras, DPM2 a Karras, DPM++ 2S a Karras, Restart, DDIM, PLMS, UniPCThe number of images generated in one single generation. Range: [0, 8]
The number of generations. Range: [0, 8]
Think of steps as iterations in the image creation process. Range: (0, 50]
This setting determines how closely Stable Diffusion will adhere to your prompt. Range: (0, 30]
A seed is a number from which Stable Diffusion generates noise.
Height of the image. Range: (0, 2048]
Width of the image. Range: (0, 2048]
Name of the Stable Diffusion model. You can call the
/v3/model endpoint with the parameter filter.types=checkpoint to retrieve the sd_name_in_api field as the model_name.Enable the Stable Diffusion face restoration plugin.
VAE (Variational Auto Encoder).
sd_vae can be accessed in the API /v3/model with query parameters filter.types=vae to retrieve the sd_name field as the sd_vae.This parameter indicates the number of layers to stop from the bottom during optimization, so clip_skip on 2 would mean, that in SD1.x model where the CLIP has 12 layers, you would stop at 10th layer.
Hires.fix function switch.
Upscalers model names. AI upscalers are models trained with massive amounts of data.
Enum:
Enum:
Latent, ESRGAN_4x, R-ESRGAN 4x+, R-ESRGAN 4x+ Anime6BThe magnification factor of the image, if params hr_resize_x and hr_resize_y are set, this parameter will be ignored.
Enum:
Enum:
1, 2The target image width, the maximum image size is 2048, only take effect when parameters hr_scale=1.
The target image hight, the maximum image size is 2048, only take effect when parameters hr_scale=1.
Image storage time (seconds). Range [0, 604800]
ControlNet.
Show properties
Show properties
Model to use on the image passed to this unit before using it for conditioning. ***Controlnets for SD 1.5: control_v11e_sd15_ip2p, control_v11e_sd15_shuffle, control_v11f1e_sd15_tile, control_v11f1p_sd15_depth, control_v11p_sd15_canny, control_v11p_sd15_inpaint, control_v11p_sd15_lineart, control_v11p_sd15_mlsd, control_v11p_sd15_normalbae, control_v11p_sd15_openpose, control_v11p_sd15_scribble, control_v11p_sd15_seg, control_v11p_sd15_softedge, control_v11p_sd15s2_lineart_anime, ip-adapter-plus-face_sd15, ip-adapter_sd15_plus, ip-adapter_sd15; ***Controlnets for SDXL: t2i-adapter_diffusers_xl_canny, t2i-adapter_diffusers_xl_depth_midas, t2i-adapter_diffusers_xl_depth_zoe, t2i-adapter_diffusers_xl_lineart, t2i-adapter_diffusers_xl_openpose, t2i-adapter_diffusers_xl_sketch, t2i-adapter_xl_canny, t2i-adapter_xl_openpose, t2i-adapter_xl_sketch, ip-adapter_xl
weight of this unit. defaults to 1
base64 of input image
preprocessor to use on the image passed to this unit before using it for conditioning.
Enum:
Enum:
none, canny, depth, depth_leres, depth_leres++, hed, hed_safe, mediapipe_face, mlsd, normal_map, openpose, openpose_hand, openpose_face, openpose_faceonly, openpose_full, clip_vision, color, pidinet, pidinet_safe, pidinet_sketch, pidinet_scribble, scribble_xdog, scribble_hed, segmentation, threshold, depth_zoe, normal_bae, oneformer_coco, oneformer_ade20k, lineart, lineart_coarse, lineart_anime, lineart_standard, shuffle, tile_resample, invert, lineart_anime_denoise, reference_only, reference_adain, reference_adain+attn, inpaint, inpaint_only, inpaint_only+lama, tile_colorfix, tile_colorfix+sharp, depth_anything0 for Balanced,1 for My prompt is more important 2 for ControlNet is more important
Enum:
Enum:
0, 1, 2Base64 of mask images, support jpg, jpeg and png format images. Only take effect when controlnet_units.model set to control_v11p_sd15_inpaint.
How to resize the input image so as to fit the output resolution of the generation. 0 represent JUST_RESIZE, 1 represent RESIZE_OR_CORP, 2 represent RESIZE_AND_FILL
Enum:
Enum:
0, 1, 2Resolution of the preprocessor.
First parameter of the preprocessor, only takes effect when preprocessor accepts arguments.
Second parameter of the preprocessor, only takes effect when preprocessor accepts arguments.
ratio of generation where this unit starts to have an effect.
ratio of generation where this unit stops to have an effect.
Enable pixel-perfect preprocessor, when set to false, it means not to resize images.
Response
Example
requestcurl --location 'https://api.novita.ai/v2/txt2img' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
'extra': {
'enable_nsfw_detection': false,
'nsfw_detection_level': 0,
'enable_progress_info': false
},
'prompt': 'Luxury suite design, Spacious suite area, Luxuriously plush large bed, Refined office desk, Carefully selected furniture for the luxurious suite, High-end and opulent decor, Private office and lounge area, Comfortably luxurious office chair, Amenities for luxury travelers, Premium bedding and linens, Uniquely designed lighting fixtures, Luxurious suite curtain design, Private work corner, Luxurious amenities, Lavish lounge area, Sophisticated indoor plant, decorations, Exquisite luxury design, Exclusive services for the luxury suite, Luxury color scheme. Exclusive furniture for the luxury suite, a bedroom with a large bed and a desk',
'negative_prompt': '(badhandv4:1.2),(worst quality:2),(low quality:2),(normal quality:2),lowres,bad anatomy,bad hands,((monochrome)),((grayscale)) watermark,moles, easynegative ng_deepnegative_v1_75t, (oversized head:2), (big head:2), (deformed face:1.5),( blurry face:2), bad eyes, irregular eyes, asymmetric eyes, ugly, teeth, (navel:0.9), artefact, jpg artefact, blurry face, blurry, blurred, pixelated, bad eyes, crossed eyes, blurry eyes',
'sampler_name': 'DPM++ 2M Karras',
'batch_size': 1,
'n_iter': 1,
'steps': 25,
'cfg_scale': 7,
'seed': -1,
'height': 512,
'width': 512,
'model_name': 'sd_xl_base_0.9.safetensors',
'restore_faces': false,
'restore_faces_model': '',
'sd_vae': '',
'clip_skip': 1,
'enable_hr': false,
'hr_upscaler': 'Latent',
'hr_scale': 1,
'hr_resize_x': null,
'hr_resize_y': null,
'img_expire_ttl': null,
'sd_refiner': {
'checkpoint': 'sd_xl_refiner_1.0.safetensors',
'switch_at': null
},
'controlnet_units': [
{
'model': '',
'weight': null,
'input_image': '',
'module': 'none',
'control_mode': 0,
'mask': '',
'resize_mode': 0,
'processor_res': null,
'threshold_a': null,
'threshold_b': null,
'guidance_start': null,
'guidance_end': null,
'pixel_perfect': false
}
]
}'
{
"code": 0,
"msg": "",
"data": {
"task_id": "d4cf3973-8414-4a5e-aa6f-ef54caf73662"
}
}
Last modified on January 14, 2026
Was this page helpful?
⌘I