2. Finetunes

It's now time to create a finetuned version of Stable Diffusion, trained on your input batch. Use the POST request to add your model to the training queue, and the GET request to check on the state of the training whenever.

POST /finetunes

Request

Your request must be encoded as application/json.

{ "input_batch_id": "65c82e92-eed9-462b-829d-5807aadda53f", "subject": "man", "on_complete_webhook": "https://webhooks.myapp.com/ping", "label": "dreambooth model trained on my selfies", "num_train_steps": 2800 }

input_batch_id (required)

To finetune Stable Diffusion, you need to pass your input batch on which the model will train.

Make sure you've uploaded an input batch before you make a request to this endpoint.

subject

Default: 'person'. Optionally add a subject such as 'man', 'woman', 'dog', 'car', and so on... This will help steer your model towards more accurate generations. However, in most cases 'person' is suitable and if you're not a confident user of Dreambooth, then keep it set to 'person'.

on_complete_webhook

Default: null. Optionally pass an endpoint which our servers will ping once the finetune is set to state complete. We will send a POST request with this body:

{ "id": "0111c2ec-dc83-4004-8ec1-011fdcb39bb9", "state": "complete", "created_at": "2022-11-02T22:40:12.609446+00:00", "completed_at": "2022-11-02T22:57:16.173965+00:00", "label": "dreambooth model trained on my selfies" }

num_train_steps

Optionally set the number of finetuning steps. We recommend only advanced users try this parameter. If not passed, our default training settings will be used.

label

Optionally add a label to your finetune, for easier management of your models.

We recommend you resize your images to 512px x 512px before uploading. If you upload images with random sizes, then a plain crop will be used to resize them, and the results may be disappointing.

Response

{ "id": "0111c2ec-dc83-4004-8ec1-011fdcb39bb9", "label": "dreambooth model trained on my selfies", "state": "queue", "created_at": "2022-11-02T22:40:12.609446+00:00", "completed_at": null }

GET /finetunes/{finetune_id}

Response

{ "id": "0111c2ec-dc83-4004-8ec1-011fdcb39bb9", "label": "dreambooth model trained on my selfies", "state": "complete", "created_at": "2022-11-02T22:40:12.609446+00:00", "completed_at": "2022-11-02T22:57:16.173965+00:00", "subject": "man", "input_batch_id": "65c82e92-eed9-462b-829d-5807aadda53f", "on_complete_webhook": "https://webhooks.myapp.com/ping-on-finetune-complete" }