CivArchive
    LoRA Lazy DAdaptation Guide - DAdaptation BA
    NSFW
    Preview 930763

    Imported into Civitai from https://rentry.org/LazyDAdaptationGuide

    This guide is a repository for testing and tweaking DAdaptation V3 LoRAs, introduced by Kohya on 05/25/2023 .

    For reference to my guide on collating a dataset, and the old method of utilizing the

    AdamW8Bit optimizer, see - https://rentry.org/lazytrainingguide

    Useful links:

    Kohya - https://github.com/kohya-ss/sd-scripts


    bmaltais
    training GUI (Dreambooth localhost, DADAPT V3 HAS NOW BEEN IMPLEMENTED) - https://github.com/bmaltais/kohya_ss

    With the inclusion of DADAPT V3 into bmailtais, I have provided a .json via https://files.catbox.moe/8yh7ko.json - edit your img folders, max epochs, dim/alpha, weight decay etc.

    DAdaptation is an adaptive optimizer that automatically selects and tweaks the TE/UNET/LR values as it trains.

    I have spent the past few months tweaking the older DAdaptation implementation (Assumingly 1.5) via the derriandestro repo. With the release of V3 and other versions of the DAdaptation optimizer, I firmly believe that this is the best optimizer to use and oust AdamW8Bit as the default optimizer.

    Here is an example of the shift in learning rates between DAdapt V2 (green) and DAdapt V3 (blue) - in general, it's less heavy in blasting out a higher learning rate and cooking the image faster, meaning we can keep the weight decay lower than previously practiced:

    DAdaptation removes the need for setting restarts, setting learning rates, text encoders, unet learning rates etc. Simply put, you can flick a switch and it will generate your LoRA with minimal effort.

    DAdapt can be used for all LoRAs. Characters, concepts, artist, style etc.

    DAdapt needs a higher 'weight decay' value, as expressed in the research data and the LoRA results. This is the primary method for tweaking your LoRA. Is your LoRA not learning enough before it overfits? Increase the weight decay in .1 increments. With the release of V3, it seems to blast the learning rate a lot less heavily than V1.5 or 2, and so we can usually get away with reducing the weight decay more than we used to for the previous interations of the optimizer.

    DAdapt should have the learning rate, text encoder and unet learning rate set anywhere from 0.5 to 1. This is personal preference, but I've found keeping it at '1' and tweaking the weight decay is the simplest method of fine-tuning training.

    DAdapt needs the argument --optimizer_args "decouple=True" setting along with the weight decay settings (for example): "weight_decay=0.4" "betas=0.9,0.99"
    This can be done in the Bmaltais Kohya GUI through the parameters boxes.

    Here are a few of the settings I have confirmed work well:

    Learning Rate (LR) 1

    Text Encoder (TE) 1

    UNET 1

    Weight Decay (WD) - From 0.2-1 - will require longer training to learn more, but FAR less prone to overfitting

    Repeats 1 for each data subfolder - Allows for tweaking of steps via epochs and removes the need to do math

    Resolution 512 - DAdapt is a heavier train and needs better hardware. 768 is not worth it

    Clip Skip 2 - For NAI based models

    Training Model NAI

    Scheduler Cosine - Constant is not good, and I'm not sure why it was originally recommended for DAdaptation

    Batch Size - As high as you can go for your hardware. For example, 6 for a 3060 - From my experience it's better to set this and forget it, and focus on more impactful settings for training

    Epochs - Set it as high as you want. As an example, I have tested a 36 image, 3 character LoRA. This started to burn out at around 230 epochs at weight decay 0.4 totalling around 2400 steps at batch 6 - Once again, DAdapt needs more steps to achieve results as we're actively hampering the learning through decay


    DIM32 - (or set it lower to '8' for example, increase training time/reduce weight decay)

    Alpha16 - (match the DIM if set to 8 or lower)

    Warmups - Relatively untested, but I just set it to 0.1 to give it a bit of time to calibrate (?) - set warmups to 0 if you're using the above .json and the "growth_rate=1.02\" argument

    How many training steps for my LoRA? - Final steps are divisible by your batch - for example, at batch 6, for a single character LoRA on DAdaptation I would probably expect anywhere from 600-1200 steps. Generally, training til overfitting and going back down the epochs will save needing to re-train the LoRA all over again with new settings

    Examples:

    XYZ plot starting at 100 epochs, up to 234 - 1/1/1 TE/UNET/LR, 0.4 weight decay, 0.1 warmup steps - training at batch 6 totalling around 2,400 steps

    Note that these are trained on a tiny dataset of 12 images per character with one outfit, and should not be a representation of the plability of character clothing, positions etc.

    LoRA trained on 3 characters, example tags:

    Aru - Aru, long hair, breasts, bangs, shirt, gloves, ribbon, yellow eyes, white shirt, pink hair, horns, collard shirt, red ribbon, coat, blunt bangs, fur-trimmed coat, halo

    Shiroko - Shiroko, long hair, breasts, bangs, blue eyes, animal ears, animal ear fluff, mismatched pupils, cross hair ornament, blue scarf, grey hair, halo

    Karin (Bunny) - Karin, large breasts, black hair, halo, animal ears, cleavage, hair between eyes, fake animal hears, playboy bunny, rabbit tail, yellow eyes, very long hair, dark skin

    (The final epoch version has been uploaded to this Civitai post)

    Example .safetensors -

    Final Epoch - https://files.catbox.moe/muah1o.safetensors
    200
    - https://files.catbox.moe/luvylf.safetensors
    180
    - https://files.catbox.moe/xkemzm.safetensors
    160
    - https://files.catbox.moe/ane6p6.safetensors
    140
    - https://files.catbox.moe/frshlg.safetensors
    120
    - https://files.catbox.moe/47hsmp.safetensors
    100
    - https://files.catbox.moe/qgbxs9.safetensors

    Description

    FAQ

    Comments (16)

    n_a0May 27, 2023· 1 reaction
    CivitAI

    Thanks for the interesting information!LoRA is very complicated and I am always struggling with the best settings. I will try this method tonight!

    65MDVKMay 27, 2023
    CivitAI

    Have you tested DAdaptation with mini snr gamma?

    screamlouderMay 28, 2023
    CivitAI

    I'm sorry if this is a stupid question, I'm still trying to learn more about LORAs.

    Could you explain this line:

    Scheduler - Cosine - Constant is not good, and I'm not sure why it was originally recommended for DAdaptation

    I thought the idea of constant scheduler + DADAPTATION is that with an adaptive learning rate, having constant learning will allow you to train your LORA with less steps/epochs since it's learning with every step/epoch. With cosine, wont LORA be learning nothing during the period where cosine makes LR close to 0?

    Could you also explain what situations would call for a LORA vs LOCON vs LOHA? What settings should be used for each situation?

    Thank you for making such a straightforward guide! I'm giving it a try right now.

    bdsqlszMay 31, 2023· 3 reactions
    CivitAI

    thank u for testing!

    i am sdbds ,whic implement DA V3 for kohya_ss.

    i have some suggestion about optimizer_args

    for DAV3 except WD.

    new DAdaptAdam has a new optimizer_args

    called

    use_bias_correction

    it is useful and default for off

    most DAdapt have

    growth_rate

    except DAdaptLion

    it is optimizer's warmup speed

    we can just use it instead of warmup in kohya_ss

    treiceleitnerJun 13, 2023
    CivitAI

    May be a silly question, but or the settings in this guide correct? Unless I set the repeats super low, I end up with steps in the 100,000s. I also noticed that although you talk about having 200 epochs, there's a setting in the config file that sets the epochs at 50.

    VKTralalaJun 15, 2023
    CivitAI

    I usually train from 50 to 100 images, how much steps you would recomend with this method, supposing 1 repeat 1 batch size? Currently I’m using 10 repetitions per image, and usually got bad results between 6th and 7th epoch

    Other question, what is the option in Kohya GUI, to save the training state, and at the same time, to resuming training again?

    NorianJun 15, 2023
    CivitAI

    Do you think is better idea to use cosine with restarts or just stay with cosine? I didn't know adaptation also regulates the restarts that's interesting. I also haven't used the data from the graph loss and I think I need learn that, is that generated at the end of every epoch?

    sp00nsJun 23, 2023
    CivitAI

    Thanks for the guide. How do I work out the total steps? I thought it was something like: images x repeats x epochs / batch size, but for some reason, the total steps is always different from the ones I calculate.

    For example, I have 37 images, 1 repeat, 200 epochs (saving every 10 epochs) and 6 batch size should be 1,233~, but in the console, it says it's 2400 and is going to take over 2 hours. I don't really care about the time, but I'd like to know why it's giving me a different final step count than what I calculated.

    I have --min_bucket_reso 320 --max_bucket_reso 1024 --max_train_epochs="200" in the additional parameters and "decouple=True" "betas=0.9,0.99" "use_bias_correction=True" "growth_rate=1.02" in the optimizer extra arguments

    Is this a bug or am I just missing something?

    TribalDragonJul 2, 2023
    CivitAI

    I followed the guide word by word from Rentry, even used the json save provided, and when I hit training, instead of doing 200 epochs it simply does 50 in total, and I have no idea why, console says the command I sent was for 200 and it says there will be a total of 50

    barbecue420Jul 3, 2023
    CivitAI

    What settings would you recommend for a concept lora? Around 100 images.

    MarioKartMTAJul 21, 2023
    CivitAI

    Thank you so much! This worked like magic!

    kettleSettleJul 28, 2023
    CivitAI

    hi,

    is it recommended to use this method along with regularisation images?

    Kshatriya0815Oct 25, 2023
    CivitAI

    I used the provided json on a dataset of 111 images and it now takes 16 hours… which is fine for me… but it still has 4 hours too go and sample images have been overlooked for the last couple hours. What is the best approach now? Like, if I start all over with the same dataset, what settings should I change? Thx in advance

    TomLucidorNov 8, 2023
    CivitAI

    Q: what is the fight about "Prodigy is all you need" versus DAdaptation? https://civitai.com/articles/1022/update-sdxl-scriptbdsqlsz-lora-training-advanced-tutorial2prodigy-is-all-you-need

    belladoreaiMay 3, 2024
    CivitAI

    I trained one lora (smirking facial expression) with the settings recommended in this guide, let it run for a long time and cherrypicked one of the subversions. When I compared the result with a lora trained with my usual settings (not using fancy optimizers at all) the differences were very small, and I genuinely can't say which is better. I don't think the added running time from DAdapt is worth it.

    fablegeniusDec 11, 2024
    CivitAI

    does this work for realistic face LoRA? also, i'm not sure what you mean by a "guide" since there appears only to be a list of parameters. In my experience, if i input any parameter into kohya it 99% of the time going to result in a non-zero exit status 1 before anything gets trained. this guide is for kohya right?

    LORA
    Other

    Details

    Downloads
    1,289
    Platform
    CivitAI
    Platform Status
    Deleted
    Created
    4/24/2025
    Updated
    5/1/2026
    Deleted
    4/24/2025

    Files

    DAdapt BA Test.safetensors

    Mirrors

    CivitAI (1 mirrors)
    TensorFiles (1 mirrors)