In this blog post, we will introduce the Dreambooth training and image generation API recently added to AI Painter. These API are available for developers looking to incorporate AI-powered image generation into their own applications.
The API documentation can be accessed by visiting the AI Painter website and clicking on the API link. This will open up the documentation page, which contains information on the different API available. There are two main categories of API: those related to training Dreambooth models and those related to generating images.
The Dreambooth model create API is used to start a Dreambooth training job. The request type is multipart form data, which sends request parameters and uploads an image zip file. The API takes the following parameters:
- Job Name: a unique name to identify the training job. This will not be used in the training process.
- Class Name: the category name of the object being trained on (e.g. "woman" or "water bottle").
Object Identifier: a non-dictionary word used to match the object in training images (e.g. "sks" or "tst").
- Training Steps: the number of training steps to run. A good rule of thumb is to have 100 times the number of training images. For example, if you have 30 training images, you should have 3000 training steps.
- Images: a zip file containing JPEG or PNG images of size 512x512 pixels.
After the post request is made, the response will return a job id that can be used to track the progress of the Dreambooth training job. In case of an error, you will receive a JSON response with a 400 or 500 status code.
The Dreambooth status API can be used to check the status of the training job. It will return all the training parameters along with the status. If the status is "completed", it will also have values for the model id and model url. The model id can be used to trigger an image generation job, and the model url can be used to download the model checkpoint file if needed.
The generate images API is used to generate images using a trained Dreambooth model. Once the job is submitted, a job id will be returned in the response that can be used to monitor the job using the GET generate images API. The API requires the following fields:
- Model id: the id of the trained model.
- Number of images: the number of images to generate (up to a maximum of 100 images per request).
- Image size: the size of the generated images (default is 512x512 pixels, but portrait and landscape options are also available).
- Prompt: the prompt to be used to generate images (should include an object identifier phrase).
- Negative prompt: words to be avoided in generated images.
After submission, an image creation job will start in the background. In case of an error, you will receive a JSON response with a 400 or 500 status code.
The GET generate images job status API can be used to check the status of a generate images job. The request contains the job id of the triggered job, and the response will contain the job parameters passed in the request as well as the job status. If the job status is "completed", the response will also contain the generated images.
In this blog post, we have introduced the Dreambooth training and image generation API available on AI Painter. These API provide developers with the tools to incorporate AI-powered image generation into their own applications. For more information, please visit the AI Painter website and
Al Paintr © 2023
all rights reserved per federal & CA laws
License and Credits: