Is it possible to train SD modes with Dreambooth in Sagemaker HuggingFace estimators?
I want to train Stable Diffusion models on Sagemaker with Dreambooth. How should I do it?
2023-02-02T17:30:42Z
Hi Santiago - yes that is possibleYou can convertHugging Face’s dreambooth training scriptinto a training script that runs on SageMaker. Then you can just create a regular HF estimator and run it (you need to make sure to include all the required packages in a requirements.txt file).My requirements.txt file istransformers==4.25.1
diffusers[torch]
bitsandbytesA few things to watch out for when converting the original script into a script that runs on SageMaker:You will have to store your images on S3 and implement a mechanism within the training script to retrieve the images from S3 (instead from a local folderSageMaker doesn’t support argparse actions, so will you have to rewrite that part of the training scriptIf you use prior class preservation and textencoder finetuning then you will have to use a g5 instance (with 24 GB VRAM)If you want to keep & reuse the generated class images, you will have to implement some S3 logic to store those and read themCheersHeiko