🔥🔥 StyelGAN-NADA + WandB Playground 🪄🐝
Original Implementation: https://github.com/rinongal/StyleGAN-nada
Step 1: Setup required libraries and models.
This may take a few minutes.
You may optionally enable downloads with pydrive in order to authenticate and avoid drive download limits when fetching pre-trained ReStyle and StyleGAN2 models.
Installing Requirements
Step 2: Choose a model type.
Model will be downloaded and converted to a pytorch compatible version.
Re-runs of the cell with the same model will re-use the previously downloaded version.
Defining the Configs for Selecting the Model
Initializing WandB
Fetching Models from WandB Artifacts
Step 3: Train the model.
Describe your source and target class. These describe the direction of change you're trying to apply (e.g. "photo" to "sketch", "dog" to "the joker" or "dog" to "avocado dog").
Alternatively, upload a directory with a small (~3) set of target style images (there is no need to preprocess them in any way) and set style_image_dir to point at them. This will use the images as a target rather than the source/class texts.
We reccomend leaving the 'improve shape' button unticked at first, as it will lead to an increase in running times and is often not needed. For more drastic changes, turn it on and increase the number of iterations.
As a rule of thumb:
- Style and minor domain changes ('photo' -> 'sketch') require ~200-400 iterations.
- Identity changes ('person' -> 'taylor swift') require ~150-200 iterations.
- Simple in-domain changes ('face' -> 'smiling face') may require as few as 50.
- The
style_image_diroption often requires ~400-600 iterations.
Step 4: Generate samples with the new model
Editing a real image with Re-Style inversion (currently only FFHQ inversion is supported):
Step 1: Fetch ReStyle Models from WandB Artifacts
This may take a few minutes
Step 2: Choose a re-style model
We reccomend choosing the e4e model as it performs better under domain translations. Choose pSp for better reconstructions on minor domain changes (typically those that require less than 150 training steps).