Kohaku-XL Epsilon

CHECKPOINT
Original


Updated:

6.3K

<h1 id="heading-3966"><strong>Kohaku XL εpsilon</strong></h1><p><strong><em>The best example of tuning t2i model at home with consumer-level hardware</em></strong></p><p></p><h2 id="heading-3967">join us: <a target="_blank" rel="ugc" href="https://discord.gg/tPBsKDyRR5">https://discord.gg/tPBsKDyRR5</a></h2><p></p><p><img src="https://image.civitai.work/xG1nkqKTMzGDvpLrqFT7WA/3161b32e-1f78-456e-9ce3-b8b4726a8f86/width=525/3161b32e-1f78-456e-9ce3-b8b4726a8f86.jpeg" /></p><h2 id="heading-3968"><strong>Introduction</strong></h2><p>Kohaku XL Epsilon, the fifth major iteration in the Kohaku XL series, features a 5.2 million images dataset, LyCORIS fine-tuning[1], trained on comsumer-level hardware, and is fully open-sourced.</p><p></p><h2 id="heading-3969"><strong>Benchmark</strong></h2><p>CCIP score on 3600 characters</p><p><img src="https://image.civitai.work/xG1nkqKTMzGDvpLrqFT7WA/f4978d6e-40e1-4139-a7e0-28555fb59817/width=525/f4978d6e-40e1-4139-a7e0-28555fb59817.jpeg" />(0~1, higher is better)</p><p>Clearly, Kohaku XL Epsilon is way better than Kohaku XL Delta</p><p></p><h2 id="heading-3970"><strong>Usage</strong></h2><pre><code>&lt;1girl/1boy/1other/...&gt;,

&lt;character&gt;, &lt;series&gt;, &lt;artists&gt;,

&lt;general tags&gt;,

&lt;quality tags&gt;, &lt;year tags&gt;, &lt;meta tags&gt;, &lt;rating tags&gt;</code></pre><p><strong>Kohaku XL Epsilon has mastered more artists' styles then Delta. But it also increases the stablility when combining multiple artist tags together. Users are encouraged to make their own style prompts.</strong></p><p></p><p>Some good style prompts:</p><pre><code>ask \(askzy\), torino aqua, migolu, (jiu ye sang:1.1), (rumoon:0.9), (mizumi zumi:1.1)</code></pre><pre><code>ciloranko, maccha \(mochancc\), lobelia \(saclia\), migolu, ask \(askzy\), wanke, (jiu ye sang:1.1), (rumoon:0.9), (mizumi zumi:1.1)</code></pre><pre><code>shiro9jira, ciloranko, ask \(askzy\), (tianliang duohe fangdongye:0.8)</code></pre><pre><code>(azuuru:1.1), (torino aqua:1.2), (azuuru:1.1), kedama milk, fuzichoco, ask \(askzy\), chen bin, atdan, hito, mignon</code></pre><pre><code>ask \(askzy\), torino aqua, migolu</code></pre><p></p><h3 id="heading-3971"><strong>Tags</strong></h3><p>All the danbooru tags with at least 1000 popularity should work.</p><p>All the danbooru tags with at least 100 popularity can possibly work with high emphasis.</p><p>Remember to remove all the underscore in tags. (Underscores in short tags are not be removed, which are very likely part of emoji tags.)</p><p>Remember to use <code>xxx\(yyy\)</code> when tag have bracket and you are using sd-webui.</p><p></p><p><strong>Special Tags</strong></p><p>Quality tags: masterpiece, best quality, great quality, good quality, normal quality, low quality, worst quality</p><p>Rating tags: safe, sensitive, nsfw, explicit</p><p>Date tags: newest, recent, mid, early, old</p><p></p><p><strong>Quality Tags</strong></p><p>Quality tags are assigned based on the percentile rankings of the favorite count (fav_count) within each rating category to avoid bias on nsfw content (Animagine XL v3 have met this problem), organized from high to low as follows: <strong><em>90th, 75th, 60th, 45th, 30th, and 10th percentiles</em></strong>. This creates seven distinct quality levels separated by six thresholds.</p><p>I lower the threshold since I found that the average quality of images in Danbooru is higher than I expected.</p><p></p><p><strong>Rating tags</strong></p><ul><li><p>General: safe</p></li><li><p>Sensitive: sensitive</p></li><li><p>Questionable: nsfw</p></li><li><p>Explicit: nsfw, explicit</p></li></ul><p>Note: During training, content tagged as "explicit" is also considered under "nsfw" to ensure a comprehensive understanding.</p><p></p><p><strong>Date tags</strong></p><p>Date tags are based on the upload dates of the images, as the metadata does not include the actual creation dates.</p><p>The periods are categorized as follows:</p><ul><li><p>2005~2010: old</p></li><li><p>2011~2014: early</p></li><li><p>2015~2017: mid</p></li><li><p>2018~2020: recent</p></li><li><p>2021~2024: newest</p></li></ul><p></p><p><strong>Resolution</strong></p><p>This model is trained for resolutions from ARB 1024x1024 with minimum resolution 256 and maximum resolution 4096. This means you can use the standard SDXL resolution. However, opting for a slightly higher resolution than 1024x1024 is recommended. Applying a hires-fix is also suggested for better results.</p><p>For more information, please check out the sample images provided.</p><p></p><h2 id="heading-3972"><strong>How This Model Came to Be</strong></h2><h3 id="heading-3973"><strong>Why Epsilon</strong></h3><p>Same as Delta, just a test for new dataset and it is good.</p><p>The outputs are also very different (compare to Delta).</p><p></p><p><strong>Dataset</strong></p><p>The dataset for training this model was sourced from HakuBooru, comprising 5.2 million images selected from the danbooru2023 dataset.[2][3]</p><p>A selection process was employed to choose <strong><em>1 million posts from IDs 0 to 2,000,000</em></strong>, another <strong><em>2 millions from IDs 2,000,000 to 4,999,999</em></strong>, and <strong><em>all posts after ID 5,000,000</em></strong>, totaling 5.35 million posts. After filtering out deleted posts, gold account posts and those without images (which could be GIFs or MP4s), the final dataset comprised 5.2 million images.</p><p>The selection was essentially random, but a fixed seed was utilized to ensure reproducibility.</p><p></p><p><strong>Further Process</strong></p><ul><li><p>Shuffle tags: The order of general tags was shuffled in each step.</p></li><li><p>Tag dropout: Randomly, <strong><em>15%</em></strong> of general tags were dropped in each step.</p></li></ul><p></p><h2 id="heading-3974"><strong>Training</strong></h2><p>The training of Kohaku XL Epsilon was facilitated by the LyCORIS project and the trainer from kohya-ss/sd-scripts. [1][4]</p><p></p><p><strong>Algorithm: LoKr[7]</strong></p><p>The model was trained using the LoKr algorithm with full matrix triggered and a factor of 2~8 for different modules. The aim was to demonstrate the applicability of LoRA/LyCORIS in training base models.</p><p>The original LoKr file size is under 800MB, and the TE was not frozen. The original LoKr file also be provided as "delta-lokr" version.</p><p>For detailed settings, refer to the LyCORIS config file from Kohaku XL Delta.</p><p></p><p><strong>Other Training Details</strong></p><ul><li><p>Hardware: Quad RTX 3090s</p></li><li><p>Num Train Images: 5,210,319</p></li><li><p>Total Epoch: 1</p><ul><li><p>Total Steps: 20354</p></li><li><p>Batch Size: 4</p></li><li><p>Grad Accumulation Step: 16</p></li><li><p>Equivalent Batch Size: 256</p></li></ul></li><li><p>Optimizer: Lion8bit</p><ul><li><p>Learning Rate: 2e-5 for UNet / 5e-6 for TE</p></li><li><p>LR Scheduler: Constant (with warmup)</p></li><li><p>Warmup Steps: 1000</p></li><li><p>Weight Decay: 0.1</p></li><li><p>Betas: 0.9, 0.95</p></li></ul></li><li><p>Min SNR Gamma: 5</p></li><li><p>Noise Offset: 0.0357</p></li><li><p>Resolution: 1024x1024</p></li><li><p>Min Bucket Resolution: 256</p></li><li><p>Max Bucket Resolution: 4096</p></li><li><p>Mixed Precision: FP16</p></li></ul><p>Warning: Versions 0.36.0~0.41.0 of bitsandbytes have significant bugs in the 8bit optimizer that could compromise training, so updating is essential.[8]</p><p></p><p><strong>Training Cost</strong></p><p>Utilizing DDP with four RTX 3090s, completing 1 epoch across the 5.2 million image dataset took approximately 12 to 13 days. Each step for an equivalent batch size of 256 took about 49 to 50 seconds to complete.</p><p></p><p><strong>Why I publish 13600step intermediate ckpt</strong></p><p>The training progress have crashed when between 13600step~15300step. And kohya-ss trainer didn't implement resume+step skip before.</p><p>Although Kohya and I figured out how to do it correctly and did some sanity check on it. I still cannot fully ensure the final result is correct. So I publish the final intermedate ckpt so if anyone want to reproduce the training. They have chance to figure out the problem of final result.</p><p></p><h2 id="heading-3975"><strong>What's Next</strong></h2><p>I am focusing on making new dataset (targeting 10M~15M images), and wait for SD3 to see if it is worth trying.</p><p>I may also do some small FT on Epsilon and publish them as rev2/3/4… but dataset still my main focus now.</p><p></p><h2 id="heading-3976"><strong>Special Thanks</strong></h2><p>AngelBottomless &amp; Nyanko7: danbooru2023 dataset[3]</p><p>Kohya-ss: Trainer[4]</p><p></p><hr /><p><strong><em>AI art should be looked like AI, not like humans.</em></strong></p><hr /><p></p><p>(Some fun fact: this slogan come from my personal homepage. Lot of ppl like this one and put it in their model page.)</p><p></p><h2 id="heading-3977"><strong>Reference &amp; Resource</strong></h2><h3 id="heading-3978"><strong>Reference</strong></h3><p>[1] SHIH-YING YEH, Yu-Guan Hsieh, Zhidong Gao, Bernard B W Yang, Giyeong Oh, &amp; Yanmin Gong (2024). Navigating Text-To-Image Customization: From LyCORIS Fine-Tuning to Model Evaluation. In The Twelfth International Conference on Learning Representations.</p><p>[2] HakuBooru - text-image dataset maker for booru style image platform. <a target="_blank" rel="ugc" href="https://github.com/KohakuBlueleaf/HakuBooru">https://github.com/KohakuBlueleaf/HakuBooru</a></p><p>[3] Danbooru2023: A Large-Scale Crowdsourced and Tagged Anime Illustration Dataset. <a target="_blank" rel="ugc" href="https://huggingface.co/datasets/nyanko7/danbooru2023">https://huggingface.co/datasets/nyanko7/danbooru2023</a></p><p>[4] kohya-ss/sd-scripts. <a target="_blank" rel="ugc" href="https://github.com/kohya-ss/sd-scripts">https://github.com/kohya-ss/sd-scripts</a></p><p>[7] LyCORIS - Lora beYond Conventional methods, Other Rank adaptation Implementations for Stable diffusion. <a target="_blank" rel="ugc" href="https://github.com/KohakuBlueleaf/LyCORIS/blob/main/docs/Algo-Details.md#lokr">https://github.com/KohakuBlueleaf/LyCORIS/blob/main/docs/Algo-Details.md#lokr</a></p><p>[8] TimDettmers/bitsandbytes - issue 659/152/227/262 - Wrong indented lines cause bugs for a long time. <a target="_blank" rel="ugc" href="https://github.com/TimDettmers/bitsandbytes/issues/659">https://github.com/TimDettmers/bitsandbytes/issues/659</a></p><p></p><h3 id="heading-3979"><strong>Resource</strong></h3><p>Kohaku XL beta. <a target="_blank" rel="ugc" href="https://civitai.com/models/162577/kohaku-xl-beta">https://civitai.com/models/162577/kohaku-xl-beta</a></p><p>Kohaku XL gamma. <a target="_blank" rel="ugc" href="https://civitai.com/models/270291/kohaku-xl-gamma">https://civitai.com/models/270291/kohaku-xl-gamma</a></p><p>Kohaku XL delta. <a target="_blank" rel="ugc" href="https://civitai.com/models/332076/kohaku-xl-delta">https://civitai.com/models/332076/kohaku-xl-delta</a></p><p></p><h2 id="heading-3980"><strong>License</strong></h2><p><strong>This model is released under "Fair-AI public license 1.0-SD" License</strong></p><p><strong>Please refer to original License for more information:</strong></p><p><a target="_blank" rel="ugc" href="https://freedevproject.org/faipl-1.0-sd/">Freedom of Development (</a><a target="_blank" rel="ugc" href="http://freedevproject.org">freedevproject.org</a><a target="_blank" rel="ugc" href="https://freedevproject.org/faipl-1.0-sd/">)</a></p>

Version Detail

SDXL 1.0
20354
1

Project Permissions

    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 contents

  • Use on generation services

  • Sell this model or merges

Comments

Related Posts

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