Tensor.Art
Create

LoRA Training for CivitAI

LORA
Original


Updated:

563

Firstly, I use CivitAI to train all my LoRAs because I'm a sucker for ease of use. For a one-off character, you only need 15-20 images of that character. Upload them to the trainer, caption the images; this informs the AI trainer about the image content and serves as trigger words when using the LoRA. Some argue captions are unnecessary, but I disagree—I tried one last night without them, and it was subpar.

Next, choose the model you want to train on: SD1.5 or SDXL. After that, go to advanced settings, aiming for 70-100 steps per image, indicating how many times the training program looks at the image to understand it. The crucial settings to adjust are epochs, repeats, and batch size; I don't typically change anything else. For instance, with 10 epochs, 20 repeats, and a batch size of 2, you achieve 100 steps for each image. For smaller LoRAs, I tick flipAugmentation, flipping images during training to provide a different perspective, essentially doubling the effective number of images.

For styles like Roman Lands or 2D Comic books, you'll need more images, typically between 90-160 for larger LoRAs. I usually copy and paste my text prompt for each image in the LoRA. Some prefer short and sweet captions, like in my Cyberpunk Fashion LoRA, where the descriptions serve as captions for training. I include two different images of the same scenery in each LoRA piece.

Consistency in images can be challenging. I often create a text prompt I like, ask ChatGPT to generate 10 prompts based on it, maintaining the same style and length for consistency. Another fun approach is finding the best hashtags of the subject you what to train and and using them as your descriptives in your text prompt with just changing the first line in the text prompt, possibly asking ChatGPT for opposite or negative hashtags for your negative prompts.

Here are the settings I used for 93 images on Civitai yesterday:

"unetLR": 0.0005, "clipSkip": 1, "loraType": "lora", "keepTokens": 0, "networkDim": 32, "numRepeats": 20, "resolution": 1024, "lrScheduler": "cosine_with_restarts", "minSnrGamma": 5, "targetSteps": 9400, "enableBucket": true, "networkAlpha": 16, "optimizerArgs": "weight_decay=0.1", "optimizerType": "AdamW8Bit", "textEncoderLR": 0.00005, "maxTrainEpochs": 10, "shuffleCaption": false, "trainBatchSize": 2, "flipAugmentation": true, "lrSchedulerNumCycles": 3.

I find genral rule is to have 75-100 steps per image and never had a problem with it. If you do 10 epochs, 20 repeats and a batch size of 2 = 100 steps for each image. Some times I will up the Epochs and lower the repeats if I have a lower image dataset seems to work well, and if you have caption them all the same make sure to have caption shuffle on.

Last Note is I don't publish my LoRA's to Civitai, becuase of problems in the past, when it's finished training I click on it and it has down on the top right of the last Epoch and I just downlaod the finshed file and upload it here. I just close the page after the download starts.

Version Detail

SDXL 1.0

Project Permissions

Reprinting is strictly prohibited

    Use Permissions

  • Use in TENSOR Online

  • As a online training base model on TENSOR

  • Use without crediting me

  • Share merges of this model

  • Use different permissions on merges

    Commercial Use

  • Sell generated images

  • Use on generation services

  • Sell this model or merges

Comments

Related Posts

Describe the image you want to generate, then press Enter to send.