|
2 | 2 |
|
3 | 3 | ## Step One: Launch a Lambda Cloud instance
|
4 | 4 |
|
| 5 | +The hands-on practice requires a Lambda Cloud account and a `1xA100` GPU instance, which costs `$1.10 USD/h`. |
| 6 | + |
| 7 | +Remember to drop by our photo booth if you do not wish to sign up. Our staff will take photos and train a model for you. Leave us your email address, and we will send the results within 12 hours. |
| 8 | + |
| 9 | +If you wish to sign up, go to [https://cloud.lambdalabs.com/](https://cloud.lambdalabs.com/) and follow the signup step. |
| 10 | + |
| 11 | +Once signed in with your Lambda Cloud account, click the `Launch Instance` button. |
| 12 | + |
| 13 | +<img src="./images/lambda_cloud_dashboard.jpg" alt="drawing" style="width:480px;"/> |
| 14 | + |
| 15 | +Lambda Cloud will ask you for payment information when launching the first instance. Just follow the instructions and be aware that Lambda Cloud will place a __temporary__ `$10 USD pre-auth to verify your card, which will disappear within seven days. Once payment information is provided, you can launch an instance. For this workshop: |
| 16 | +* Choose 1xA100 instance (40GB SXM4 or 40GB PCIe are both fine). |
| 17 | +* Any region will work. |
| 18 | +* Don't need to attach a filesystem. |
| 19 | +* Follow the guide to add or generate an SSH key -- this step can not be skipped. However, this workshop won't use this key because all practice can be accomplished in the Cloud IDE (so no SSH session is needed). |
| 20 | + |
| 21 | +It takes about two mins to get the instance running (the green tick as shown in the picture below). |
| 22 | + |
| 23 | +<img src="./images/lambda_cloud_dashboard_instance_ready.jpg" alt="drawing" style="width:480px;"/> |
| 24 | + |
| 25 | +You need to click the Cloud IDE `Launch` button (the purple button on the right end) to get access to the Jupyter Hub. If you see a message saying, "Your Jupyter Notebook is down," that means the Jupyter Hub isn't ready and please give it another minute or so. Eventually, it will look like this once it is ready: |
| 26 | + |
| 27 | +<img src="./images/lambda_cloud_jupyter_hub.jpg" alt="drawing" style="width:480px;"/> |
5 | 28 |
|
6 |
| -## Step Two: Download Notebooks |
7 | 29 |
|
8 |
| -In dash board, click `Cloud IDE` - `Launch`, this will bring you to the Jupyter hub pre-installed on the cloud instance. |
9 | 30 |
|
10 |
| -Create a new `Terminal` by clicking the `Terminal` button. In the terminal, run these two commands: |
| 31 | + |
| 32 | +## Step Two: Download Notebooks |
| 33 | + |
| 34 | +Create a terminal by clicking the `Terminal` icon, and run the following command in the terminal to download a few notebooks to your home directory. |
11 | 35 |
|
12 | 36 | ```
|
13 | 37 | wget https://raw.githubusercontent.com/LambdaLabsML/dreambooth/neurips/setup.ipynb && \
|
14 | 38 | wget https://raw.githubusercontent.com/LambdaLabsML/dreambooth/neurips/train.ipynb && \
|
15 |
| -wget https://raw.githubusercontent.com/LambdaLabsML/dreambooth/neurips/test.ipynb && \ |
| 39 | +wget https://raw.githubusercontent.com/LambdaLabsML/dreambooth/neurips/test_param.ipynb && \ |
16 | 40 | wget https://raw.githubusercontent.com/LambdaLabsML/dreambooth/neurips/test_prompt.ipynb
|
17 | 41 | ```
|
18 | 42 |
|
19 |
| -Click the refresh button in the `File Browser` (on the left side of the IDE), you should see `setup.ipynb`, `train.ipynb` and `test.ipynb`. |
| 43 | +You need to click the refresh button in the `File Browser` (on the left side of the IDE) to see the notebooks. |
20 | 44 |
|
21 |
| -## Step Three: Run Notebook |
| 45 | +<img src="./images/lambda_cloud_dashboard_download_ipynb.jpg" alt="drawing" style="width:480px;"/> |
22 | 46 |
|
23 |
| -### Run `setup.ipynb` |
| 47 | +Now you are ready to kick off the DreamBooth practice! |
24 | 48 |
|
25 |
| -This notebook will clone the DreamBooth repo, install a number of python packages needed for this pratice. |
| 49 | +## Step Three: Run Notebook |
26 | 50 |
|
27 |
| -It will create a folder at `/home/ubuntu/data` for you to upload the training photos. |
| 51 | +### Run `setup.ipynb` |
28 | 52 |
|
29 |
| -The last step in thie notebook will ask for a access token for downloading the Stable Diffusion model from Huggingface. You need to |
| 53 | +This notebook will clone the DreamBooth repo and install several python packages. It will also create several folders in the home directory: |
| 54 | +* `/home/ubuntu/data`: This directory stores training photos. |
| 55 | +* `/home/ubuntu/model`: This is the directory where the trained model will be saved. |
| 56 | +* `/home/ubuntu/output`: This is the directory where the sampled images will be saved. |
30 | 57 |
|
| 58 | +The last step in this notebook will ask for an access token for downloading the Stable Diffusion model from Huggingface. You need to: |
31 | 59 | * Create a [huggingface](https://huggingface.co/) account if you don't have one.
|
32 |
| -* Create your access token from "Settings - Access Tokens - New Token", and paste the token into the login field at the end of the notebook (see image below). |
| 60 | +* Create your access token from "Settings - Access Tokens - New Token," and paste the token into the login field at the end of the notebook (see image below). |
33 | 61 | <img src="./images/hf_token.jpg" alt="drawing" style="width:480px;"/>
|
34 | 62 | * Accept the [license of Stable Diffusion v1-4 Model Card](https://huggingface.co/CompVis/stable-diffusion-v1-4) if you agree. (Otherwise can't use the model)
|
35 | 63 | <img src="./images/hf_model_card.jpg" alt="drawing" style="width:480px;"/>
|
36 | 64 |
|
| 65 | +### Upload Images |
| 66 | + |
| 67 | +We recommend preparing ~20 photos: ten close-ups of your face with various poses and facial expressions, five photos from your chest and up, and a few full-body shots. |
| 68 | + |
37 | 69 | ### Run `train.ipynb`
|
38 |
| -This notebook will train a DreamBooth model using the images you just uploaded. |
| 70 | +This notebook trains a DreamBooth model use the images inside of `/home/ubuntu/data`. |
39 | 71 |
|
40 |
| -Once trained, it will run some validations using the prompts in the `test_dreambooth.py` script. |
| 72 | +Once trained, it will also run a few inferences and display the prompts and sampled images at the end of the notebook. |
41 | 73 |
|
42 | 74 | ### Run `test_prompt.ipynb` and `test.ipynb`
|
43 |
| -You can use these notebook to play with the model you just trained. |
| 75 | +You can use these notebooks to play with the model you just trained. |
| 76 | + |
| 77 | +* `test_prompt.ipynb`: A notebook for prompt engineering. You will use fixed latent input to conduct controlled experiments for the impact of prompt engineering on the model output. |
44 | 78 |
|
45 |
| -## Q&A |
| 79 | +* `test_param.ipynb`: A notebook for trying different parameters for inference. Again, you will use fixed latent input to conduct controlled experiments for the impact of these parameters on the model output. |
0 commit comments