## How to run DeRaDiff experiments

1. Firstly, align a pretrained public release of Stable Diffusion XL or Stable Diffusion 1.5 using any method that optimizes equation (2). We choose DiffusionDPO as discussed in the paper. DiffusionDPO's implementation and code can be found at https://github.com/SalesforceAIResearch/DiffusionDPO

2. Next, for metric/task testing (e.g., on PickScore, CLIP, HPS), launch the `DeRaDiff_SD15_launch.sh` or `DeRaDiff_SDXL_launch.sh` files. Please do remember change the output filenames according to your working directory.

3. Next, run `DeRaDiff_SD15_launch.sh` or `DeRaDiff_SDXL_launch.sh` respectively according to which model is being used in order to get the true metric values from a model that has been aligned from scratch. This can be used to compare with the results from step 2.

Note: you may also save the images to view them afterwards.

## How to run DeRaDiff + Bayesian Optimization

1. Alternatively, you may also run the `DeRaDiff_with_BayesianOptimization.py` file in order to automatically find the best (range of) regularization strengths using DeRaDiff and Bayesian Optimization.
