DreamBooth Training on SDXL Anime Model & Comparing Ground Truth Regularization Images Effect
Tags: stablediffusion, sdxl, ai, training
Published: 2023-12-25 19:49:34

<p>It was requested of me to test ground truth Regularization / Classification images effect during Stable Diffusion XL (SDXL) DreamBooth training.</p>

<p>So for this experimentation I have used an anime SDXL model name as : Starlight XL 星光 Animated V3.</p>

<p>I used the configuration I shared here currently. It has been discovered after 120 different full trainings experimentation :&nbsp;<a href="https://www.patreon.com/posts/very-best-for-of-89213064" rel="noopener ugc nofollow" target="_blank"><strong>https://www.patreon.com/posts/very-best-for-of-89213064</strong></a></p>

<p>Hopefully I will make a full big tutorial of DreamBooth training and show all the settings.</p>

<p>For training Kohya SS GUI is used. If you don&rsquo;t know how to install and use Kohya SS GUI here the tutorial you need &gt;&nbsp;<a href="https://youtu.be/sBFGitIvD2A" rel="noopener ugc nofollow" target="_blank">https://youtu.be/sBFGitIvD2A</a></p>

<p>And here is the tutorial that shows how to use shared configuration both on Windows and RunPod &gt;&nbsp;<a href="https://www.youtube.com/watch?v=EEV8RPohsbw" rel="noopener ugc nofollow" target="_blank"><strong>https://www.youtube.com/watch?v=EEV8RPohsbw</strong></a></p>

{% embed https://www.youtube.com/watch?v=EEV8RPohsbw %}

<p>&nbsp;</p>

<p>So I used the below images as training images dataset.</p>

<p>This training dataset is at best medium quality because it has repeating backgrounds, repeating clothing and missing fully body pose.</p>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*UDQgkWt1IevNLyUSCSx2aw.png" style="height:185px; width:700px" /></p>

<p>Then for training configuration I did the following.</p>

<p>When training with regularization images, I did 1 epoch and 150 repeating. So more regularization images are used. And saved checkpoints at every 30 epochs. To make it that way calculate the number of steps you need to save. It is easy. 15 * 30 * 2 + 1</p>

<p>When training without regularization images, i set the repeating 1, trained up to 150 epochs and saved checkpoints at every 30 epoch. That is also why model names has different format. One has epoch number 1 has steps number.</p>

<p>I have used ultra high quality manually picked Unsplash real images having man dataset as regularization images dataset. This means they were ground truth regularization images like how Stable Diffusion was initially trained.</p>

<p>You can download dataset from &gt;&nbsp;<a href="https://www.patreon.com/posts/massive-4k-woman-87700469" rel="noopener ugc nofollow" target="_blank"><strong>https://www.patreon.com/posts/massive-4k-woman-87700469</strong></a></p>

<p>5200 images for both man and woman. Perfect quality cropped and resized to many common resolutions.</p>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*-R_vx1C_FjdJceD6P6wSGA.png" style="height:340px; width:700px" /></p>

<p>All training images and reg images were 1024x1024 pixels.</p>

<p>I used the 275 Fooocus amazing styles file to generate images with models so that I could pick later on.</p>

<p>You can find styles file (styles . csv) and styles file generator script here :&nbsp;<a href="https://www.patreon.com/posts/all-amazing-of-95143823" rel="noopener ugc nofollow" target="_blank">https://www.patreon.com/posts/all-amazing-of-95143823</a></p>

<p>I saved both After Detailer (ADetailer) before and after images. So some images are ADetailer used and some not. This is in settings panel to set both. For after detailer I used 0.7 inpainting denoise and 80 steps manually set. Improves quality.</p>

<p>And here the results.</p>

<p>First I will compare anime</p>

<p>The png info as below. I used batch PNG info extractor to get them easier :&nbsp;<a href="https://www.patreon.com/posts/batch-image-for-95176238" rel="noopener ugc nofollow" target="_blank">https://www.patreon.com/posts/batch-image-for-95176238</a></p>

<pre>
parameters: picture of (ohwx man:1.1) with shirt in anime style, anime movie, anime cartoon, anime battle, muscular, anime screenshot
Negative prompt: shirtless,topless,nsfw
Steps: 20, Sampler: DPM++ 2M SDE Karras, CFG scale: 9, Seed: 1382869474, Size: 1024x1024, Model hash: f31347de70, Model: me_15_StarlightXLAnimatedV3_noREG-000030, ADetailer model: face_yolov8n.pt, ADetailer confidence: 0.3, ADetailer mask only top k largest: 1, ADetailer dilate erode: 4, ADetailer mask blur: 4, ADetailer denoising strength: 0.5, ADetailer inpaint only masked: True, ADetailer inpaint padding: 32, ADetailer use separate steps: True, ADetailer steps: 80, ADetailer version: 23.11.1, Script: X/Y/Z plot, X Type: Checkpoint name, X Values: &quot;me_15_StarlightXLAnimatedV3_noREG-000030.safetensors [f31347de70],me15img\\model\\me_15_StarlightXLAnimatedV3-step00000901.safetensors [4610bf5599]&quot;, Version: v1.7.0-133-gde03882d</pre>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*HObcAUg7rjf0nkfcetMHxQ.png" style="height:460px; width:700px" /></p>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*EEV1bfSrjbkn3XfeOzeIbQ.png" style="height:460px; width:700px" /></p>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*Pak_JZm0mx4evb20lVBzzA.png" style="height:460px; width:700px" /></p>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*ubrD1XUZNV0ZJkmWta79EQ.png" style="height:460px; width:700px" /></p>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*G87vZ-UTwJd1xDCGyvEEnw.png" style="height:460px; width:700px" /></p>

<p>As you can see above, the regularization images affect is making it more like us. However, it reduced the stylization capability. It adds realism and more likeliness.</p>

<p>Now here second prompt compared. This one is realistic image instead of anime.</p>

<pre>
parameters: luxury product style portrait of ohwx man . elegant, sophisticated, high-end, luxurious, professional, highly detailed
Negative prompt: cheap, noisy, blurry, unattractive, amateurish
Steps: 20, Sampler: DPM++ 2M SDE Karras, CFG scale: 7, Seed: 2811753849, Size: 1024x1024, Model hash: f31347de70, Model: me_15_StarlightXLAnimatedV3_noREG-000030, ADetailer model: face_yolov8n.pt, ADetailer confidence: 0.3, ADetailer mask only top k largest: 1, ADetailer dilate erode: 4, ADetailer mask blur: 4, ADetailer denoising strength: 0.7, ADetailer inpaint only masked: True, ADetailer inpaint padding: 32, ADetailer use separate steps: True, ADetailer steps: 80, ADetailer version: 23.11.1, Script: X/Y/Z plot, X Type: Checkpoint name, X Values: &quot;me_15_StarlightXLAnimatedV3_noREG-000030.safetensors [f31347de70],me15img\\model\\me_15_StarlightXLAnimatedV3-step00000901.safetensors [4610bf5599]&quot;, Version: v1.7.0-133-gde03882d</pre>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*zB6keKjOvZTcbCiPvrgLig.png" style="height:460px; width:700px" /></p>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*kYP3_3Hl2LPAGMK55F2A0w.png" style="height:460px; width:700px" /></p>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*LM1yk79ZSu8aDEhxB-apDA.png" style="height:460px; width:700px" /></p>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*SejhSRJTVcXj9Nc-1cg8fg.png" style="height:460px; width:700px" /></p>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*LLGXnkKWSgO6HPnJaTcnbg.png" style="height:460px; width:700px" /></p>

<p>As can be seen above again, the reg images improved likeliness and realism quality.</p>

<p>And here some other good images I generated</p>

<pre>
parameters: retro game art portrait of ohwx man . 16-bit, vibrant colors, pixelated, nostalgic, charming, fun
Negative prompt: realistic, photorealistic, 35mm film, deformed, glitch, low contrast, noisy
Steps: 20, Sampler: DPM++ 2M SDE Karras, CFG scale: 7, Seed: 2542262511, Size: 1024x1024, Model hash: f8f06f0d73, Model: me_15_StarlightXLAnimatedV3-step00002703, ADetailer model: face_yolov8n.pt, ADetailer confidence: 0.3, ADetailer mask only top k largest: 1, ADetailer dilate erode: 4, ADetailer mask blur: 4, ADetailer denoising strength: 0.7, ADetailer inpaint only masked: True, ADetailer inpaint padding: 32, ADetailer use separate steps: True, ADetailer steps: 80, ADetailer version: 23.11.1, Version: v1.7.0-133-gde03882d</pre>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*wTMMVAiuWkqli_VMAK0_5g.png" style="height:700px; width:700px" /></p>

<pre>
parameters: breathtaking illustration from adult comic book presenting portrait of ohwx man. fabulous artwork. best quality, high resolution
Negative prompt: deformed, ugly, low quality, low resolution
Steps: 20, Sampler: DPM++ 2M SDE Karras, CFG scale: 7, Seed: 427502473, Size: 1024x1024, Model hash: f8f06f0d73, Model: me_15_StarlightXLAnimatedV3-step00002703, Version: v1.7.0-133-gde03882d</pre>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*6NcwwgeFIsG-GC-CFc5UaA.png" style="height:700px; width:700px" /></p>

<pre>
parameters: closeshot picture of (ohwx man:1.1) wearing shirt, 3D render, 3D art, 3d character, muscular game, cgi, artstation 
Negative prompt: ugly, deformed, noisy, blurry, low contrast, grunge, sloppy, unkempt, photograph, photo, realistic, nsfw, shirtless, topless 
Steps: 20, Sampler: DPM++ 2M SDE Karras, CFG scale: 7, Seed: 1171263453, Size: 1024x1024, Model hash: f8f06f0d73, Model: me_15_StarlightXLAnimatedV3-step00002703, Version: v1.7.0-133-gde03882d</pre>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*UVDaZsEWJC6aaq96VQVuFw.png" style="height:700px; width:700px" /></p>

<pre>
parameters: picture of (ohwx man:1.1) in Photorealistic chibi art style,   facing the viewers , artistic, artist, simple volumetric light background, swirling clouds, ColorART, many cute ghosts with tongues out, chibi,
Negative prompt: gaussian noise worst quality lowres oversaturated undersaturated overexposred underexposed grayscale bw bad photo bad photography bad art blur blurry grainy morbid ugly asymmetrical mutated malformed mutilated poorly lit bad shadow draft cropped out of frame cut off censored jpeg artifacts out of focus glitch duplicate pixelated soft focus color fringing overprocessed oversharpened
Steps: 20, Sampler: DPM++ 2M SDE Karras, CFG scale: 7, Seed: 3576768970, Size: 1024x1024, Model hash: f8f06f0d73, Model: me_15_StarlightXLAnimatedV3-step00002703, Version: v1.7.0-133-gde03882d</pre>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*1YIMqvwA_xQZCH6ZNIBJ5A.png" style="height:700px; width:700px" /></p>

<pre>
parameters: portrait of (ohwx man:1.1), painting by sargent and rhads and leyendecker and greg hildebrandt evening sky
Negative prompt: gaussian noise worst quality lowres oversaturated undersaturated overexposed underexposed grayscale bw bad photo bad photography bad art blur blurry grainy morbid ugly asymmetrical mutated malformed mutilated poorly lit bad shadow draft cropped out of frame cut off censored jpeg artifacts out of focus glitch duplicate pixelated soft focus color fringing overprocessed oversharpened
Steps: 20, Sampler: DPM++ 2M SDE Karras, CFG scale: 7, Seed: 1252309971, Size: 1024x1024, Model hash: f8f06f0d73, Model: me_15_StarlightXLAnimatedV3-step00002703, Version: v1.7.0-133-gde03882d</pre>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*Bf8oHHLsHSaCqHbaV0Pc-g.png" style="height:700px; width:700px" /></p>

<pre>
parameters: Watercolor style painting, portrait of ohwx man , visible paper texture, colorwash, watercolor
Negative prompt: ugly, deformed, noisy, blurry, low contrast, photo, realistic
Steps: 20, Sampler: DPM++ 2M SDE Karras, CFG scale: 7, Seed: 3204333295, Size: 1024x1024, Model hash: 29bbb5ce43, Model: me_15_StarlightXLAnimatedV3-step00001802, ADetailer model: face_yolov8n.pt, ADetailer confidence: 0.3, ADetailer mask only top k largest: 1, ADetailer dilate erode: 4, ADetailer mask blur: 4, ADetailer denoising strength: 0.7, ADetailer inpaint only masked: True, ADetailer inpaint padding: 32, ADetailer use separate steps: True, ADetailer steps: 80, ADetailer version: 23.11.1, Version: v1.7.0-133-gde03882d</pre>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*0e4DPydK52pUJ1ClFX_OYg.png" style="height:700px; width:700px" /></p>

<pre>
parameters: Flat 2D Art, portrait of ohwx man , simple flat color, 2-dimensional, Flat 2D Art Style
Negative prompt: ugly, deformed, noisy, blurry, low contrast, 3D, photo, realistic
Steps: 20, Sampler: DPM++ 2M SDE Karras, CFG scale: 7, Seed: 998589366, Size: 1024x1024, Model hash: f8f06f0d73, Model: me_15_StarlightXLAnimatedV3-step00002703, Version: v1.7.0-133-gde03882d</pre>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*qVvL9fFSWVmE-_zKWeLJwQ.png" style="height:700px; width:700px" /></p>

<pre>
parameters: pixel-art portrait of ohwx man . low-res, blocky, pixel art style, 8-bit graphics
Negative prompt: sloppy, messy, blurry, noisy, highly detailed, ultra textured, photo, realistic
Steps: 20, Sampler: DPM++ 2M SDE Karras, CFG scale: 7, Seed: 3068779067, Size: 1024x1024, Model hash: f8f06f0d73, Model: me_15_StarlightXLAnimatedV3-step00002703, Version: v1.7.0-133-gde03882d</pre>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*VKlw88DpTNsIEKebLsqkJQ.png" style="height:700px; width:700px" /></p>

<pre>
parameters: comic portrait of ohwx man . graphic illustration, comic art, graphic novel art, vibrant, highly detailed
Negative prompt: photograph, deformed, glitch, noisy, realistic, stock photo
Steps: 20, Sampler: DPM++ 2M SDE Karras, CFG scale: 7, Seed: 2542262511, Size: 1024x1024, Model hash: f8f06f0d73, Model: me_15_StarlightXLAnimatedV3-step00002703, ADetailer model: face_yolov8n.pt, ADetailer confidence: 0.3, ADetailer mask only top k largest: 1, ADetailer dilate erode: 4, ADetailer mask blur: 4, ADetailer denoising strength: 0.7, ADetailer inpaint only masked: True, ADetailer inpaint padding: 32, ADetailer use separate steps: True, ADetailer steps: 80, ADetailer version: 23.11.1, Version: v1.7.0-133-gde03882d</pre>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*H4xVJ6f5DG-JccGaS48P2Q.png" style="height:700px; width:700px" /></p>

<pre>
parameters: breathtaking illustration from adult comic book presenting portrait of ohwx man. fabulous artwork. best quality, high resolution
Negative prompt: deformed, ugly, low quality, low resolution
Steps: 20, Sampler: DPM++ 2M SDE Karras, CFG scale: 7, Seed: 427502468, Size: 1024x1024, Model hash: f8f06f0d73, Model: me_15_StarlightXLAnimatedV3-step00002703, Version: v1.7.0-133-gde03882d</pre>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1225/1*rN4rGvCVlVLAjLYTUyfhbg.png" style="height:700px; width:700px" /></p>