NokiMo
Furkan Gözükara
Furkan Gözükara

patreon


The Very Best OneTrainer Workflow & Config For SD 1.5 Based Models DreamBooth / Full Fine Tuning

Patreon exclusive posts index

Join discord and tell me your discord username to get a special rank : SECourses Discord

30 March 2024 Update:

28 March 2024 Update:

22 March 2024 Update:

9 February 2024 Update:

Clone the repo into any folder : https://github.com/Nerogar/OneTrainer

Double click install .bat

Then double click start-ui .bat to start it

I have made over 70 full DreamBooth trainings for over 7 days and meticulously analyzed their results to the find very best training hyper parameters.

120 amazing quality images with their prompt info posted on CivitAI 

We have 3 configs.

The configs will not save checkpoints during training but will only save a final checkpoint. Don't forget to change that behaviour or fix your final checkpoint path.

Tier 1 is best quality. Don't use xFormers.

Tier 2 is second best quality. Uses xFormers to reduce VRAM. 

All Tier 2 are equal quality and only speed and VRAM usage changes.

xFormers : reduces VRAM, increases speed, reduced quality

Gradient Checkpointing : reduces VRAM, reduces speed, quality same

EMA : increases VRAM, reduces speed, improves quality. You can load EMA on both CPU and GPU. If you load on CPU, it will be slower but VRAM will be same.

Since OneTrainer supports EMA, it is better than Kohya.

Kohya config : https://www.patreon.com/posts/97379147

There are 2 strategies of training. Stylized vs Realism.

To find out very best models for both realism and stylization models, I have made 161 models comparison recently if you remember : https://youtu.be/G-oZn4H-aHQ

Models Downloader Script And The Patreon Post Shown In The Video ⤵️ https://www.patreon.com/posts/1-click-download-96666744

1st:

Training for realism. For this training strategy I have chosen the Hyper Realism V3 model from CivitAI. The config file will download it automatically from Hugging Face or alternatively you can give the local path.

2nd:

Training for stylization like 3d render of yourself. For this task I have chosen RealCartoon-Pixar V8 from CivitAI.

To use this model the key change you need to make is, making Clip skip 2 in Advanced Settings.

I used 15 training images and trained 150 epoch. 

My used training images are as below (they are at best medium quality)

For RealCartoon-Pixar V8 hopefully I will add Regularization images to this post soon.

For realism, use our very best real unsplash collected regularization images ⤵️

https://www.patreon.com/posts/massive-4k-woman-87700469

I trained both 768x768 and 1024x1024. 768x768 training works better than 1024x1024. Moreover, generating 1024x1024 works better than 768x768. When fixing faces with ADetailer extension, make the ADetailer extension resolution 768x768 even if you generate images in 1024x1024.


Comments

i only have good config for generating full check points, so like SD 1.5 files are 4 GB standalone. but you can extract LoRA from them and use - this lora will have better quality than best LoRA

Furkan Gözükara

Hi , are these SD 1.5 config files for Onetrainer only for creating Loras, or are they the same for creating an embedding? Are there any modifications to be made to the configuration for embedding? thank you.

Marc

you are welcome. ty too

Furkan Gözükara

Awesome! Thank you so much. Keep going with the good work :-)

Jannik

yes they are shown in this video 1:32:15 : https://youtu.be/0t5l6CP9eBg

Furkan Gözükara

Hi, can you share your settings for the ADetailer?

Jannik

i didnt test but you can try

Furkan Gözükara

Thanks. Do 10 images also work well? For 10 images, would we need 200 or 130 epochs for good results?

Manpreet Singh

15 images around 150 epochs. but it is flexible you can go 10-20 images 130-200 epochs

Furkan Gözükara

What is the minimum number of training images that will produce good results with this workflow? And how many epochs to train for those number of images? Also how many epochs to train for 20 images? (hopefully min required images is lower than 20)

Manpreet Singh

it is 32 fp version

Furkan Gözükara

Is the hyper realism model on huggingface MonsterMMORPG/sd15_best_realism equivalent to FP32 model present on CivitAI? Here: https://civitai.com/models/158959/hyper-realism Or should it be the FP16 model from there?

Manpreet Singh

published article about this : https://www.patreon.com/posts/onetrainer-fine-101606471

Furkan Gözükara

i plan to research it but didnt have chance yet

Furkan Gözükara

I found that onetrainer has a really good feature called Masked training, it will allow training only the face area, or any part that is set in the mask. Maybe you could cover this topic later?

Roy Ding

the answer of the developer: it's not supported right now. maybe in the future. if you want to backup the last epoch, you can use the "backup before save" switch

Furkan Gözükara

maybe it is how designed. you can then do 61 epoch. i will tell this to the developer now

Furkan Gözükara

I have a problem with config auto backup and sampling. If I put training epochs = 60, sample after 10 epcho, backup after 60 epoch, it won't backup or sample the last epochs. But it will sample 0-50 epoch. Is there something I did wrong?

Roy Ding

Pivotal tuning? Sure... accelerate launch --num_cpu_threads_per_process=2 ./train_dreambooth_lora_sdxl_advanced.py --pretrained_model_name_or_path="stabilityai/stable-diffusion-xl-base-1.0" --pretrained_vae_model_name_or_path="madebyollin/sdxl-vae-fp16-fix" --dataset_name="H:/Diffusers_androidsz" --caption_column="prompt" --instance_prompt="zwx person" --validation_prompt="zwx person, a figure standing in a forest" --output_dir="hofer-SDXL-LoRA" --mixed_precision="bf16" --resolution=1024 --train_batch_size=1 --repeats=1 --gradient_accumulation_steps=1 --gradient_checkpointing --learning_rate=1.0 --text_encoder_lr=1.0 --optimizer="prodigy" --prodigy_safeguard_warmup=True --prodigy_use_bias_correction=True --adam_beta1=0.9 --adam_beta2=0.999 --adam_weight_decay=0.01 --train_text_encoder_ti --train_text_encoder_ti_frac=0.5 --snr_gamma=5.0 --token_abstraction="zwx" --num_new_tokens_per_abstraction=2 --lr_scheduler="constant" --lr_warmup_steps=0 --rank=64 --max_train_steps=2000 --checkpointing_steps=4000 --seed="0" --enable_xformers_memory_efficient_attention But please read carefully huggingface page about that training.

Nenad Kuzmanovic

can you post your command here or on SE patreon discord channel?

Pavel Desort

same settings. he just fixed the bug. update onetrainer to latest version

Furkan Gözükara

same settings. he just fixed the bug. update onetrainer to latest version

Furkan Gözükara

Oh thank you so much!!! I did two 7 hour workouts two nights in a row and couldn't figure out what the problem was. Thanks, I'll check out the new settings.

Elevo

it just got fixed please update to latest version : https://github.com/Nerogar/OneTrainer/commit/edc098a077ca85658bac5d3711e9b7ebafcb504f

Furkan Gözükara

yes it is completely broken right now. i am talking with the developer to get fixed hopefully.

Furkan Gözükara

i am testing SDXL right now. reported by multiple people. i wonder if onetrainer broken something

Furkan Gözükara

Hi, I trained SDXL model by 15 pictures of a person, I did as you showed in the video, but when after training I generate pictures with keyword I can't generate this person, the person is just not there. I tried to train on SD 1.5 model I got everything working, but on SDXL I can't. What can be the problem?

Alex

with using second concept with reg images, we are making it almost as dreambooth : https://youtu.be/yPOadldf6bI no i don't suggest lora training. do this fine tuning and extract lora. it will be much better

Furkan Gözükara

so One Trainer can't be trained as dreambooth? If I have just strated training (finetuning doesn't help) I need to use the option Lora in One Trainer?

Pavel Desort

currently preparing a cloud VM for this and it is working great. i am sharing on discord. hopefully tutorial very soon

Furkan Gözükara

You got this working with ai-dock onetrainer docker?

mike oxmaul

please do

Javi dltr

EMA works great with SD 1.5 but not SDXL. i couldnt make work

Furkan Gözükara

yes i think he can add easily

Furkan Gözükara

Maybe we should request to integrate Dreambooth, cause if OT has LORA support, then Dreambooth would be no problem, i guess..

Nenad Kuzmanovic

i just have to figure out how to enable EMA within training in diffusers library...

Nenad Kuzmanovic

yes it is not DreamBooth

Furkan Gözükara

so, i have conclusion about OT: it is NOT using regulation images and it is NOT using prior_preservation... I did a lot of testing plus i read on OT Discord that OT is not using good old Dreambooth training script. It is pure Finetune... For Dreambooth, i will start to use Diffusers library. Btw. this is working really amazing, everybody should try it.. Great results. https://github.com/huggingface/diffusers/tree/main/examples/advanced_diffusion_training I can post my training command, i spend a lot of time to make it run...

Nenad Kuzmanovic

ye something could be broken with their update process

Furkan Gözükara

The update.bat is not updating. Will try complete reinstall!

Chris

hi. you mean the OneTrainer itself is not working? i would try reinstall

Furkan Gözükara

Hi Mate, updating OneTrainer on Windows throws an error now. Maybe you can check?

Chris

yes it is on my todo. i will also show another cloud service template too. today meeting with them

Furkan Gözükara

Please make Runpod template for One trainer. Please please please

Nenad Kuzmanovic

i think this depends on implementation of the script. i think the downscale to 1 side. on kohya there is --debug_dataset which shows how images and prompts are actually used. can you ask this to the developer here? https://github.com/Nerogar/OneTrainer/issues set 1216, not enable crop or bucketing and i think it should work.

Furkan Gözükara

I am trying SDXL training on 832x1216 images (cropped and resized manually). What should I set as OneTrainer resolution for such images ? "832" ? "832,1216" ? Why resolution is single number everywhere, how it's handled for no-square images?

Maxim Kramarenko

you used different base model? i am going to investigate different base models. for example i will test Juggernaut XL

Furkan Gözükara

So I've tried the OneTrainer for the first time and the problem I face is that once model is trained, the subject likeness completely disappears when I make the prompt longer than just "ohwx man". I've used the medium quality, speed config, 15 training images and the very good reg. images from another post. Any ideas what could I be doing wrong?

Tomek Deręgowski

thank you so much. yes you need to lower number of epochs / repeating if you train with so many images usually to prevent over training. still as usual take several checkpoints and compare them

Furkan Gözükara

Hello Dr.! I followed you from Reddit and the truth is that your patreon gave me very good results compared to the Lora that I trained before. If I wanted, for example, to train with 100 images, in addition to lowering the image regularization repeats, should I change something else? Maybe less Epoch, but I could save every 10/15 epochs and try.

Leonardo Chocron

yes you need a special template for that. hopefully I will release it and make a tutorial

Furkan Gözükara

I am trying to install OneTrainer on Runpod, but I always have "tkinter" error. Can you help?

Sugar Coat VFX Design

I thought you were already giving full name :D

Furkan Gözükara

this was an issue you worked on last month, I was saying that the answer IS in the thread you worked on github. When the final model is saved the whole file must be specified not just the dir. So if the hypothetical model output destination is C:\OneTrainer\WORKING\OutputDir\ that results in the error I got. I should have done C:\OneTrainer\WORKING\OutputDir\FILENAME if this is in one of your readme's somewhere I missed it and that is what I was doing wrong. Putting in the file name fixed my problem.

Steve Bruno

well access denied is that python cant access your disk to write. something blocking it. sadly no idea.

Furkan Gözükara

its not the antivirus there no log history of it blocking anything, and none of the permissions are restricted. This is the issue I am having: https://github.com/Nerogar/OneTrainer/issues/115

Steve

yes probably not multi-threaded

Furkan Gözükara

I'm running with EMA set to cpu. Looks like it's only using 19% of my CPU. I wonder if it's not multithreaded.

DAVID OSTLER

Your computer is blocking the app to write to your disk. completely related to your computer setup. could be your antivirus or your account administrator level "Access is denied"

Furkan Gözükara

Been having issues saving the checkpoint anyone have a clue what i'm doing wrong? Creating Backup W:/LoraFactory/WORKING/RunningNow/img\backup\2024-02-21_14-29-54-backup-10950-150-0 Exception in thread Thread-1 (__training_thread_function): Traceback (most recent call last): File "C:\Users\SysOp\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner self.run() File "C:\Users\SysOp\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "W:\OneTrainer\modules\ui\TrainUI.py", line 472, in __training_thread_function trainer.end() File "W:\OneTrainer\modules\trainer\GenericTrainer.py", line 570, in end self.model_saver.save( File "W:\OneTrainer\modules\modelSaver\StableDiffusionModelSaver.py", line 138, in save self.__save_safetensors(model, model_type, output_model_destination, dtype) File "W:\OneTrainer\modules\modelSaver\StableDiffusionModelSaver.py", line 86, in __save_safetensors save_file(save_state_dict, destination, self._create_safetensors_header(model, save_state_dict)) File "W:\OneTrainer\venv\lib\site-packages\safetensors\torch.py", line 281, in save_file serialize_file(_flatten(tensors), filename, metadata=metadata) safetensors_rust.SafetensorError: Error while serializing: IoError(Os { code: 5, kind: PermissionDenied, message: "Access is denied." }) It has no problem saving the backups just not the final model, both the save and final model are going to the same folder so presumably its not a permission issue? and there are several TB free on the drive so its not out of disk. I noticed that it is using both forward and backslashes which isn't the way I have it typed in. either way with python that's usually not an issue. Could it have anything to do with the Float32 settings for everything? Also what is the difference between what I have saved and what it was about to save (could I somehow still compile the saved text encoder, unet, vae from their respective folders? I had backup before save enabled so I still got the files from right before it froze in saving the final model) running the tier2_sd15_slow_10_6_GB_v2 config with a RTX4070.

Steve

I am waiting diffuser pipeline to be able to load .safetensors file to research training with OT

Furkan Gözükara

OT has a branch now that works for Stable Cascade. In time it'd be interesting to hear your thoughts on best OT settings to train that new model (particularly the 3b one). I'm on the fence as to whether or not it's a model I'll get much use out of. It seems like some people are very optimistic about it w/ regards to training meanwhile those training so far haven't shown much that demonstrates this. Even a "quickstart"/share of preliminary settings to get started would be helpful (the model tab for example is a bit complicated for S.Cascade even though I had training going I don't know if the TXT encoder/UNet were being trained properly. My results either showed minimal learning w/ LRs of 1e-5+, or burn out at 1e-4 etc).

John Dopamine

you are welcome

Furkan Gözükara

That's exactly what I needed to know. Thank you!!!!

Wktra

Adetailer tab in "inpainting" where it says"use separate weight/height

Furkan Gözükara

You mean in the main Adetailer tab in "inpainting" where it says"use separate weight/height"? Or do you mean in the settings of Auto1111 under the Adetailer tab?

Wktra

you can set any resolution check settings again. also it uses your default resolution. but it is there check again :)

Furkan Gözükara

I'm having trouble with one small part of your advice: How do I change the ADetailer extension resolution to 768x768? I've looked in the settings tab under Adetailer, but there's no way to change the resolution. Any advice?

Wktra

you are welcome

Furkan Gözükara

Thanks!

Chris

for realism i dont suggest captions. for others you can try and compare. select the other option that reads captions from each txt file name with the same file name of images

Furkan Gözükara

How can I use captions with OneTrainer? Do you recommend them when training a person? For realism? Or for style? Or does captioning not alter the results significantly?

Chris

yes since it uses more VRAM on GPU

Furkan Gözükara

yes since it uses more VRAM

Furkan Gözükara

hello. can you check the attached video : Quick One Trainer Concept Setup.mkv you add concepts and give their folder path and prompt text file

Furkan Gözükara

i tested 768 vs 1024. 768 worked better. but 512 can be tested too

Furkan Gözükara

Did you do a test with both 768px and 512px source pictures? Does 768px improve quality much? Maybe this would be nice as another comparision test

Chris

Hello, stupid question probably, but where do I select my training images, so where do I put them? In the workspace folder that I selected for the training? thanks! :)

Florian Maas

Just checked, it is set to CPU. I saw that but i tought that you left it like that for a reason.

Jam

I think that CPU is set for EMA on tier1 setting by default?

Jam

yes i get with 768. by the way it depends whether you use EMA on CPU or not. If you use EMA on cpu it really slows down. if you need speed enable xformers and disable gradient checkpointing and move EMA to GPU. it will work faster

Furkan Gözükara

Around 3h. Nothing was working except onetraining. Yoy get that time with 768 resolution? I used 512px dataset. Should the training last less or the same if i use 768px images?

Jam

yes i use 3090 . it takes lesser than 2 hours for 150 epoch. how long does it take?

Furkan Gözükara

Anyone using 3090 for training? Did anyone tried and recorded how long the training lasts on every tier? On tier1 setting where only thing changed is lowering the default 768 resolution to 512, i get training that lasts couple of hours? Is this normal? I am training a 1.5 model of a person. 15 concept images.

Jam

Please report this to the developer github : https://github.com/kohya-ss/sd-scripts

Furkan Gözükara

it could be due to your prompt setup. how did you setup? 150 epoch is good

Furkan Gözükara

yes i dont caption for training a person. ohwx man for training images and man for class images.

Furkan Gözükara

Hello. I have dual GPU. My second GPU is RTX 3060 with 12 GB VRAM. It has 0 VRAM usage. So I just tested config for you and it uses exactly 10300 MB. So you must have other apps consuming your VRAM. My speed is 5 second / it since EMA is running on CPU.

Furkan Gözükara

Also I cant extract lycoris: Traceback (most recent call last): File "D:\kohya_ss\tools\lycoris_locon_extract.py", line 190, in main() File "D:\kohya_ss\tools\lycoris_locon_extract.py", line 169, in main state_dict = extract_diff( File "D:\kohya_ss\venv\lib\site-packages\lycoris\utils\__init__.py", line 376, in extract_diff for idx, te1, te2 in enumerate(zip(base_tes, db_tes)): ValueError: not enough values to unpack (expected 3, got 2)

RtBx

I don't know why, but I don't get the results I expected, I used the same settings, sampler, I used 50 images, 150 epochs, but it seems that it ends up undertrained.

RtBx

Why is it that your 10.6 json file fills up my VRAM on my 3060 12GB completely? Training then takes ages, because it uses way more than 12GB. I am getting 8sec/it or so. When using your older method (1.bat / 2.bat, older versions of a1111 DB extension) I get around 1.5it/sec.

Chris

Wait wait. This is IMPORTANT. This is probably the reason I have been getting very bad results using your method. So basically, you DO NOT caption any of the details on any of your training and regularization images? No pose details? No background details? Only "OHWX man"??

Wktra

true. but if you want to train style you can also use from text file per sample

Furkan Gözükara

You said "Also I give prompt resource from single text file. And In that text file I just type either just man for reg images concept and ohwx man for training images concept." Does this mean you don't caption each training image??? You only use "ohwx man" for every training image?

Wktra

nice findings

Furkan Gözükara

Thank you for your response. Just figured that out.

Jared Calvert

right.. Meanwhile i have tested LORA training. With the same settings as in Kohya i'm getting not so great results (on character). But style is great. In their paper (one trainer) they say NOT to train with rare trigger token, but only with captions. Character was (after 100 epochs) undertrained IMHO. But style is amazing, reacting to prompts really great... Maybe i was doing something wrong, cause i tried training with multiple resolutions, and each one of them was separate concept, so i had 5 concepts (all with the same images) but different resolution, and number of epochs was divided by 5... LyCORIS in Kohya is still my first choice... Finetuning in OneT is amazing. EDIT: Images was in same resolution, but in concept tab, under Image augmentation i overrided training resolution..

Nenad Kuzmanovic

you need to install there manually. hopefully i will make a tutorial auto installer

Furkan Gözükara

I was unable to find a runpod template for the One trainer - the link you provided opens a page with pods, and i tried with search on Runpod but nothing... Can you check that again please..?

Nenad Kuzmanovic

Mostly style...

Nenad Kuzmanovic

nice. so what is your purpose with embedding training?

Furkan Gözükara

Btw i have tested embedding training and it is so great. They posted really nice explanation on wiki page about everything considering One trainer..

Nenad Kuzmanovic

That is the rule of engagement

Nenad Kuzmanovic

true. sadly this has to be done by everyone themselves

Furkan Gözükara

Every time you load training config, you have to adjust paths, cause config file is saved on Dr. Furkans PC... But i suggest that you save training preset, when you edit paths (base model etc). After that, with every new training you just have to edit concept and thats all :-)

Nenad Kuzmanovic

ok it is accurate. so if you set concepts accurate it should work great

Furkan Gözükara

I'm about to test the tier2 settings. Didn't touch anything except base model and concepts. https://ibb.co/1sbnCJK

Jam

please click optimizer settings and show screenshot of that

Furkan Gözükara

Sorry for the spamming :). Disregard the model loading question (error). This time i pointed to the VAE model also. Which for some reason prevented loading of the base model. It is working now :)

Jam

Traceback (most recent call last): File "M:\OneTrainer\modules\ui\TrainUI.py", line 465, in __training_thread_function trainer.start() File "M:\OneTrainer\modules\trainer\GenericTrainer.py", line 116, in start self.model = self.model_loader.load( File "M:\OneTrainer\modules\modelLoader\StableDiffusionModelLoader.py", line 356, in load raise Exception("could not load model: " + model_names.base_model) Exception: could not load model: M:/AI/SDlocal2/stable-diffusion-webui/models/Stable-diffusion/hyperRealism_30-32.safetensors

Jam

I have now tried with your settings and only my concepts. But One trainer wont start. It says it cant load the base model

Jam

These? https://ibb.co/vQqYWky

Jam

Where do i find those settings?

Jam

VAE wont cause it. how are your adafactor settings can you show me as screenshot?

Furkan Gözükara

New problem :) New to this so understand me :) I tried another training with all default setting from the configuration file and now i get this "OneTrainer\modules\modelLoader\StableDiffusionModelLoader.py", line 356, in load raise Exception("could not load model: " + model_names.base_model) Exception: could not load model" I even installed the One Trainer again, but no help. In the "model" tab i point to the hyperRealism_30-32 in my stable diffusion folder like with the first training, but it says it cant load it now. Help :)

Jam

Just to add, image starts creating in live view but goes black at the end.

Jam

Hi. Just did the first training and got a model that starts creating the image but at the end goes black. Any ideas why? Did it with tier1 settings. Everything the same, i have only changed output to bf12. To see the quality of the smaller model. Also a question, maybe that is the issue. VAE field was empty. Should i have add it?

Jam

when setting output path you need to give the name as .safetensors. you can safely rename it

Furkan Gözükara

Thank you so much for your training. This is probably a dumb question, but when the training completes the output file is without an extention. Do I just rename it to [file].safetensors? Or is there a proper way to extract the checkpoint?

Jared Calvert

can you elaborate more what you mean? you mean it can't follow the queries? without seeing dataset and your training folder structure and parameters impossible to tell. if you make a video of how you are training i can tell your error. i am also giving private lectures too

Furkan Gözükara

Hello. If I use only Ohwx man tag then everything is ok, but if I add any other tags then other people are rendered instead of the Ohwx man. What could be the problem? I used your preset and 15 photos close to yours.

Stanislav Yurev

you are welcome thanks for support

Furkan Gözükara

You need to set your own training folder in concepts

Furkan Gözükara

FileNotFoundError: [WinError 3] 系统找不到指定的路径。: 'C:/Users/King/Pictures/me new size/1024x1024 sdxl'

楠 陈

Thanks !

GeekZolda

there is no 1 rule for all but my last test was 15 training images, 150 epoch, thus total 15 * 150 * 2 (reg images) = 4500

Furkan Gözükara

Sorry if this was specified somewhere and I didn't see it but how many images\ steps do you recommend ? (for the dataset)

GeekZolda

And most important conclusion: this is the only forkflow that utilize "old" dreambooth training but it IS COMPATIBILE with SDXL. I bet Tier 1 sdxl training with buckets enabled will consume full A6000 recourses (48GB VRAM)... I will try that as soon as our "godfather" makes 1 click Runpod caviar :-)

Nenad Kuzmanovic

hopefully will do all

Furkan Gözükara

Edit 2: it kinda generate imgs without trigger rare token, but only "style" (full colors present in dataset and a bit of concept)...just like XavierXiao Dreambooth. Conclusion: Although the training is called finetune, do not confuse it with Kohja finetune, which is different. Kohya finetuned models are not flexibile in a way how they accept different styles typed as prompt.

Nenad Kuzmanovic

I think this is not actual Dreambooth training, but native finetuneing. I've just checked, trained model generates images without rare token used for training. Or that depends on actual dataset? I'm not using reg images but only captions with trigger word at the beginening of every caption... EDIT: i think it depends of what is your dataset, if no reg images are used, it tunes all tokens present in captions. But i think it's different finetune than Kohya, which needs json metada file, like this one i made for my dataset https://drive.google.com/file/d/1K653kQv3ZEwFb8dkLbRHrAu_kCrSl9Z5/view?usp=sharing With Kohya's method, tokens from tags can influence "style" of generated images heavily. You can see that in following example, i've generated 3 images with same prompt but with different tags (i had 3 sets of tags in my json metadata file) https://drive.google.com/drive/folders/1GoUmwx7sDcv19s2NNC1ubf35SiYa7zRe?usp=sharing You can download images and check generation parameters in auto1111, but here they are: - close up of a Shoes,ninja style, samurai style,(photorealistic:1.1) - close up of a Shoes,futurism, sci-fi, space fiction, hi-tech,(photorealistic:1.1) - close up of a Shoes,dark style, darkness, fantasy, gothic, horror, hi-tech,(photorealistic:1.1) This way you have 3 different styles in model, i think each one of them serve as one big embedded token...

Nenad Kuzmanovic

so we need a full video of the onetrainer training + the extraction of the checkpoint from kohya ss. Would be amazing if someone can also make a template of Onetrainer for runpod... think most of us cannot run the best presets

AIrtistry Contact

yes EMA is really improvement. I reported that to Kohya I hope he adds

Furkan Gözükara

wow, sampling during training in great :-) I'm training Tier 2 fast (xformers) cause my dataset is 86 img concept with captions and no regs, but with enabled buckets. And rtx 3090 can not handle it without Xformers, i'm not getting CUDA error but it is slooooowwww cause it consumes 12 gb share GPU memory... So, A6000 on Runpod will be my best friend. But i have to say, EMA training is really something. amazing results just after 30 epochs, cause it captured style and not concept (yet, cause it;s too early, it needs much more steps for that). I think i will stick to OneT for good, but i think implementation of LyCORIS plus training different layers separately (attention, transformer blocks etc) is the MUST.

Nenad Kuzmanovic

Which of these files should I use on kaggle? tier2_sd15_fast_15.8_GB.json tier2_sd15_slow_10.6_GB.json tier1_sd15_22_6_GB.json And how to I use this model Hyper Realism od Kaggle? Do I need to add some file from Huggingface?

Felix Rockwell

Ah I never work on with SD 2.1

Furkan Gözükara

Hello. you are right. hopefully I will make a tutorial. it has 2 options in config tab like read from a single file or read from file name txt files. if you come discord i can show with a screenshot

Furkan Gözükara

thank you so much for your support

Furkan Gözükara

Good job

Tech Meowpunk

SD 2.1-base... style model...

Nenad Kuzmanovic

I'm new to OneTrainer and there aren't many tutorials out there. Where do I input the instance prompt word and class word??? Does Onetrainer just pull it from the captions?

Wktra

I am not sure if LoRA training supports EMA too. not sure. It is best to do DreamBooth training and then extract LoRA from it

Furkan Gözükara

Is OneTrainer better for creating Loras because of EMA? Or is it just better for fine tuning dreambooth checkpoins?

Wktra

nice you tried on SDXL or SD 1.5?

Furkan Gözükara

My new FAVORITE optimiser: DAdaptLion...It' just amazing, using it for the first time. It has that trademark Lion "smoothness". I strongly recomended it, Lr 1 for all and no args...

Nenad Kuzmanovic

that is a good question. i trained both 768x768, and 1024x1024. I find that 768x768 better . and surprisingly i generate 1024x1024 good images with 768x768 training

Furkan Gözükara

What was the resolution of your source images? 1024x1024? Thx for this - giving it a run through.

John Dopamine

I find it lesser quality, more VRAM and resources demanding. I think if you enable xFormers should work fairly well on 24 GB.

Furkan Gözükara

What are your thoughts on Prodigy? I got a 4090 24GB would that be enough?

likewisemarien

Yes will do hopefully. I get you it is hard to use.

Furkan Gözükara

I tested prodigy throughly on SDXL experiments and I didn't get better results. Adafactor is one of the best VRAM friendly optimizer. I like it very much. I got best results with it for SDXL so got good results there too. multi-res training depends on your training dataset.

Furkan Gözükara

OneTrainer sadly dont have a tutorial yet. Will do soon hopefully.

Furkan Gözükara

please make a video about it for simpletons like me who just want to click a button and get results :D

Sidharth

I heard from the onetrainer discord that multi-res training gives better output too. Have you tried using prodigy? Why did you choose ADAfactor over prodigy?

likewisemarien

Could it be that the links are wrong? The OneTrainer links to the Kohya tutorial, and vice versa.

Guggeli

Is it possible to type additional arguments in OneT? Safe warmup, decouple etc... Prodigy is usseles without it. d_coef just needs to be set and i dont see how.. EDIT: i found it :-)

Nenad Kuzmanovic

ohh offcourse, we always trained with EMA in auto1111, i totaly forgot it.. and that is why i never trained Dreambooth in Kohya and got that quality like in auto1111.. I just HAVE to train in OneT dataset which i used for my belowed Pure darkness model, which is Kohya Finetune... it has arround 800 images, all generated in Illuminati Diffusion with various loras and 2-pass highres fix...Tonight im starting it, cause it will train it at least 10 hours (at least that was time in Kohya)...

Nenad Kuzmanovic

I just checked, that preset in Bmaltis is "SDXL-LoRA adafactor v1.0". Just change batch size, which is 5 LMAO... Don't change anything else. I like to use Weights&Biases to watch what it does with learning rate, which skyrockets, it is higher than Prodigy (they are both adaptive)... but that downscaling and squashing of weights makes that it learns really great... I have to try it on face training..

Nenad Kuzmanovic

It's different, that LORA training really engraves dataset, but i did testing with style and concept models, which i mostly do on daily basis for the last 6 months. I don't remember when was the last time i trained someones face...

Nenad Kuzmanovic

I think you train as regular but on a horrific dataset. so when you use it in negative prompt, the model drive away from those weights. I think that is the logic. but not 100% sure

Furkan Gözükara

Yes, but it can also make wonders, like embeddings for Illuminati Diffusion, 6 of them (which is IMHO the best model in the world)... That contrast and dark tones still NO MODEL can achieve...

Nenad Kuzmanovic

Have you compared that LoRA vs DreamBooth > Extract LoRA?

Furkan Gözükara

I see. I also never did that :d i think for that you need to have a horrific training dataset :D

Furkan Gözükara

I'm allways using your configs for Dreambooth, but for Lora i had to work hard to find good settings, which i have, offcourse. If someone needs those, just let me know. There is actually one great preset in Bmaltis for LORA training with Adafactor scheduler, it is full LORA (128 Dim, 128 Alpha) and Loha prefix and strong weights normalisation. Works really great for sdxl and sd2.1 (which i heavily use for everything but face, mostly for Deforum animations :-) I hope u don't mind if i put a link to music video i made for my homie musician... If u mind, just delete comment :-) https://www.youtube.com/watch?v=LGdowhWg7uQ

Nenad Kuzmanovic

https://www.reddit.com/r/StableDiffusion/comments/yy2i5a/i_created_a_negative_embedding_textual_inversion/ here it is :-)

Nenad Kuzmanovic

..and if u manage to make Embedding training (especially NEGATIVE) it would be 100% WIN, cause there are 0 (zero) tutorials on that... I found some readings from the guy who made negative emb for hands and fingers... but i didn't manage to train it successfully.

Nenad Kuzmanovic

presets are not useful. use my shared configs

Furkan Gözükara

ye will do hopefully

Furkan Gözükara

you are welcome

Furkan Gözükara

I trust that the presets are meaningful and correct, because if they are not, then what is their point? BMaltis kohya presets are (not all but most) totally nonsense, in every one the batch size is 8 LOL.. WTF??

Nenad Kuzmanovic

yes

楠 陈

thanks you

AIrtistry Contact

You are right. It took me a while too as well. Hopefully will do ASAP.

Furkan Gözükara

Actually I used EMA in my best training if you remember : https://youtu.be/g0wXIcRhkJk These custom models uses best VAE embedded so no need extra VAE

Furkan Gözükara

yes but you still need concepts accurately set and optimizer settings. be careful with those 2

Furkan Gözükara

We need a video explaining the whole process with Onetrainer please

AIrtistry Contact

OneT has option to export training parameters, for training without UI... i kinda like OneT, i have to try training sdxl embedding, cause Kohya embedding training gives me nightmares with placeholder tokens, strings etc...

Nenad Kuzmanovic

Ok... I'm curious about training with EMA, and in what way it "enhance" training...? I remember good old Dreambooth training in auto1111 and u never used it (at least in your tutorials)... I've tried to find some readings about training with EMA but no luck... Also, i saw One T has VAE training option, and i am REALLY interested for that.. :-) If you have to say something about it, do not hesitate :-)

Nenad Kuzmanovic

It would work but you had to prepare training command on your pc and copy paste there. On Kaggle you can't run the GUI. So it is really hard thing to do. Use Kohya config we already have working Kaggle notebook and tutorial. Just follow it and use the SD 1.5 config.

Furkan Gözükara

Does it also work on Kaggle?

Felix Rockwell

Well it depends. Saving is best approach as usual and comparing.

Furkan Gözükara

So that save at the end is ok? Not overtrained?

Nenad Kuzmanovic

No worries, cause it is part of the learning process - now i got it... ;)

Nenad Kuzmanovic

I used 768x768 images. Shown used images in the post. I think OneTrainer will be better since it has plus EMA for SD 1.5. For SDXL I made a comparison here : https://medium.com/@furkangozukara/experimenting-with-onetrainer-onetrainer-vs-kohya-realism-vs-stylization-reg-images-vs-0438950e9515

Furkan Gözükara

true i didn't save checkpoints during training. it saves at the end. you need to set it yourself manually. I should write this to the post you are right sorry about that.

Furkan Gözükara

Please check your config, it is set to NEVER save checkpoint during training.. i just wasted 1 hour of training...

Nenad Kuzmanovic

What do you do for dataset image? Do you crop them to a specific sizes or train them with their original size? And do you believe onetrainer is providing better results than kohya? What in compare to SDXL dreambooth LORA?

So Sha

you are welcome thanks for supporting me

Furkan Gözükara

Thank you for sharing your awesome work!

Dungeon Master

I plan to research this and make a tutorial soon hopefully on RunPod.

Furkan Gözükara

Would love to get one trainer working in the cloud. Is there somewhere I can rent a gpu along side windows?

mike oxmaul


Related Creators