Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 . Finetuning with LoRA adapters on custom dataset . LoRA adapters can be applied for finetuning large diffusion models, trained on diverse mix of
Finetuning with LoRA adapters on custom dataset
LoRA adapters can be applied for finetuning large diffusion models, trained on diverse mix of data to improve image generation quality or textimage alignment on a specific domain.
Your task is to take pretrained Stable Diffusion model or any other model at your preference and finetune in on one of the two tasks listed below:
lambdalabsnarutoblipcaptions
Your notebook should contain the entire dataset preprocessing and training pipeline.
You may use any functionality from the diffusers, datasets, transformers, peft and accelerate libraries. You may adopt pieces of code, but not the entire trainingscript.
Use of the models hosted on the hub and trained on this dataset is strictly prohibited!
Data loading and visualization
Load the dataset and visualize some samples from it How many samples are there? Split the dataset into traintest set in proportion at random. Fix all seeds to torch numpy, random
LoRA preparation
Define LoRA config using the peft library. Which layers can you apply LoRA to
Training
Train the model and save the adapter of the final model. Since there is no reasonable quantative metric for the quality of images, visualize samples generated on the prompts from the holdout set.
LoRA ablation
Experiment with different ranks of LoRA adapters. How does the quality aligment to the target domain depend on the rank of adapter? Try options for LoRA rank that yield noticeable difference in performance. Apply LoRA to different layers. What layers are better for LoRA application?
Impact of CFG scale
For a single model and a prompts generate images with different classifierfree guidance scale from to some large value, like What do you observe?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started