Request

Send a POST request to below endpoint.
curl
--request POST 'https://modelslab.com/api/v1/enterprise/controlnet' \
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.
You can also use multi ControlNet. Just make sure to pass comma saparated controlnet models to the controlnet_model as “canny,depth” and init_image in the request body.
You can also use multi Lora. Just make sure to pass comma saparated lora model ids to the lora_model as "more_details,animie" in the request body.
You can also use this endpoint to inpaint images with ControlNet. Just make sure to pass the link to the mask_image in the request body. and use controlnet_model as inpaint.

Body

json
{  
  "key": "enterprise_api_key",  
  "controlnet_model": "canny",  
  "controlnet_type" :"canny",  
  "model_id": "midjourney",  
  "auto_hint": "yes",  
  "guess_mode" : "no",  
  "prompt": "a model doing photoshoot, ultra high resolution, 4K image",  
  "negative_prompt": null,  
  "init_image": "https://huggingface.co/datasets/diffusers/test-arrays/resolve/main/stable_diffusion_imgvar/input_image_vermeer.png",  
  "mask_image": null,  
  "width": "512",  
  "height": "512",  
  "samples": "1",  
  "scheduler": "UniPCMultistepScheduler",  
  "num_inference_steps": "30",  
  "safety_checker": "no",  
  "enhance_prompt": "yes",  
  "guidance_scale": 7.5,  
  "strength": 0.55,  
  "seed": null,  
  "webhook": null,  
  "track_id": null
}

ControlNet Models

ControlNet API using Controlnet 1.1 as default: Suported controlnet_model:
  • canny
  • depth
  • hed
  • mlsd
  • normal
  • openpose
  • scribble
  • segmentation
  • inpaint
  • softedge
  • lineart
  • shuffle
  • tile
  • face_detector
  • qrcode

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 a public model or your trained model.
controlnet_model
string
ControlNet model ID. It can be from the models list or user trained.
controlnet_type
string
ControlNet model type. It can be from the models list.
auto_hint
string
default:"no"
Auto hint image. Options: yes/no.
guess_mode
string
default:"no"
If set to yes and no prompt is passed, the model will attempt to guess what’s in the init_image and create variations. Options: yes/no.
prompt
string
Text prompt describing required image modifications. Make it detailed for best results.
negative_prompt
string
Items you don’t want in the image.
init_image
string
Link to the initial image.
control_image
string
Link to the ControlNet image.
mask_image
string
Link to the mask image for inpainting.
width
integer
default:"512"
Width of the image. Maximum: 1024.
height
integer
default:"512"
Height of the image. Maximum: 1024.
samples
integer
default:"1"
Number of images to return in the response. Maximum: 4.
scheduler
string
The scheduler to use. See Schedulers.
tomesd
string
default:"yes"
Enable ToMeSD for faster results. Default: yes.
use_karras_sigmas
string
default:"yes"
Use Karras sigmas for improved results. Default: yes.
algorithm_type
string
default:"none"
Used in DPMSolverMultistepScheduler. Default: none.
vae
string
Custom VAE to use. Default: null.
lora_strength
string
Strength values for LoRa models (comma-separated). Range: 0.1–1.
lora_model
string
LoRa models to use (comma-separated). Example: contrast-fix,yae-miko-genshin
num_inference_steps
integer
default:"21"
Number of denoising steps. Allowed values: 21 or 31.
safety_checker
string
default:"yes"
NSFW checker. If detected, replaces image with blank. Default: yes.
enhance_prompt
string
default:"yes"
Enhance prompts for better results. Default: yes.
multi_lingual
string
default:"yes"
Enable multilingual input. Default: yes.
guidance_scale
number
default:"7.5"
Scale for classifier-free guidance.
controlnet_conditioning_scale
number
default:"1"
Scale for ControlNet guidance.
strength
number
default:"0.7"
Prompt strength when using init_image. 1.0 fully overrides the init image.
seed
integer
Seed for reproducibility. Pass null for random generation.
webhook
string
URL to receive a POST callback when image generation is complete.
track_id
string
ID returned in webhook callback to identify the request.
upscale
string
default:"no"
Set to yes to upscale the generated image 2x.
clip_skip
integer
Clip skip value. Range: 1–8.
base64
string
default:"no"
Return response as base64. You can also pass init_image, mask_image, and control_image as base64. Default: no.
temp
string
default:"no"
Generate a temporary image link valid for 24 hours. Default: no.