Train model on your own images

You can train dreambooth model using your own images. You can train on any object or person.


--request POST 'https://stablediffusionapi.com/api/v3/fine_tune' \

Make a POST request to https://stablediffusionapi.com/api/v3/fine_tune endpoint while passing appropriate request body. Below is a sample of the request body

Now you can train model on any other models as base model and get its style, you can choose to train on models like midjourney , portraitplus and more. you can get base_model_id from Here. You can also read our blog post about it

key : Your API Key
instance_prompt: how you want to call trained object
class_prompt: class without prompt
base_model_id: base model id to train model on, get base_model_id from here
images: make sure images are direct links, cropped in 512x512 : keep it about 7-8 images
learning_rate_unet: learning rate for unet model : keep it null for default "1e-6"
learning_rate_text_encoder: learning rate for text encoder model : keep it null for default "1e-6"

Learning Rate Values
["1e-5", "1e-6", "1e-7", "1e-8", "1e-9", "1e-10", "2e-0", "2e-1", "2e-2", "2e-3", "2e-4", "2e-5", "2e-6", "2e-7", "2e-8", "2e-9", "2e-10", "3e-0", "3e-1", "3e-2", "3e-3", "3e-4", "3e-5", "3e-6", "3e-7", "3e-8", "3e-9", "3e-10", "4e-0", "4e-1", "4e-2", "4e-3", "4e-4", "4e-5", "4e-6", "4e-7", "4e-8", "4e-9", "4e-10", "5e-0", "5e-1", "5e-2", "5e-3", "5e-4", "5e-5", "5e-6", "5e-7", "5e-8", "5e-9", "5e-10", "6e-0", "6e-1", "6e-2", "6e-3", "6e-4", "6e-5", "6e-6", "6e-7", "6e-8", "6e-9", "6e-10"]

training_type: type of object you are training on:

Training Types
{
 "men": "to train on faces of men",
 "female": "to train on faces of female",
 "couple" : "to train on couple of male and female | in images array, pass couple images instead of single person",
 "null" : "to train on object or anything",
}

max_train_steps: keep it 2X number of images: Max: 2000
webhook: get post call when training is completed

Webhook Post Json
{
 "status": "success",
 "training_status": "deploying_gpu",
 "logs" : "it will take upto 25 minutes",
 "model_id" : "F5jvdzGnYi",
}

here are all training status
'deploying_gpu' => 'Deploying GPU'
'training_started' => 'Training Started'
'training_success' => 'Training Success'
'trained_model_compressing' => 'Trained model compressing'
'trained_model_uploading' => 'Trained Model Uploading'
'trained_model_uploaded' => 'Trained Model Uploaded'
'deploying_model' => 'Deploying Model'
'model_ready' => 'Model Ready for use'

Request Body and Example Response

Body Raw
{
 "key": "",
 "instance_prompt": "photo of adhik person",
 "class_prompt" : "photo of person",
 "base_model_id" : "portraitplus-diffusion",
 "images": [
     "https://stablediffusionapi.com/storage/avatars/AdhikJoshi_00001.png",
     "https://stablediffusionapi.com/storage/avatars/AdhikJoshi_00002.png",
     "https://stablediffusionapi.com/storage/avatars/AdhikJoshi_00003.png",
     "https://stablediffusionapi.com/storage/avatars/AdhikJoshi_00004.png",
     "https://stablediffusionapi.com/storage/avatars/AdhikJoshi_00005.png",
     "https://stablediffusionapi.com/storage/avatars/AdhikJoshi_00006.png",
     "https://stablediffusionapi.com/storage/avatars/AdhikJoshi_00007.png"
 ],
 "seed": "0",
 "training_type": "men",
 "max_train_steps": "2000",
 "webhook": ""
}

Example Response
{
"status": "success",
"messege": "deploying_gpu",
"data": "it will take upto 25 minutes.",
"training_id": "F5jvdzGnYi"
}