Image to Image with LCM
Image to Image with LCM
POST https://api.novita.ai/v3/lcm-img2img
10x faster image generation with latent consistency models, synthesizing high-resolution images with few-step inference.
Example
1. Img2img Request with LCM
10x faster image generation with latent consistency models, synthesizing high-resolution images with few-step inference.
Request:
curl --location --request POST 'https://dev-api.novita.ai/v3/lcm-img2img' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'Content-Type: application/json' \
--header 'Accept-Encoding: gzip' \
--data-raw '{
"model_name": "dreamshaper_8_93211.safetensors",
"input_image": "{{Base64 encoded image}}",
"prompt": "beautiful sunflower, sun",
"negative_prompt": "",
"sd_vae": "vae-ft-mse-840000-ema-pruned.safetensors",
"loras":[
{
"model_name": "more_details_59655",
"strength": 0.5
},
{
"model_name": "Gothpunk_30978",
"strength": 0.5
}
],
"embeddings": [
{
"model_name": "AS-YoungV2"
},
{
"model_name": "MidAged"
}
],
"image_num": 1,
"steps": 3,
"seed": 123,
"clip_skip": 1,
"guidance_scale": 0
}'
HTTP status codes in the 2xx range indicate that the request has been successfully accepted. Code 400 means there is a request parameter error, while status codes in the 5xx range indicate internal server errors.
Response:
{
"image": [
{
"image_url": "https://faas-output-image.s3.ap-southeast-1.amazonaws.com/test/lcm_img2img_e1ca4ee4-aa69-4073-94ab-f2dddc6bf7fc_0.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASVPYCN6LRCW3SOUV%2F20231201%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20231201T081801Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&x-id=GetObject&X-Amz-Signature=4d9d50cf00116cea5409acbef51caaf023f805804be3f13efcb980982a2b4d46",
"image_url_ttl": "3600",
"image_type": "jpeg"
}
]
}