This API is built using FastAPI and is designed to integrate with DreamBooth's AI models. It provides various endpoints for model training, running models, and querying their status.
- Install FastAPI and other dependencies.
- Set your
REPLICATE_TOKEN
andWEBHOOK_URL
as env variables. - Optionally set DOCS_PASSWORD and DOCS_USERNAME for the fastapi docs page.
- DD_AGENT_HOST, DD_TRACE_AGENT_PORT and DATADOG_SERVICE_NAME to configure datadog.
- Set API_KEY to change api key for the endpoints.
Train a model by providing instance and class prompts, the maximum number of training steps, the model version, and the trainer version.
instance_prompt
(str)class_prompt
(str)max_train_steps
(int)model
(str)trainer_version
(str)file
(UploadFile) - Zip file for training data
Run an already trained model.
RunInput
- The input parameters to run the model. It is a Pydantic model.version
(str) - The version of the model to run.
Get the prediction result from a given URL.
url
(str) - The URL to fetch the prediction from.
Get the current status of a training operation using its training ID.
training_id
(str) - ID of the training operation
This endpoint receives payload data related to model training.
POST /train_model/
POST /run_model/
GET /get_prediction/
GET /get_training_status/{training_id}/
POST /webhook/
- FastAPI
- DreamBoothAPI
- pydantic