Skip to main content
POST
/
load_model
curl --request POST \
--url https://modelslab.com/api/v3/load_model \
--header 'Content-Type: application/json' \
--data '{
"key": "api_key",
"url": "https://civitai.com/api/download/models/132760?type=Model&format=SafeTensor&size=pruned&fp=fp16",
"revision": "fp32",
"model_id": "stable-diffusion-1.0-inpainting-0.1",
"force_load": "yes",
"model_category": "stable_diffusion_xl",
"model_format": "safetensors",
"model_visibility": "public",
"model_name": "stable-diffusion-1.0-inpainting-0.1",
"model_image": "https://cdn2.stablediffusionapi.com/generations/1a14cab3-cc79-4cee-ab28-29379bff766b-0.png",
"hf_upload": "no"
}'
{
  "status": "success",
  "message": "model load started"
}

Request

Send a POST request to below endpoint.
curl
--request POST 'https://modelslab.com/api/v3/load_model' \

Load a ckpt or safetensors Model from Civitai

json
{   
  "key": "your_api_key",    
  "url": "https://civitai.com/api/download/models/132760?type=Model&format=SafeTensor&size=pruned&fp=fp16",    
  "revision": "fp32",    
  "model_id": "stable-diffusion-1.0-inpainting-0.1",    
  "force_load": "yes",     
  "model_category": "stable_diffusion_xl",    
  "model_format": "safetensors",    
  "model_visibility": "public",    
  "model_name": "stable-diffusion-1.0-inpainting-0.1",    
  "model_image": "https://assets.modelslab.com/generations/95aebdb1-302f-42c4-b461-64b6ce9214e4",    
  "hf_upload": "no"
}

Load a diffusers model

json
{    
  "key": "your_api_key",    
  "url": "diffusers/stable-diffusion-xl-1.0-inpainting-0.1",    
  "model_id": "stable-diffusion-xl-1.0-inpainting-0.1",    
  "force_load": "yes",     
  "revision": "fp16",    
  "model_category": "stable_diffusion_xl",    
  "model_format": "diffusers",    
  "model_visibility": "public",    
  "model_name": "stable-diffusion-xl-1.0-inpainting-0.1",    
  "model_image": "https://assets.modelslab.com/generations/95aebdb1-302f-42c4-b461-64b6ce9214e4",    
  "hf_upload": "no"
}

Body

application/json
key
string
required

Your API Key used for request authorization

url
string
required

The URL of the Huggingface model, CKPT download link, or Safetensors model

model_id
string
required

Choose a name (ID) for your model. The loaded model will be saved under this ID

model_format
enum<string>
required

Available options are "diffusers", "safetensors", or "ckpt"

Available options:
diffusers,
safetensors,
ckpt
model_category
enum<string>
required

The category of the model you want to upload

Available options:
stable_diffusion,
stable_diffusion_xl,
controlnet,
lora,
embeddings,
flux_lora,
flux_embeddings,
flux_checkpoint
model_visibility
enum<string>
default:public
required

It accepts "private" or "public"

Available options:
private,
public
model_name
string
required

The name you want to give your model

force_load
enum<string>
default:yes

Set this to "yes" if you want to reload automatically once upload fails; otherwise pass "no"

Available options:
yes,
no
revision
enum<string>
default:fp16

Specify whether the loaded model is "fp16" or "fp32"

Available options:
fp16,
fp32
model_image
string<uri>

A valid image URL to display the model when uploaded

hf_upload
enum<string>
default:no

It accepts "yes" or "no"

Available options:
yes,
no

Response

Model load started successfully

status
string
Example:

"success"

message
string
Example:

"model load started"

I