Bearer authentication format, for example: Bearer {{API Key}}.
object
extra
object
extra
object
Optional extra parameters for the request.
response_image_type
string
response_image_type
string
The returned image type. Default is png.Enum:
webhook
object
webhook
object
Webhook settings. More details can be found at
url
string
*
url
Required
string
The URL of the webhook endpoint. Novita AI will send the task generated outputs to your specified webhook endpoint.
test_mode
object
test_mode
object
By specifying Test Mode, a mock event will be sent to the webhook endpoint.
enabled
boolean
*
enabled
Required
boolean
Set to true to enable Test Mode, or false to disable it. The default is false.
return_task_status
string
*
return_task_status
Required
string
Control the data content of the mock event. When set to TASK_STATUS_SUCCEED, you’ll receive a normal response; when set to TASK_STATUS_FAILED, you’ll receive an error response.Enum:
custom_storage
object
custom_storage
object
Customer storage settings for saving the generated outputs.
aws_s3
object
aws_s3
object
AWS S3 Bucket settings.
region
string
*
region
Required
string
AWS S3 regions,
bucket
string
*
bucket
Required
string
AWS S3 bucket name.
path
string
*
path
Required
string
AWS S3 bucket path for saving generated outputs.
save_to_path_directly
boolean
save_to_path_directly
boolean
Set this option to True to save the generated outputs directly to the specified path without creating any additional directory hierarchy.
enterprise_plan
object
enterprise_plan
object
Dedicated Endpoints settings, which only take effect for users who have already subscribed to the
enabled
boolean
enabled
boolean
Set to true to schedule this task to use your Dedicated Endpoints’s dedicated resources. Default is false.
enable_nsfw_detection
boolean
enable_nsfw_detection
boolean
When set to true, NSFW detection will be enabled, incurring an additional cost of $0.0015 for each generated image.
nsfw_detection_level
integer
nsfw_detection_level
integer
0: Explicit Nudity, Explicit Sexual Activity, Sex Toys; Hate Symbols.
request
object
*
request
Required
object
model_name
string
*
model_name
Required
string
This parameter specifies the name of the model checkpoint. Retrieve the corresponding sd_name value by invoking the
prompt
string
*
prompt
Required
string
Text input required to guide the image generation, divided by
width
integer
*
width
Required
integer
Width of image. Range [128, 2048].
height
integer
*
height
Required
integer
Height of image. Range [128, 2048].
image_num
integer
*
image_num
Required
integer
Images numbers generated in one single generation. Range [1, 8].
steps
integer
*
steps
Required
integer
The number of denoising steps. More steps usually can produce higher quality images, but take more time to generate, Range [1, 100].
guidance_scale
object
*
guidance_scale
Required
object
This setting says how close the Stable Diffusion will listen to your prompt, higer guidance forces the model to better follow the prompt, but result in lower quality output. Range [1, 30].
sampler_name
string
*
sampler_name
Required
string
This parameter determines the denoising algorithm employed during the sampling phase of Stable Diffusion. Each option represents a distinct method by which the model incrementally generates new images. These algorithms differ significantly in their processing speed, output quality, and the specific characteristics of the images they generate, allowing users to tailor the image generation process to meet precise requirements. Get reference at
negative_prompt
string
negative_prompt
string
Text input that specifies what to exclude from the generated images, divided by
sd_vae
string
sd_vae
string
VAE (Variational Auto Encoder). sd_vae can be accessed in the API /v3/models with query params type=vae, like sd_name: customVAE.safetensors. Get reference at
seed
integer
seed
integer
A seed is a number from which Stable Diffusion generates noise, which, makes generation deterministic. Using the same seed and set of parameters will produce identical image each time, minimum -1. Defaults to -1.
loras
array
loras
array
LoRA is a fast and lightweight training method that inserts and trains a significantly smaller number of parameters instead of all the model parameters. Currently supports up to 5 LoRAs.
embeddings
array
embeddings
array
Textual Inversion is a training method for personalizing models by learning new text embeddings from a few example images, currently supports up to 5 embeddings.
hires_fix
object
hires_fix
object
Upscale images while they are generating.
target_width
integer
*
target_width
Required
integer
Target width, Range [128, 4096].
target_height
integer
*
target_height
Required
integer
Target height, Range [128, 4096].
strength
object
*
strength
Required
object
Defines the intensity of the
upscaler
string
upscaler
string
The
refiner
object
refiner
object
SD refiner.
switch_at
object
*
switch_at
Required
object
The switch_at parameter in the context of a refiner allows you to set the extent to which the refiner alters the output of a model. When set to 0, the refiner has no effect; at 1, it’s fully active. Intermediate values like 0.5 provide a balanced effect, where the refiner is moderately engaged, enhancing or adjusting the output without dominating the original model’s characteristics. This setting is particularly useful for fine-tuning the output to achieve a desired balance between refinement and the original generative features, Range [0, 1].
enable_transparent_background
boolean
enable_transparent_background
boolean
Make the resulting image’s background transparent. Please note that if the transparent_background is enabled, the extra response_image_type must be PNG, and only SDXL models are allowed.
restore_faces
boolean
restore_faces
boolean
Used to control whether the Face Restoration feature is enabled.
Generate images from text prompts using Stable Diffusion models.
This is an asynchronous API; only the task_id will be returned. You should use the task_id to request the Task Result API to retrieve the image generation results.
Control the data content of the mock event. When set to TASK_STATUS_SUCCEED, you’ll receive a normal response; when set to TASK_STATUS_FAILED, you’ll receive an error response.Enum: TASK_STATUS_SUCCEED, TASK_STATUS_FAILED
Customer storage settings for saving the generated outputs. By default, the generated outputs will be saved to Novita AI Storage temporarily and privately.
Set this option to True to save the generated outputs directly to the specified path without creating any additional directory hierarchy. If set to False, Novita AI will create an additional directory in the path to save the generated outputs. The default is False.
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: 0, 1, 2
This parameter specifies the name of the model checkpoint. Retrieve the corresponding sd_name value by invoking the Query Model API with filter.types=checkpoint as the query parameter.
This setting says how close the Stable Diffusion will listen to your prompt, higer guidance forces the model to better follow the prompt, but result in lower quality output. Range [1, 30].
This parameter determines the denoising algorithm employed during the sampling phase of Stable Diffusion. Each option represents a distinct method by which the model incrementally generates new images. These algorithms differ significantly in their processing speed, output quality, and the specific characteristics of the images they generate, allowing users to tailor the image generation process to meet precise requirements. Get reference at A brief introduction to Sampler.Enum: Euler a,Euler,LMS,Heun,DPM2,DPM2 a,DPM++ 2S a,DPM++ 2M,DPM++ SDE,DPM fast,DPM adaptive,LMS Karras,DPM2 Karras,DPM2 a Karras,DPM++ 2S a Karras,DPM++ 2M Karras,DPM++ SDE Karras,DDIM,PLMS,UniPC
VAE (Variational Auto Encoder). sd_vae can be accessed in the API /v3/models with query params type=vae, like sd_name: customVAE.safetensors. Get reference at A brief introduction to VAE.
A seed is a number from which Stable Diffusion generates noise, which, makes generation deterministic. Using the same seed and set of parameters will produce identical image each time, minimum -1. Defaults to -1.
LoRA is a fast and lightweight training method that inserts and trains a significantly smaller number of parameters instead of all the model parameters. Currently supports up to 5 LoRAs.
Textual Inversion is a training method for personalizing models by learning new text embeddings from a few example images, currently supports up to 5 embeddings.
Name of textual Inversion model, you can call the Get Model API endpoint with parameter filter.types=textualinversion to retrieve the sd_name_in_api field as the model_name.
Defines the intensity of the upscaler model’s effect. A value of 0 means the upscaler has no effect, while 1 results in maximum intensity, fully utilizing the upscaler’s capabilities, range [0, 1].
The switch_at parameter in the context of a refiner allows you to set the extent to which the refiner alters the output of a model. When set to 0, the refiner has no effect; at 1, it’s fully active. Intermediate values like 0.5 provide a balanced effect, where the refiner is moderately engaged, enhancing or adjusting the output without dominating the original model’s characteristics. This setting is particularly useful for fine-tuning the output to achieve a desired balance between refinement and the original generative features, Range [0, 1].
Make the resulting image’s background transparent. Please note that if the transparent_background is enabled, the extra response_image_type must be PNG, and only SDXL models are allowed.
Please set the Content-Type header to application/json in your HTTP request to indicate that you are sending JSON data. Currently, only JSON format is supported.
HTTP status codes in the 2xx range indicate that the request has been successfully accepted, while status codes in the 5xx range indicate internal server errors.
You can get images url in imgs of response.
Request:
curl--location--request GET 'https://api.novita.ai/v3/async/task-result?task_id=f10333f2-2dd7-4f56-a177-e3c02a774d9a'\--header'Authorization: Bearer {{API Key}}'
Please set the Content-Type header to application/json in your HTTP request to indicate that you are sending JSON data. Currently, only JSON format is supported.
HTTP status codes in the 2xx range indicate that the request has been successfully accepted, while status codes in the 5xx range indicate internal server errors.
You can get images url in imgs of response.
Request:
curl--location--request GET 'https://api.novita.ai/v3/async/task-result?task_id=6469ca5b-5929-4200-b263-241020763eb8'\--header'Authorization: Bearer {{API Key}}'
Please set the Content-Type header to application/json in your HTTP request to indicate that you are sending JSON data. Currently, only JSON format is supported.
HTTP status codes in the 2xx range indicate that the request has been successfully accepted, while status codes in the 5xx range indicate internal server errors.
You can get images url in imgs of response.
Request:
curl--location--request GET 'https://api.novita.ai/v3/async/task-result?task_id=6469ca5b-5929-4200-b263-241020763eb8'\--header'Authorization: Bearer {{API Key}}'
Please set the Content-Type header to application/json in your HTTP request to indicate that you are sending JSON data. Currently, only JSON format is supported.
HTTP status codes in the 2xx range indicate that the request has been successfully accepted, while status codes in the 5xx range indicate internal server errors.
You can get images url in imgs of response.
Request:
curl--location--request GET 'https://api.novita.ai/v3/async/task-result?task_id=6469ca5b-5929-4200-b263-241020763eb8'\--header'Authorization: Bearer {{API Key}}'
5.Txt2img request with Textual Inversion(embedding)
Please set the Content-Type header to application/json in your HTTP request to indicate that you are sending JSON data. Currently, only JSON format is supported.
"epiCPhotoGasm-colorfulPhoto-neg_108119.pt""epiCNegative_66017.pt""verybadimagenegative_v1.3_21434.pt""FastNegativeV2_65067.pt""AS-YoungV2.pt""AS-YoungV2-neg.pt""AS-YoungestV2.pt""AS-YoungerV2.pt""AS-MidAged.pt""AS-Elderly.pt""AS-Adult.pt""AS-Adult-neg.pt""Adult.pt""MidAged.pt""unaestheticXLv13_98060.safetensors""unaestheticXL_Sky3.1_134255.safetensors""EasyNegativeV2_75525.safetensors""BadDream_53202.pt""UnrealisticDream_53204.pt""negative_hand-neg_43127.pt""bad_prompt_version2-neg_42594.pt""Asian-Less-Toon_39763.pt""badhandv4_16755.pt""easynegative_8955.safetensors""aestheticc-65800_8615.pt""corneo_side_deepthroat_6490.pt""corneo_tentacle_sex.pt""By bad artist -neg_6310.pt""dpthrt_5441.pt""ng_deepnegative_v1_75t_5845.pt""pureerosface_v1_5162.pt"
HTTP status codes in the 2xx range indicate that the request has been successfully accepted, while status codes in the 5xx range indicate internal server errors.
You can get images url in imgs of response.
Request:
curl--location--request GET 'https://api.novita.ai/v3/async/task-result?task_id=6469ca5b-5929-4200-b263-241020763eb8'\--header'Authorization: Bearer {{API Key}}'
When set enable_nsfw_detection true, NSFW detection will be enabled, incurring an additional cost of $0.0015 for each generated image.
nsfw_detection_level, nsfw check level, ranging from 0 to 2, with higher levels indicating stricter NSFW detection criteria. The default value is 0. The following table lists the NSFW detection criteria for each level.
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.
Please set the Content-Type header to application/json in your HTTP request to indicate that you are sending JSON data. Currently, only JSON format is supported.
HTTP status codes in the 2xx range indicate that the request has been successfully accepted, while status codes in the 5xx range indicate internal server errors.
You can get images url in imgs of response. There are two results in reponse.
enable_nsfw_detection, when return with true means NSFW detection is enabled.
nsfw_detection_result, presenting an array of NSFW detection outcomes for each image. The order of elements in the nsfw_detection_result array corresponds one-to-one with the sequence of images in the images field in the response. The valid field denotes the success of the NSFW detection process, while the confidence field, ranging from 0 to 100, signifies the confidence level of the NSFW detection result. Higher confidence values, nearing 100, suggest a greater likelihood of the corresponding image containing NSFW content.
Request:
curl--location--request GET 'https://api.novita.ai/v3/async/task-result?task_id=0fe0f291-05c9-41a4-83bb-3365d4b54f8b'\--header'Authorization: Bearer {{API Key}}'