Generate images with Stable Diffusion Models from Image and Text Prompts.
This is an asynchronous API; only the task_id is returned initially. Use this task_id to query the Task Result API to retrieve the results of the image generation.
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.
The ControlNet configuration provides a greater degree of control over text-to-image generation by conditioning the model on additional inputs such as edge maps, depth maps, segmentation maps, and keypoints for pose detection.
Preprocessor 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, control_v1p_sd15_brightness, control_v1p_sd15_qrcode_monster, control_v1p_sd15_qrcode_monster_v2, ***ControlNets for SDXL: controlnet-canny-sdxl-1.0, controlnet-depth-sdxl-1.0, controlnet-openpose-sdxl-1.0, controlnet-softedge-sdxl-1.0
Preprocessor to use on the image passed to this unit before using it for conditioning.
Enum: scribble_hed, softedge_hed, scribble_hedsafe, softedge_hedsafe, depth_midas, mlsd, openpose, openpose_face, openpose_faceonly, openpose_full, openpose_hand, dwpose, scribble_pidinet, softedge_pidinet, scribble_pidsafe, softedge_pidsafe, normal_bae, lineart_coarse, lineart_realistic, lineart_anime, lineart, depth_zoe, shuffle, mediapipe_face, canny, depth, depth_leres, depth_leres++
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.
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, Range [1, 12], get reference at A brief introduction to Clip Skip.
Conceptually, the strength indicates the degree to which the reference image_base64 should be transformed. Must be between 0 and 1. image_base64 will be used as a starting point, with increasing levels of noise added as the strength value increases. The number of denoising steps depends on the amount of noise initially added. When strength is 1, added noise will be maximum and the denoising process will run for the full number of iterations specified in steps. A value of 1, therefore, essentially ignores image_base64.
IP-Adapter is an image prompt adapter that can be plugged into diffusion models to enable image prompting without any changes to the underlying model. Furthermore, adapter can be reused with other models finetuned from the same base model and it can be combined with other adapters like ControlNet, currenlty supports up to 1 IP-Adapter.
IP-Adapter model name, if the base model of your checkpoint is SDXL, then you should select ip-adapter_sdxl.bin. Alternatively, if the base model of your checkpoint is SD1.x, then you should select ip-adapter_sd15.bin.
Enum: ip-adapter_sd15.bin, ip-adapter_sdxl.bin
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=73fab7c0-e24f-4027-9df0-81ff8ce4bc1f'\--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.
Request:
curl--location'https://api.novita.ai/v3/async/img2img'\--header'Authorization: Bearer {{API Key}}'\--header'Content-Type: application/json'\--data '{"extra":{"response_image_type":"jpeg"},"request":{"model_name":"realcartoon25D_v3_240762.safetensors","prompt":"1girl","negative_prompt":"bad quality, bad anatomy, worst quality, low quality, lowres, extra fingers, blur, blurry, ugly, wrong proportions, watermark, image artifacts, bad eyes, bad hands, bad arms","height":1024,"width":1024,"image_num":1,"steps":20,"seed": -1,"clip_skip":1,"guidance_scale":7,"sampler_name":"Euler","controlnet":{"units":[{"model_name":"control_v11p_sd15_openpose","image_base64":"{{Base64 encode image}}","strength":0.5,"preprocessor":"openpose"}]},"image_base64":"{{Base64 encode image}}"}}'
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=5867de36-7b76-4dc7-876e-818e3ffe683e'\--header'Authorization: Bearer {{API Key}}'
3. Image to image 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=6411f576-1c62-48b4-a0d5-427488721159'\--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=741597cc-8e27-4932-9d75-34f07b96413e'\--header'Authorization: Bearer {{API Key}}'