Text to Image with LCM
Text to Image with LCM
POST https://api.novita.ai/v3/lcm-txt2img
10x faster image generation with latent consistency models, synthesizing high-resolution images with few-step inference.
Example
1. Text to Image with LCM
10x faster image generation with latent consistency models, synthesizing high-resolution images with few-step inference.
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 --request POST 'https://api.novita.ai/v3/lcm-txt2img' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'Content-Type: application/json' \
--header "Accept-Encoding: gzip" \
--data-raw '{
"prompt": "Glowing jellyfish floating through a foggy forest at twilight",
"height": 512,
"width": 512,
"image_num": 2,
"steps": 8,
"guidance_scale": 1.5
}'
HTTP status codes in the 2xx range indicate that the request has been successfully accepted. A code 400 means there is a request parameter error, while status codes in the 5xx range indicate internal server errors.
Response:
{
"images": [
{
"image_file": "{{Base64 encoded image}}",
"image_type": "jpeg"
},
{
"image_file": "{{Base64 encoded image}}",
"image_type": "jpeg"
},
]
}