This solution enables you to inject any object into an existing image generation model like Stable Diffusion using a few example images. It can also be used for teaching artistic styles (e.g., company branding photography).
Azure Machine Learning facilitates advanced Generative AI use cases with its robust resources and efficient experiment management capabilities.
- Powerful GPU clusters enable multiple resource-intensive fine-tuning runs concurrently.
- Azure ML provides a framework to manage all associated artifacts, including image datasets, environments, and the resulting models, in a systematic and repeatable manner.
- The platform's experiment management feature allows maintaining control over numerous training runs, while effectively tracking hyperparameters and results
An Azure subscription is needed to use this example.
We are using an Azure Machine Learning Workspace for managing finetuning jobs on scalable GPU resources.
-
You need an Azure Subscription ID and permissions for creating your own Resource Group
-
If you don't have an Azure subscription, check out these options.
Click here to use the Azure Cloud Shell to execute the following steps:
1. Create a resource group named gencv in the West Europe region. Feel free to adjust name and region according to your preferences:
az group create -l westeurope -n gencv
Use this example to create a Workspace with name gencv-workspace. It will use the resource group region:
az ml workspace create -g gencv -n gencv-workspace
There are several options to run the solution:
- On your local computer or cloud
- GitHub Codespaces compute
- Azure Machine Learning Compute Instance
For creating a Compute Instance, use the Azure ML Studio and navigate to the Compute tab of the Workspace you have created in the previous step. Click the + New button to select your desired configuration:
For managing the training jobs, a Standard_DS12_v2
CPU Instance is sufficient. You can also create a GPU Instance (for example Standard_NC6s_v3
) if you wish to generate a high number of images with your fine-tuned model later.
Navigate to the Dreambooth finetuning notebook and follow the included instructions.
az group delete -n gencv
[1] Patrick von Platen, Suraj Patil, Anton Lozhkov, Pedro Cuenca, Nathan Lambert, Kashif Rasul, Mishig Davaadorj, Thomas Wolf. (2022). Diffusers: State-of-the-art diffusion models. GitHub. Available at: https://github.com/huggingface/diffusers
We have reused the dreambooth dreambooth.py
training script with minor adjustments.