curl --request POST \
--url https://modelslab.com/api/v6/images/img2img \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"model_id": "<string>",
"prompt": "<string>",
"init_image": "<string>",
"negative_prompt": "<string>",
"strength": 0.7,
"width": 2048,
"height": 2048,
"samples": 1,
"num_inference_steps": 30,
"guidance_scale": 7.5,
"safety_checker": "yes",
"scheduler": "DPMSolverMultistepScheduler",
"use_karras_sigmas": "yes",
"algorithm_type": "sde-dpmsolver++",
"clip_skip": 2,
"seed": 123,
"webhook": "<string>",
"track_id": "<string>"
}
'{
"generationTime": 123,
"id": 123,
"output": [
"<string>"
],
"proxy_links": [
"<string>"
],
"meta": {},
"nsfw_content_detected": true,
"webhook_status": "<string>",
"tip": "<string>"
}Image to Image
Transform existing images using Pony models.
curl --request POST \
--url https://modelslab.com/api/v6/images/img2img \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"model_id": "<string>",
"prompt": "<string>",
"init_image": "<string>",
"negative_prompt": "<string>",
"strength": 0.7,
"width": 2048,
"height": 2048,
"samples": 1,
"num_inference_steps": 30,
"guidance_scale": 7.5,
"safety_checker": "yes",
"scheduler": "DPMSolverMultistepScheduler",
"use_karras_sigmas": "yes",
"algorithm_type": "sde-dpmsolver++",
"clip_skip": 2,
"seed": 123,
"webhook": "<string>",
"track_id": "<string>"
}
'{
"generationTime": 123,
"id": 123,
"output": [
"<string>"
],
"proxy_links": [
"<string>"
],
"meta": {},
"nsfw_content_detected": true,
"webhook_status": "<string>",
"tip": "<string>"
}Documentation Index
Fetch the complete documentation index at: https://docs.modelslab.com/llms.txt
Use this file to discover all available pages before exploring further.
Request
Make aPOST request to the endpoint below with the required parameters.
POST https://modelslab.com/api/v6/images/img2img
Body
{
"key": "your_api_key",
"model_id": "pony_realism",
"prompt": "a cat sitting on a bench, oil painting style",
"negative_prompt": "blurry, low quality",
"init_image": "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png",
"strength": 0.7,
"width": 2048,
"height": 2048,
"samples": 1,
"num_inference_steps": 31,
"safety_checker": "no",
"seed": null,
"guidance_scale": 7.5,
"scheduler": "DPMSolverMultistepScheduler",
"use_karras_sigmas": "yes",
"algorithm_type": "sde-dpmsolver++",
"clip_skip": "2",
"webhook": null,
"track_id": null
}
Body
Your API Key used for request authorization.
The ID of the Pony model to be used. Use pony_realism for the Pony Realism model.
A text description of what you want in the generated image.
URL of the initial image to be used as a reference.
Items you don't want in the image.
How much to transform the init image. 0.0 = no change, 1.0 = complete transformation.
0 <= x <= 1The width of the image in pixels. Must be between 1024-2048 and divisible by 8.
1024 <= x <= 2048The height of the image in pixels. Must be between 1024-2048 and divisible by 8.
1024 <= x <= 2048The number of images to be returned in response. Maximum is 4.
x <= 4Number of denoising steps. Higher values produce more detailed images but take longer.
20 <= x <= 50How closely to follow the prompt. Higher values = more literal interpretation.
1 <= x <= 20Enable NSFW content filter.
yes, no Scheduler to use for denoising.
Apply Karras sigmas to the scheduler.
yes, no Algorithm type for the scheduler.
Number of CLIP layers to skip. Affects style interpretation.
1 <= x <= 4Random seed for reproducible results. Pass null for a random number.
URL to receive a POST API call once image generation is complete.
Unique ID used in webhook response to identify the request.
Response
Image-to-image generation response
- Option 1
- Option 2
- Option 3
Status of the image generation.
success Time taken to generate the image in seconds.
Unique identifier for the image generation request.
Array of generated image URLs.
Array of proxy image URLs.
Metadata about the image generation including all parameters used.
Indicates if NSFW content was detected in the generated image.
Status of the webhook notification.
Additional information or tips for the user.
Was this page helpful?

