ControlNet
Control your DreamBooth Model
What is ControlNet?
ControlNet is a generative model with the ability to create images conditioned on more constraints than was possible before.
Previously, DreamBooth and Stable Diffusion models would be able to generate images given a text prompt. But what if you wanted a very specific image for a given prompt? For instance, for the prompt a lighthouse in the sea
, you wanted to the lighthouse to be in the top right of the screen, with a certain height to it?
With previous image generation models, there was no way to control the outputs other than through the text prompt.
With ControlNet, you’ll be able to pass in a text prompt, and an image that you want the output to look like.
For instance, for the text prompt bird
you’ll be able to pass in an outline of the bird you want, like this:
and you should get images like this as the output:
If you want to check out a cool usage of ControlNet: you can try it here: https://scribblediffusion.com
Training with a sample dataset
Checkpoints are saved to ~/ControlNet/lightning_logs/version_0/checkpoints
in the container.
To access it:
Dataset Format
In order to train ControlNet, the dataset folder needs to be structured in a specific way.
The model creators have created a sample dataset called fill50k
which is shown above. You can replicate that folder structure as shown here:
prompt.json
is a json file that indicates to the model how source files should map to target files.
Important: This file should include each entry as a single line and it should not be properly formatted as a JSON . Here are the first three lines of the sample file: