Custom Dreambooth
To deploy the model, you can use the identifier below:
- Dreambooth:
dreambooth
At the moment, we only support custom Dreambooth models that are hosted on Hugging Face. If you need help on how to train and deploy your model, you can read our blog post here. Once you’ve deployed a custom Dreambooth model, you can follow this example of how to call the deployed endpoint:
Request Parameters
curl --location --request POST 'https://run.cerebrium.ai/dreambooth-webhook/predict' \
--header 'Authorization: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "a photo of an astronaut riding a horse on mars.",
"hf_token": "<your_token>",
"hf_model_path": "<your_id>",
"height": 512,
"width": 512,
"num_inference_steps": 50,
"guidance_scale": 7.5,
"num_images_per_prompt": 1,
"negative_prompt": "",
"seed": 120,
"webhook_endpoint": "https://your-url.com"
}'
This is the Cerebrium API key used to authenticate your request. You can get it from your Cerebrium dashboard.
The prompt you would like your Dreambooth model to generate.
This is the token from your HuggingFace profile to access your model repo. This is a required parameter if you model is privately hosted on Hugging face.
This is the Hugging Face id of your model repo. This is a required parameter.
The height of the generated image which defaults to 512px. This is an optional parameter
The width of the generated image which defaults to 512px. This is an optional parameter
The number of steps you would like Dreambooth to take to generate the image. In general, the results are better the more steps you use, however the more steps, the longer the generation takes. It defaults to 50 steps and is an optional parameter.
A way to increase the adherence to the conditional signal that guides the generation (text, in this case) as well as overall sample quality. In simple terms it forces the generation to better match the prompt potentially at the cost of image quality or diversity. This defaults to 7.5 and is an optional parameter.
The number of image variations you would like the model to generate. This is an optional parameter which defaults to 1.
The negative prompt is a parameter that tells Stable Diffusion what you don’t want to see in the generated images. This is an optional parameter that has an empty default value.
Make sure that generations are the exact same for the same prompts
The url endpoint you would like us to send the image results to once it has finished generating
{
"run_id": "<UUID_STRING>",
"message": "Successfully generated image",
"result": [<BASE_64_STRING>]
}
Response Parameters
A unique identifier for the run that you can use to associate prompts with webhook endpoints.
Whether of not the response was successful
An array of base64 encoded strings of the image that you can convert into an image
curl --location --request POST 'https://run.cerebrium.ai/dreambooth-webhook/predict' \
--header 'Authorization: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "a photo of an astronaut riding a horse on mars.",
"hf_token": "<your_token>",
"hf_model_path": "<your_id>",
"height": 512,
"width": 512,
"num_inference_steps": 50,
"guidance_scale": 7.5,
"num_images_per_prompt": 1,
"negative_prompt": "",
"seed": 120,
"webhook_endpoint": "https://your-url.com"
}'
{
"run_id": "<UUID_STRING>",
"message": "Successfully generated image",
"result": [<BASE_64_STRING>]
}