Customizing Realistic Human Photos via Stacked ID Embedding, for asynchronous image generation, only a task_id will be returned. You should use the task_id to make a call to the https://novita.ai/reference/task/task.htmlopen in new window endpoint in order to retrieve the image generation results.
Request header parameters
AuthorizationstringRequired
Request Body parameters
extraobject
extra infos.
Show properties
model_namestringRequired
Name of SDXL based model, you can call the /v3/model endpoint with parameter filter.types=checkpoint to retrieve the sd_name_in_api field as the model_name. Recomment model_name: sdxlUnstableDiffusers_v8HEAVENSWRATH_133813.safetensors
face_image_assets_ids[string]
Get asset id with guidance https://novita.ai/reference/face_editor/instant-id.html#get-image-assets-id.
face_image_urls[string]
face_image_urls is the URL for face images. It should allow the HEAD HTTP method to check the file size, and the image size needs to be smaller than 10MB.
ref_image_assets_ids[string]
Get asset id with guidance https://novita.ai/reference/face_editor/instant-id.html#get-image-assets-id.
ref_image_urls[string]
ref_image_urls is the URL for reference images. It should allow the HEAD HTTP method to check the file size, and the image size needs to be smaller than 10MB.
promptstringRequired
Positive prompt word, divided by `,`, Range [1, 512]
negative_promptstringRequired
Negtive prompt word, divided by `,`, Range [1, 512]
controlnetobject
ControlNet Units to use for InstantID.
Show properties
loras[object]
Lora options, currenlty supports up to 5 Lora, only support SDXL LoRA
Show properties
id_strengthnumber(float)Required
Identitynet strength ratio (for fidelity), Range [0, 1.5]
adapter_strengthnumber(float)Required
Adapter strength ratio (for detail), Range [0, 1.5]
widthintegerRequired
Width of image, Range [128, 1024]
heightintegerRequired
Height of image, Range [128, 1024]
image_numintegerRequired
images numbers generated in one single generation, Range [1, 8]
stepsintegerRequired
Think of steps as iterations of the image creation process, Range [1, 100]
seedintegerRequired
A seed is a number from which Stable Diffusion generates noise, Minimum -1
guidance_scalenumberRequired
This setting says how close the Stable Diffusion will listen to your prompt, Range [1, 10]
sampler_namestringRequired
This denoising process is called sampling because Stable Diffusion generates a new sample image in each step.
Customizing Realistic Human Photos via Stacked ID Embedding. The returned photos can be access by API /v3/async/task-result with task_id.
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.
import requests
# Replace the following variables with their respective values:
image_file_path =r"/home/local/test.png"
url ='https://assets.novitai.com/image'# Send a PUT requestwithopen(image_file_path,'rb')asfile:
response = requests.put(url, data=file)# Print the responseprint(response.text)
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 result in images of response.
Request:
curl--location--request GET 'https://api.novita.ai/v3/async/task-result?task_id=248f525b-edf9-4265-aa8a-8cf4c19bfe67'\--header'Authorization: Bearer {{key}}'