Request

Make a POST request to below endpoint and pass the required parameters as a request body.
curl
--request POST 'https://modelslab.com/api/v1/enterprise/img2img' \
To use the load balancer, you need to have more than 1 server. Pass the first server’s API key, and it will handle the load balancing with the other servers.

Body

json
{  
  "key": "enterprise_api_key",  
  "model_id": "realistic-vision-51",  
  "prompt": "women playing tennis",  
  "negative_prompt": null,  
  "init_image": "https://i.pinimg.com/736x/20/ab/3d/20ab3df5c180e1cae812020bcfeb3093.jpg",  
  "samples": "1",  
  "num_inference_steps": "31",  
  "safety_checker": "yes",  
  "enhance_prompt": "yes",  
  "guidance_scale": 7.5,  
  "strength": 0.7,  
  "scheduler": "UniPCMultistepScheduler",  
  "seed": null,  
  "lora_model": null,  
  "tomesd": "yes",  
  "use_karras_sigmas": "yes",  
  "vae": null,  
  "lora_strength": null,  
  "webhook": null,  
  "track_id": null
}

Schedulers

This endpoint also supports schedulers. Use the “scheduler” parameter in the request body to pass a specific scheduler from the list below:
  • DDPMScheduler
  • DDIMScheduler
  • PNDMScheduler
  • LMSDiscreteScheduler
  • EulerDiscreteScheduler
  • EulerAncestralDiscreteScheduler
  • DPMSolverMultistepScheduler
  • HeunDiscreteScheduler
  • KDPM2DiscreteScheduler
  • DPMSolverSinglestepScheduler
  • KDPM2AncestralDiscreteScheduler
  • UniPCMultistepScheduler
  • DDIMInverseScheduler
  • DEISMultistepScheduler
  • IPNDMScheduler
  • KarrasVeScheduler
  • ScoreSdeVeScheduler
  • LCMScheduler

Body Attributes

key
string
required
Your enterprise API Key used for request authorization.
model_id
string
required
The ID of the model to be used. It can be public or your trained model.
prompt
string
required
Text prompt with description of the things you want in the image to be generated.
negative_prompt
string
Items you don’t want in the image.
init_image
string
Link to the initial image.
width
number
default:"512"
Width of the image. Maximum: 1024.
height
number
default:"512"
Height of the image. Maximum: 1024.
samples
number
default:"1"
Number of images to return. Maximum: 4.
num_inference_steps
number
default:"21"
Number of denoising steps. Allowed values: 21, 31, or 41.
safety_checker
string
default:"yes"
NSFW image checker. If detected, replaces the image with blank. Options: yes/no.
safety_checker_type
string
default:"sensitive_content_text"
Action to apply if NSFW content is detected. Options: blur, sensitive_content_text, pixelate, black.
guidance_scale
number
default:"7.5"
Scale for classifier-free guidance (range: 1–20).
strength
number
default:"0.7"
Prompt strength when using init_image. 1.0 fully overrides the init image.
clip_skip
number
Clip Skip value. Range: 1–8.
seed
number
Seed for reproducibility. Pass null for random generation.
webhook
string
URL to receive a POST callback once the image generation is complete.
track_id
string
ID returned in webhook callback to identify the request.