Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds ControlNet to the diffusion repo for both SDXL and SD2 style models.
Some of the highlights of the work here:
Custom callback to handle initializing a ControlNet from a Composer UNet Checkpoint:
Sample Workflow:
a. We train a custom SDXL style model, with a checkpoint of UNet, VAE, text encoder.
b. We want to initialize a ControlNet from this Composer checkpoint
c. Challenge: FSDP wrapping happens before the checkpoint is loaded, meaning that we will get NaNs if we load directly
d. Solution: Need to all gather the weights before restoring the checkpoint and duplicating weights
Class that handles both ControlNet style generation and forward (training passes) -- for both the forward and the generate, this involves generating the control image and feeding directly into the UNet.
Model classes for the two architectures that support loading directly from YAML files.
To-dos:
Show inference outputs here + add comments