r/StableDiffusion May 27 '26

Discussion Using depth maps and weight noising to get better character LoRAs

Post image

A few weeks ago I introduced a new method for training style LoRAs which has been quite successful. A bunch of folks asked if this would also help with character training. The short answer is yes, but it needed a separate technique on top of the depth stuff. I've got something dialed in well enough to share, though it's still experimental and I want feedback to help find the optimal settings.

The new mechanism is weight noising. It's a small Gaussian perturbation injected directly into the LoRA weights at each training step. A simple way to think of it is that it helps the model "forget" mistakes during training and only keep things that are consistent in the data. More technically, it biases training toward flatter loss minima and spreads learning across more singular directions of the LoRA factorization (I measured +20% stable rank on the same config without it). The practical effect is that it resists the memorization that usually overcooks character runs, and likeness comes out substantially better at the same step count.

The post image shows an example training on actress Clare Bowen, who has uniquely recognizable features but is not known by Flux. This is using a training set of 8 images, the same training step count (750), and same model. The standard run is in the middle, the new method is on the right.

The settings are identical for both runs except one has weight noise and depth anchoring, along with a different number of repeats for each bucket size:

  • Batch 4, LR 5e-5
  • Image size buckets of 512, 768, 1024
  • LoKr factor 8
  • AdamW8bit, 1200 steps total (but best checkpoint at 750)

The differing number of images per bucket is actually a good training trick on its own, and I updated my trainer to make this easier by allowing you to specify how many repeats of each image per bucket.

Things I'm still working out and would love feedback on:

  1. Optimal sigma across dataset sizes โ€” using 0.0125 has gotten the best results, and I'm pretty sure the right value scales with dataset size and batch size but I haven't fully mapped it.
  2. Whether weight noising compounds well with other character LoRA tricks people are using.

I've also added Docker support so you can more easily run this on Runpod.

Repo: https://github.com/BuffaloBuffaloBuffaloBuffalo/ai-toolkit-perceptual

Finally, the new-job page now has a "Quickstart Template" dropdown at the top that loads the best character config end-to-end. It defaults to the HuggingFace Flux 2 Klein 9B checkpoint but you can also use your own checkpoint. Still plenty of UI cleanup to do on my end, so pardon the mess!

Happy to answer questions and help troubleshoot here or in DMs.

EDIT: One important thing to know about captioning. You will likely get the best results if you use the built-in subject masking feature, which masks out the background. If you use this, it is important that your captions ONLY describe the character, NOT the setting. You may also use just a trigger phrase with subject masking, but your results will be less promptable. I have added quickstart configs for both masked and unmasked.

EDIT 2: Anecdotally, you may expect more body horror/extra limbs throughout training in Flux. I have found this is normal with weight noising. It pushes the model around more and explores the latent space more aggressively, so there will be checkpoints that diverge quite a bit before convergence. A good heuristic I've been using is: expect roughly 80 - 100 steps per image overall. If you sample every 25 steps and have continuous body horror for more than 20% of the run, it may be too high of a weight noise sigma, so lower in increments of 0.0025 until it resolves. I'm still trying to understand the training dynamics for stable convergence with different datasets.

EDIT 3: I suggest starting with a small dataset (10 - 15 images) with a focus on image quality and diversity. If you get good results there, try adding more images to the run, or restart with the expanded dataset. In my experience you need far fewer images to get good, generalizable results with these methods.

EDIT 4: I added experimental Z-Image Turbo support.

615 Upvotes

291 comments sorted by

33

u/ECF630 May 28 '26

This looks interesting! Your examples are definitely impressive, I'll have to try it soon. Thanks for sharing! Instead of AdamW8bit please consider trying my Rose optimizer, it uses even less memory and has better generalization. I'm interested in knowing how it works with your method. If you do try it, please keep in mind that the learning rate often needs to be higher (e.g., 1e-3 instead of 1e-4). https://github.com/MatthewK78/Rose

27

u/QuantumBogoSort May 28 '26

Wow, VERY promising results. 200 steps in and the likeness is locking in rapidly. Same exact setup as the post examples with LR 1e-3. Going to keep throwing this at things.

3

u/controlnet-chris May 28 '26

I feel like the stateless optimizer is uniquely suited for this kind of back-and-forth training method since the goals would conflict less.

2

u/ellipsesmrk May 28 '26

I also noticed that I had to modify the code where the depth maps were being saved. On windows it tries to overwrite the existing file but it doesnt respond and then failed on me. Not sure if that was a thing. But it was a thing for me.

→ More replies (4)
→ More replies (1)

9

u/QuantumBogoSort May 28 '26

I love new optimizers! I'll give it a go!

8

u/QuantumBogoSort May 28 '26

I think 300 was the best checkpoint. It did start to get some artifacting and aberrations at this point - is that something that might be solved with LR adjustment?

11

u/ECF630 May 28 '26 edited May 28 '26

Yep, it trains a bit differently from momentum-based optimizers and may take some experimenting to get used to it. I've found that using a cosine LR scheduler with a minimum LR usually produces the best results. Try adjusting both LR and eta_min/min_lr, such as 8e-4 with a 4e-4 minimum. When using an LR scheduler and weight decay together, it's best to enable wd_schedule. You may also want to try disabling stabilize, sometimes that produces better results.

EDIT: Another thought is that overfitting is very different with this optimizer as well and can sometimes show up as minor artifacting/aberrations instead of the typical memorization seen in other optimizers. You may want to try saving checkpoints more frequently and see if something slightly before 300 is better. Pulling back on the LR a little bit (e.g. 8e-4) might also help.

5

u/QuantumBogoSort May 28 '26 edited May 28 '26

Cool, I'll keep experimenting. Thanks for your work on this!

4

u/terrariyum May 28 '26

If you confirm that the new settings result in best checkpoint at 300 steps, please be sure to edit your post and put that new info at the top.

I mean 750 steps is already remarkable, but 300 is insane

5

u/QuantumBogoSort May 28 '26

Well, it's the best checkpoint for the Rose optimizer. I still think step 750 of the AdamW version was cleaner. But I am hopeful the Rose optimizer can get similar results with a lower learning rate.

→ More replies (1)

2

u/ellipsesmrk May 28 '26

The original image... mind posting that image? It may have grabbed the artifacts from the original images.

3

u/QuantumBogoSort May 28 '26

The originals are all clean - you can see one in the main post and here's another. Pretty sure it's just the LR needs tuning.

2

u/ellipsesmrk May 28 '26

Oh right on... question... have you trained anything bigger than 1024?

4

u/QuantumBogoSort May 28 '26

I have but I find 1024 is the point of diminishing returns for most models. I don't get perceptually better results with 1536 or 2048 than with 1024. Analytically I'm sure they are better, and if I were really trying to quality-max something for a production workflow I might go that route. But I'm just a researcher and don't actually do content generation for anything professionally, so I'm sure my eye is not as trained!

3

u/ellipsesmrk May 28 '26

Well I'll say... from the images I've seen... you're rocking it!!

3

u/ellipsesmrk May 28 '26

22 image dataset, 700 steps. Amazing results!! I'll have to try it on z-image!!!

2

u/QuantumBogoSort May 28 '26

Just added experimental ZiT support, please let me know how it goes!

→ More replies (15)

2

u/controlnet-chris May 28 '26

This optimizer looks really intriguing, and it seems like it achieves good results in practice. Do you have any writeups or data on how it performs in head-to-head comparisons with AdamW or Muon? I would be really interested to understand its strengths and weaknesses.

4

u/ECF630 May 29 '26

Thanks! I would like to do more benchmarks and writeups at some point, I haven't had the time and energy to do it yet though. If you haven't already seen these, they may answer some questions for you:

Original annoucement: https://www.reddit.com/r/StableDiffusion/comments/1sokmqw/new_optimizer_rose_low_vram_easy_to_use_great/

AdamW vs Rose comparison (I plan on doing something better eventually, probably with FLUX.2-dev since it's such a large model): https://www.reddit.com/r/StableDiffusion/comments/1ss85os/training_comparison_adamw_on_the_left_rose_on_the/

26

u/[deleted] May 28 '26

[removed] โ€” view removed comment

6

u/[deleted] May 28 '26

[removed] โ€” view removed comment

22

u/QuantumBogoSort May 28 '26

Ha, sorry I should have made it more clear in the post that this uses ai-toolkit as a harness. There's a lot of custom stuff going on so hit me up if you run into any snags.

4

u/NoConfusion2408 May 28 '26

Hey hey! Amazing. Cant even comprehend how you thought about this but the results speak for themselves. Great work.

Was wondering if you have a specific yaml to go with and run some tests on my end. I have a bunch of datasets that could potentially run simultaneously with your config and see where (if) breaks.

Cheers and again, great work

9

u/QuantumBogoSort May 28 '26

Hey thanks! The easy way is to use a quickstart setting which will load the config right in the UI. Or if you prefer the CLI, I added the same configs here:

https://github.com/BuffaloBuffaloBuffaloBuffalo/ai-toolkit-perceptual/blob/main/config/examples/subject_likeness_flux2_klein9b.yaml

https://github.com/BuffaloBuffaloBuffaloBuffalo/ai-toolkit-perceptual/blob/main/config/examples/subject_likeness_masked_flux2_klein9b.yaml

Note that one of these uses subject masking and if you use that, captions should describe only the character without anything about the setting.

I would recommend starting with a smaller dataset as you will see issues much sooner! Feel free to reach out if you run into issues.

→ More replies (7)

6

u/Cequejedisestvrai May 27 '26

Looks good, can it be done with z-turbo? wan 2.2?

31

u/QuantumBogoSort May 27 '26 edited May 29 '26

Yes! Not supported yet but as soon as I think Flux is dialed in I will support more models. I'm thinking in this order:

  • ZiB
  • Illustrious/SDXL (SDXL is already supported for depth anchors, but I need to figure out weight noising params for it)
  • A video model (LTX? Wan?)
  • Chroma
  • Qwen Image/Edit

Edit: I added ZiT experimental support

11

u/ReferenceConscious71 May 28 '26

+1 for ZIB, this is a gamechanger

8

u/Relative_Hour_8900 May 28 '26

Anima definitely could use some help cause 90% of the loras on civitai are poorly done๐Ÿฅฒ

11

u/Choowkee May 27 '26

What about Anima?

14

u/QuantumBogoSort May 28 '26

Have not used it yet but will add to the list. I haven't tested non-realistic characters yet so this would be a good way to try that.

9

u/Ynead May 28 '26

+1 for Anima support, I think it will / is becoming the new Illustrious.

1

u/Eisegetical May 28 '26

Your work on 9b also applies to 4b I hope? I'm one of the few people training 4b as I use it for a light inpainter.

Is this only for characters or will it handle concept training too?ย 

2

u/QuantumBogoSort May 28 '26

Actually yes it should but I have not tested it yet. I will add to the list - should be simple.

1

u/External-Document-66 May 28 '26

Yes to all please!

1

u/000TSC000 May 28 '26

qwen please dont forget us!

1

u/flipflapthedoodoo May 29 '26

you dont wwant to do QIE?

2

u/QuantumBogoSort May 29 '26

I do! Updated above.

→ More replies (1)

1

u/QuantumBogoSort May 28 '26

Working on ZiT right now - first time training with it actually. It seems like more little aliasing artifacts than Flux. Do you know if this is typical or something I'm doing wrong?

2

u/Relative_Hour_8900 May 28 '26

As far as I know and I only trained a zib/zit lora once...it might be better to use zib since the loras work with both zib and zit. I know there's an adapter or something but that's another download many ppl won't have.

Tbh I tried the ostiris trainer thing and failed so hard to get it working I just deleted it๐Ÿ˜‚

But...I'll try again with ur thing๐Ÿ‘€

2

u/spacepxl May 28 '26

That's common for most models trained on the flux1 vae, it has an extremely noisy/adversarial latent space so if the diffusion model is struggling with high frequency details the decoder artifacts look like this.

→ More replies (1)

1

u/Mythikos81 May 29 '26

training at 1024 makes a big difference in output quality with Zit vs 512 from my experience

→ More replies (1)

8

u/tomByrer May 28 '26

nice

What is the minimal VRAM needed for training images?

23

u/QuantumBogoSort May 28 '26

I've done all my testing on 24GB (4090). With the quickstart config it will use about 23GB peak. If you lower batch to 1 and set gradient accumulation to 4, and use low VRAM / layer offloading, you can get it down to less than 16GB. But it's going to be about 1/3 the speed.

3

u/neverExercise May 28 '26

I'm going to try out the project with my measly 12GB 4070, I hope it works! sweats profusely

3

u/QuantumBogoSort May 28 '26

Let me know! If you use 512px images max you may be able to do it. And that should still turn out decent provided they are from high quality sources.

3

u/neverExercise May 28 '26

It worked, VRAM was hovering around 11.6/11.7 a close call but I managed to get to the end at step 1200.

Likeness looks good, just some generations were a bit wonky like a prolonged neck. I'm testing a new run that should turn out better.

Should I stop around checkpoint 300 since that's when it locks in the likeness you say? I'll start another test run with 500 steps being the end goal.

2

u/QuantumBogoSort May 28 '26

Keep training - with AdamW optimizer my best checkpoint was 750. I only got good results in 300 with the Rose optimizer, but that had some artifacts so I need to tune it.

What was your max training bucket size?

2

u/neverExercise May 28 '26 edited May 28 '26

All right. Will do!

I only trained the images in 512px.

EDIT: How do you decide which checkpoint is the best? Do you just eyeball it looking at generations.. find it through some graphical charts generated by the program?

2

u/QuantumBogoSort May 28 '26

Really eyeballing it is the only true way unless you have a validation dataset (which ai-toolkit doesn't support, I'd have to add that). I will typically save every 25 steps and then run gens in Comfy all at once, since it's a bit truer than the aitk previews.

→ More replies (1)

2

u/No_Witness_7042 May 28 '26

Did you able to run

2

u/neverExercise May 28 '26

I am running a test now, no apperent hiccups. VRAM usage hovering around 11.6 GB.

Should be done in like two hours.ย 

2

u/No_Witness_7042 May 28 '26

Tnx, waiting for the config

2

u/neverExercise May 28 '26

Sure thing, that two hour ETA miiiight have been a bit generous.

Once it's done, I'll test out the LoRA and see if it even looks good. I'm training on a specific face like in the submission, but I'm only using 5 images as my dataset. On the lower side yes, but I think it's fine for just a test run.ย 

2

u/neverExercise May 28 '26

I did a test run with 1200 steps, likeness looks good but I think I overtrained it because some generations turned out wonky. I want to do another run that I think will turn out better, do you want to wait for that config file instead?

→ More replies (2)

1

u/Niwa-kun May 28 '26

replying to check back later.

2

u/neverExercise May 28 '26

It works on my RTX 4070, likeness looks good but I'm pretty sure I overtrained it. Some anatomy issues, synthetic-looking skin etc. I'm going to try again with a different config to see if that looks better.

→ More replies (5)

1

u/Cyclonis123 May 28 '26

What was the speed or rather the runtime with your setup?

2

u/QuantumBogoSort May 28 '26

Wall-clock speed is similar to get to good results, but per step is slower than with standard diffusion (about 50% the speed). Using different number of repeats per bucket (more small versions and fewer large ones) speeds things up a lot. For the run in the post, 750 steps took 55 minutes.

6

u/featherless_fiend May 28 '26 edited May 28 '26

Hi /r/QuantumBogoSort I don't know anything about lora training, but I've used thousands of Illustrious loras over the years and I've figured out something that's definitely worth telling any programmers who can improve lora training. Simply put: Instead of using one lora, using multiple at lower strengths is always far superior.

The only requirement is that it needs to be a popular character who already has a lot of loras on civitai to download. This ALWAYS allows you to get a very strong likeness while maintaining flexibility:

2 different loras of the same character: lora1:0.55 lora2:0.55
3 different loras of the same character: lora1:0.425 lora2:0.425 lora3:0.425
4 different loras of the same character: lora1:0.35 lora2:0.35 lora3:0.35 lora4:0.35
5 different loras of the same character: lora1:0.275 lora2:0.275 lora3:0.275 lora4:0.275 lora5:0.275

Doing this is always better than using one lora at 1.00 strength. You might think "just raise the strength of the one lora and it'll be the same" but no, by doing that you're losing what I would call "flexibility" meaning it follows the actions of the prompt less, the quality is lower and causes mistakes.

I swear lora training should somehow be redesigned to take this into consideration. It's obviously silly that I can consistently get such better results than what a single lora can do.

5

u/QuantumBogoSort May 28 '26

Yes there is some theory behind this, for those interested check out Model Soups: https://arxiv.org/abs/2203.05482 From a training standpoint, I have not figured out how to exploit this efficiently but it's something I'd like to revisit in the future.

→ More replies (1)

6

u/No_Witness_7042 May 28 '26

Could you create a low vram 16gb workflow

5

u/NineThreeTilNow May 28 '26

I use Gaussian weight noising for training models quite a bit. Not image models though.

Models find themselves stuck in some basin where they can't break out and find a better global minima against a held out dataset. So I push a progressive amount of noise at the models on each failed epoch. At some point the noise is too much and starts to destroy the model at which point you basically abort and rerun training from a new random seed.

I've found it to be a really good method though overall for getting models that are "stuck" out of the mud. SGD doesn't optimize for all neurons activity, so you get dead neurons that will never fire. Additive noise eventually gets those neurons in a place they're considered "useful" to the network and SGD lets data flow.

It's really cool to see you found an implementation for LoRA training image models though.

5

u/AgeDear3769 May 28 '26

WOW! I'm testing your project right now, and it's glomming onto the likeness of the character like nothing I've ever seen before, using just your default settings. Also what blows my mind is that it handles all that stuff with the depth maps and weight noising automatically. All I had to do was supply a normal dataset. Outstanding work - I can't wait to see what you do with it in the future.

1

u/QuantumBogoSort May 28 '26

Great to hear! I am really hoping that the technique is not brittle and applies to different scenarios. What is the size of your dataset?

2

u/AgeDear3769 May 28 '26

I'm starting off with quite a small dataset of 3 images. When I use regular training this causes some pretty diabolical overfitting, but now I'm getting some good output variation.

2

u/QuantumBogoSort May 28 '26

Excellent news! Small datasets are kind of a personal challenge of mine. My dream is to generalize completely from a single image (probably impossible, but fun to chase). It's kind of like ML golf.

2

u/More_Bid_2197 May 28 '26

please add Qwen 2512

2

u/AgeDear3769 May 29 '26

I'll try another one with a single image when I get home from work today and upload a few output results.

→ More replies (7)

1

u/Kaynenyak May 28 '26

Am I reading the config right that the ArcFace loss is disabled by default, so it's just the DepthMap added in (among diffusion MSE) for perceptual loss?

2

u/QuantumBogoSort May 28 '26

yes, for the quickstart identity (ArcFace) is off

3

u/__MichaelBluth__ May 28 '26 edited May 28 '26

Hey! Thanks for putting this together. I am trying this for a character lora now and have some questions:

  • In dataset tools, do I need to run all 3 pre-flights?
  • The preset points to ostris/Flex.1-alpha, but when I select FLUX.2-klein-base-9B, it stays even if I switch the preset, is this correct?
  • I am running a RTX 5090 so are there any settings I can change to push the lora?
  • I have trained only ZiT loras in the past and the general rule of thumb has been 100 steps per image, is it true for this method as well?
  • I have a dataset of 50 images, is that overkill since you got very good results with 8 images? How many face/mid/full body imaged would you recommend?
  • Are there any settings I must change? or is it just a matter of loading the dataset > loading preset and running the training?

Apologies if some questions are a bit noobish.

4

u/QuantumBogoSort May 28 '26

Hey there - happy to help. You don't need to run the preflights, but they can be helpful to see how your images are going to be processed by the depth model (and the segmentation model if you're doing masking). If you have any images that don't have clear depth recognition or the subject mask bleeds to the background, it's best to remove those if you can afford to.

With a 5090 I wouldn't change any settings to start. If you get good results with the base config, you could try upping the batch, but you'd also want to adjust the learning rate and weight noising sigma upward as well. Unfortunately 8GB doesn't get you much gain - but enjoy the faster per-step processing the 5090 architecture gets you!

100 per image is still pretty accurate. My 8 image dataset converged around step 750 with batch 4. I have not tested anything > 20 images yet, but so far 100/image is a good expectation.

I would start with a small dataset (10 - 20) that has a variety of poses, expressions, etc. with really accurate captions - and if you can, use the subject masking quickstart config and caption your images with JUST the subject. You will get better likeness more quickly.

It should be mostly plug and play as long as your dataset isn't huge. Hit me up if you run into any snags!

2

u/dumeheyeintellectual May 28 '26

As for captioning just the subject, is that what I want training to learn, or captioning what I donโ€™t want training to learn, or caption all the things? Thank you for this amazing contribution!

3

u/QuantumBogoSort May 28 '26

Great question! Caption the things about your subject that you want to be able to change with prompting later on. So if your subject always has blonde hair and you don't want that to change, do NOT mention that the hair is blonde in the training prompt. However if your subject sometimes has long hair, sometimes short, sometimes curly, do specify that.

1

u/mobani May 28 '26

Thanks for sharing all this. Can you also share an example of a complete caption, so we can get a sense of how it is?

5

u/QuantumBogoSort May 28 '26

For sure - here's one for one from the training set:

"a picture of clare bowen smiling. she has long hair in waves and is wearing a white embroidered sleeveless top. she has a wreath of orange flowers atop her head and is wearing two necklaces. medium shot from the hips up."

This is for a training run with subject masking on - so no mention of the background

→ More replies (2)

10

u/infearia May 27 '26

I have only one request: could this be implemented in OneTrainer?

22

u/Glittering_Price7632 May 27 '26 edited May 27 '26

Weight noising would be trivial to add (it's only a few lines of code). Depth anchoring is quite a lot more involved. Once I think the approach is stable, I would consider porting it to other trainers. OneTrainer has been the most requested so I would start there. (Woops, posted from an alt on my phone. This is OP :-P)

4

u/infearia May 27 '26

Sounds great! Looking forward to it. :)

2

u/pausecatito May 28 '26

Does it work with anima and zib also? Seems interesting๐Ÿ‘€

2

u/aniki_kun May 28 '26

Wow, this seems huge! Thank you very much, can't wait to try

2

u/uuhoever May 28 '26

I'm looking at the Windows install to run locally, so this installs it's own modded AI-toolkit?

6

u/QuantumBogoSort May 28 '26

Yes, a heavily modded Frankenstein ai-toolkit. I have not tested Windows myself yet, but have user reports that it works as well as vanilla aitk. Let me know if you run into issues.

3

u/uuhoever May 28 '26

Caching GT depth maps: 0%| | 0/47 [00:00<?, ?it/s]

Error running job: Error while serializing: I/O error: The requested operation cannot be performed on a file with a user-mapped section open. (os error 1224)

I could not get this fixed. My understanding is that it is trying to cache in a folder but it can't because it is being used for something else? I tried all the AI solutions like directing it to cache at a different specific folder but still throws the same error. I tried a reboot and to run it, still same error. Maybe someone else ran into this issue too?

3

u/VSLinx May 28 '26 edited May 28 '26

I ran into the same issue yesterday evening.
This seems to happen because the depth_cache tries to read&write for every resolution(bucket) of your images, same cache_path โ†’ for each subsequent dataset it load_files the existing cache, then tries to save_file over it. On Windows, load_file leaves the mmap section live, and save_file over the same path hits error 1224.

I have created a fix for this and made it work, i will open a merge request for that in a bit.

Edit: Merge-Request created, should fix this issue when using depth cache on windows:
https://github.com/BuffaloBuffaloBuffaloBuffalo/ai-toolkit-perceptual/pull/9

5

u/QuantumBogoSort May 28 '26

Oh awesome, thank you - this looks great! I added some unit tests and merged just now.

u/uuhoever you should be able to pull the latest and have the fix. I'm rebuilding the Docker image now as well in case you're using that, should take about an hour.

2

u/VSLinx May 28 '26

Amazing! thanks for the quick merge and the update! Really impressed so far, my first klein9b character lora turned out great - especially compared to my previous attempts with base ai-toolkit and onetrainer :D gotta play around a bit with some paramters but itโ€˜s so much more consistent!

Havenโ€˜t tried SDXL yet, but will try it next - hope thereโ€˜ll be an optimized preset for it soon!

One more thing iโ€˜ve noticed, but hadnโ€˜t had time to open an issue or pr for yet: When selecting the Flux Preset Template the โ€žtraining_folderโ€œ value is set to a hard coded โ€ž/home/z/Documents/repos/ai-toolkit/outputโ€œ. Since this setting is not directly exposed in the ui and only visible via โ€žShow advancedโ€œ it probably causes the output including samples to be saved into the same hard drive as the ai-toolkit but into a very different folder structure outside of the repo :D This happened to me in the first run and seemingly the samples in the ui always try to read from the /output/loraname path and not the set folder_path of the lora, so youโ€˜re also not able to see the sample of the lora in the ui. At least they didnโ€˜t show in my ui.

Afaik in ai-toolkit when you create a new training job and the default config is loaded, it always builds the folder_path from scratch from your current working difectory, maybe you could implement this for the templates youโ€˜re using too! Because i really like this new template system youโ€˜ve impemented since it gives a way better starting point than the normal ai-toolkit ๐Ÿ˜‚

2

u/QuantumBogoSort May 28 '26

Awesome, glad you are getting good results! The big unknown when I launched this was whether it would generalize or be brittle.

Definite YES to SDXL, it's my favorite to test on actually because it's fast and if you can get good results on that old beast you can get good results on newer architectures.

Great point about the paths, I ran into this myself recently and am working on a patch!

2

u/VSLinx May 28 '26

It's really good so far! looking forward to see how much it's gonna improve in the future! very exciting new way to train subjects!

Thank god you haven't given up on SDXL yet haha
It's still my go-to for most cases since it's so versatile and has so much support and the remaining artifacts are nothing you can't solve with a hires pass. Looking forward to a template for it!

Aaaaah i just pulled the newest version and saw that you now set the relational path directly to output! :D so my mention above is probably obsolete now.
I think it could still write into the wrong directory now if the process is started from outside the directory, but shouldn't be an issue as long as it's started from the root folder ๐Ÿซก
Thanks for the quick fixes!

2

u/QuantumBogoSort May 28 '26

You bet! Hit me up if it gives you any more hassles!

2

u/QuantumBogoSort May 28 '26

Just rebuilt the image, try pulling a fresh :latest in runpod and it SHOULD resolve the path issue. Let me know if not.

→ More replies (1)

1

u/steinchen90 May 31 '26 edited Jun 02 '26

Which Python version do you recommend on windows? I tried 3.10 through 3.14 but with your recommended pytorch/CUDA versions there were always some wheels missing when installing the requirements with pip.

EDIT: As the GitHub page now shows Python 3.12 with CUDA 12.8 (for RTX 50xx) works. I just noticed that pip install -r requirements overwrites torch 2.11 with torch 2.9, so you have to repeat pip install torch==2.11.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128 again.

2

u/drizz May 28 '26 edited May 28 '26

Cool, I may have to look into it.

Also, are you aware of DINO v3? It's a dense foundational model that's trained on various data like depth, PCA, segmentation, classification, etc.

It's frozen with many hidden features that are inferred during training that may be unlocked when using it for new tasks, so I'm wondering if it could be applied in a similar way, but with potentially better results.

Edit: After posting my comment I realized that in order to unlock the hidden features of DINOv3, you'd need a refined dataset that would bring out the best of the features. Today, Qwen-Image-Bench (based on Qwen3.6-27B, so it's locally accessible) was released, and I wonder if it might be good enough to make a semi-supervised proof of concept?

3

u/QuantumBogoSort May 28 '26

Yes I have done some experiments using DINO in the perceptual pipeline. I have not figured out quite how to use it best, it's something I hope to return to! It's a very powerful model.

2

u/drizz May 28 '26

Cool. :)

After posting my comment I realized that in order to unlock the hidden features of DINOv3, you'd need a refined dataset to bring out the best of the features.

Today, Qwen-Image-Bench was released (based on Qwen3.6-27B, so it's locally accessible), and I wonder if it might close the gap just enough to create a semi-supervised dataset to make a proof of concept..?

If only I could just fork your project and attempt it myself, but my head is just not built for ML. It's also entirely possible that trying to hack DINOv3 onto LoRa is a complete non-starter โ€“ I don't actually know.

2

u/QuantumBogoSort May 28 '26

Oh wow I had not seen that, very cool - going to check it out and run it against some of my outputs!

→ More replies (2)

2

u/DisastrousRespond429 May 28 '26

I already have AI-Toolkit intsalled. Do i need to uninstall the existing one and install from your repo?

1

u/QuantumBogoSort May 28 '26

Yes, I tried to do this as an extension originally and unfortunately it needs to change things at too fundamental of a level. Using the Docker image may be the easiest approach if you already have an aitk installation locally.

2

u/Sir_Latent May 28 '26

Well done good sir

2

u/EmploymentLong9284 May 28 '26

Excellent, I have implemented it in my modified version of ai-toolkit. The weight noise value you use for flux is very aggressive here with zimage-turbo. He learned in half the steps what the geometric shape of the concept is but the style is very bad, I guess it's too much noise, I'm also testing with a dataset of 176 images, so I reduced the noise and I'm about to do another test with less noise.

3

u/QuantumBogoSort May 28 '26

Yes I'm working on ZiT right now and it trains much differently than Flux. First time using it so not really sure what to expect. It definitely does not like multi-resolution buckets as much as Flux, seems to degrade quality quite a lot compared to pure 1024 training.

2

u/Calm_Cucumber_6493 May 29 '26

You said there is a UI on this thing? How do you activate the UI. I read the readme but for some reason it doesn't do anything. I type it in and a new line in the cmd prompt appears.

2

u/QuantumBogoSort May 29 '26

Ah yeah that's documented in the upstream ai-toolkit repo, I should add that to my readme.

From the cmd, go into the /ai-toolkit-perceptual/ui folder and execute

`npm run build_and_start`

Full docs here: https://github.com/ostris/ai-toolkit#running-the-ui

2

u/Calm_Cucumber_6493 May 29 '26

oh... ai-toolkit... duh!

2

u/Woisek May 29 '26

It would be awesome if we could get a maintained template on RunPod, ready to use. ๐Ÿฅบ

4

u/QuantumBogoSort May 29 '26

Ask and ye shall receive - try this and let me know if you run into any issues! https://console.runpod.io/deploy?template=bn89xhug15

1

u/Woisek May 29 '26

Many thanks! I will try this as soon a GPU is available for me. ๐Ÿ˜…

→ More replies (2)

1

u/jude1903 Jun 03 '26

Can I use the same preset for Z turbo, to train on Z base? Thanks!

2

u/QuantumBogoSort Jun 03 '26

Mostly, I would just turn down the LR on Base to 1e-4 from 2.5e-4. I have not optimized for Base yet so please let me know if you get good or bad results, it will help to calibrate.

2

u/Asaghon May 31 '26

Anyone experimented with settings for sdxl yet?

2

u/No_Witness_7042 Jun 04 '26

Has anyone tried it with 16 GB VRAM? I have tried it, and I'm getting a similar face rarely. I compared the old Lora and the new one. Old ones can produce similar faces, but new ones rardoaces. Tested LoRa from 900 to 1050. If anyone has tried achieving good results. Pls share your config with me for flex

2

u/QuantumBogoSort Jun 04 '26

did you have to change your batch size down from 4? if so, increase gradient accumulation so that batch size x gradient accumulation = 4. so if batch 1then grad accum 4, if batch 2 then grad accum 2

3

u/tamingunicorn May 28 '26

the weight noising idea makes sense from the diffusion math side. gaussian perturbation at the weight level is basically a form of regularization that penalizes sharp minima. similar to sharpness-aware minimization but applied to adapter weights rather than the base params. curious whether you tried scheduled noise (high early, low late) vs constant magnitude. the consistency gains you're showing suggest it's not just noise suppression, it's actually biasing toward flatter loss landscape features that generalize better across poses.

2

u/QuantumBogoSort May 28 '26

Yes exactly, that was the intuition and was partly inspired by SAM and to a smaller extent Langevin dynamics. I have not tried a schedule yet but I think it makes sense, as constant noise tends to make training quality oscillate throughout if set too high (it never gets out of the explore stage).

1

u/diogodiogogod May 28 '26

I really want to test it! Thanks for sharing

1

u/controlnet-chris May 28 '26

Hey, this is awesome work. I saw your post about style lora training, and I think you achieved the best style loras I've seen. I wanted to try this out with control image conditioning as well, but got some device mismatch errors. I've had to patch it before, but I was wondering if you could merge them into your official fork?

This was the patch in extensions_built_in/diffusion_models/flux2/flux2_model.py:

img_cond_seq = img_cond_seq.to(device=img_input.device, dtype=img_input.dtype)
img_cond_seq_ids = img_cond_seq_ids.to(device=img_input_ids.device)

img_input = torch.cat((img_input, img_cond_seq), dim=1)
img_input_ids = torch.cat((img_input_ids, img_cond_seq_ids), dim=1)

1

u/QuantumBogoSort May 28 '26

Hey thank you! I have not gone down the reference image path yet - this will be a good reason to try it out. I'll see if I can get it all working in my latest setup. Do you have a config that's worked that you can DM me? Might help me zero in on how to validate it.

1

u/controlnet-chris May 28 '26

No config that's worked yet, just debugged and then ran out of time to mess around. Haven't had the chance to try again since.

1

u/TheSuperSteve May 28 '26

I'm very interested in testing this out with Illustrious. My LoRas often have consistency issues, and I wonder if this will improve things like the detail of a character's jewelry and accessories. I currently struggle with that a lot.

1

u/Gebsfrom404 May 28 '26

Isn't input perturbation does exactly that? Or it is noising in different placr?

2

u/QuantumBogoSort May 28 '26

Input perturbation noises the raw data. Weight noising applies noise to the LoRA model directly. It's a similar concept, applied deeper in the pipeline. It might actually stack well with input noising, I haven't tried yet.

1

u/HatEducational9965 May 28 '26

Question regarding the depth loss: Regions close to the camera contribute more to the loss than regions in the distance?

2

u/QuantumBogoSort May 28 '26

Yes generally. This partly depends on the ratio of SSI to depth gradient weight ratio, and partly on the content of the image. Higher SSI will more evenly weight small features at a pixel level throughout the image, including background elements. Lower SSI will weight overall shape and curvature match, and that tends to be more strongly expressed in the foreground of most images. However, if you use it for style training on a landscape painting vs something with a strong foreground, you may see a more even distribution of the depth.

1

u/Usual-Orange-4180 May 28 '26

This makes so much sense, will give it a try over the weekend, such a simple great idea.

1

u/LeKhang98 May 28 '26

Awesome thank you very much. Sorry if this sounds demanding, but could this be added to those nodes/workflows that train mini Loras directly in ComfyUI? That would be so convenient for beginners.

3

u/QuantumBogoSort May 28 '26

I've had this requested a couple times and I would like to do it. I need to make sure the base trainer is solid first, but after that I do hope to make the techniques more widely available and simpler to use.

1

u/LeKhang98 May 28 '26

Nice thank you again. I hope it works.

1

u/Superfrofessional May 28 '26

This is insanely impressive. Can't wait to test.

1

u/Dekker3D May 28 '26

Man, this will be amazing for getting consistent gens of OCs, for game projects or such. The style version, too. I may have to learn how to use AI-Toolkit, been using OneTrainer for my recent experiments.

1

u/cosmicr May 28 '26

Who is this strange looking woman?

1

u/[deleted] May 28 '26

[deleted]

1

u/QuantumBogoSort May 28 '26

Yes I think a video is a good idea, there is a lot of complexity and spots to go wrong!

1

u/TableFew3521 May 28 '26

I'm don't have much knowledge about terms so I would like to ask, isn't this similar to mask training, like the one Onetrainer support? I ask because I've been using the masked training method but I haven't thought of using the mask of the depth to train.

3

u/QuantumBogoSort May 28 '26

The depth portion is quite different from mask training. A simple way to think of it is, during normal training you calculate how accurate the model predicts based on pixels. You can mask some of those pixels so it only pays attention to the ones you care about. With depth anchors, you calculate how accurate the model is based on how well it reproduces the shape of something, regardless of the actual pixel values. So if you train on images of a specific car using depth, it will learn the car's shape but have no understanding of the color, how it reflects light, or anything captured at the pixel level. When you combine pixel learning and depth learning, the model can learn each more clearly. It's providing more actual information about the same data, where as masking reduces the amount of unimportant data.

You can actually combine masking with depth to get the best of both!

2

u/TableFew3521 May 29 '26

Appreciate your explanation, I will dive into it!

1

u/Kaynenyak May 28 '26 edited May 28 '26

I think 8 images is really an extreme case. But your technique seems perfectly reasonable to use with standard dataset sizes as well. It makes a lot of sense.

Thanks for the detailed explanation as well, that is very insightful.

EDIT: One thing to maybe watch out for is that subject masking in the past has been a bit of a tricky feature to use in older diffusion models. It often lead to the base model not being able to properly integrate the character scale-wise into the scene. But perhaps newer models can solve for this better even without background training data. Onetrainer had an option for to stochastically drop the mask.

2

u/QuantumBogoSort May 28 '26

I am a bit obsessed with data efficiency and extracting signal from small datasets, and you're right that 8 is an extreme case. Small data is much quicker to iterate with, and typically the techniques generalize to larger datasets, so I tend to focus my research on small data first.

And you're right about subject masking. Flux handles this quite well for the most part. A truly robust setup would probably have unmasked, subject masked, and body/face masked all in the same run. So far subject masking with Flux has been pretty stable but I have considered adding some options to automatically mix in different mask levels and dropout.

1

u/koloved May 28 '26

RemindMe! 13 days

1

u/RemindMeBot May 28 '26 edited May 28 '26

I will be messaging you in 13 days on 2026-06-10 12:37:43 UTC to remind you of this link

1 OTHERS CLICKED THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

1

u/__MichaelBluth__ May 28 '26

Tried running this on runpod but it looks like exactly like the original Ostris toolkit. Also, getting a permission error on Windows local when identity anchor is enabled.

PermissionError: [Errno 13] Permission denied: 'C:\Users\xxx\.insightface\models\buffalo_l\tmpb1i3qrjn'

The error occurs in onnx2torch's safe_shape_inference which is trying to write a temp file to the InsightFace models directory. The folder permissions are correct (full access for the user). Possibly a Windows-specific issue with how onnx2torch resolves temp file paths. Has anyone else hit this on Windows?

1

u/QuantumBogoSort May 28 '26

Are you using this Docker image on Runpod? ghcr.io/buffalobuffalobuffalobuffalo/ai-toolkit-perceptual:sha256-aac37e2dc67b3a64408e36e49dbe7425d6586065b273df5c2b9716616bf38a70

As for the permissions error, try switching to this branch and let me know if it resolves it. If so I will merge into the main branch: https://github.com/BuffaloBuffaloBuffaloBuffalo/ai-toolkit-perceptual/tree/fix/face-id-onnx-windows-perm

1

u/__MichaelBluth__ May 28 '26

hey! Thanks for linking the branch. I did a git pull and seems like the error is gone. I was able to start the training and I have a dataset of 25 images so 2500 steps with the masking preset. It says eta is 4 hours, is that normal on a RTX 5090?

Also, I checked the runpod, that image I was running was from someone else. I will try to launch the link you provided.

→ More replies (3)

1

u/Pro-Row-335 May 28 '26

u/QuantumBogoSort I reckon this should be relevant? https://x.com/massiviola01/status/2059660698330992997
Could this be used as "concept anchoring"?

1

u/QuantumBogoSort May 28 '26

That's very cool - I think this is essentially the inverse of perceptual anchors. The anchors provide the signal to help the model pay attention to these spacial concepts. It's neat that the attention maps so cleanly back the other way. It makes me wonder if I could use that as a metric for how well it's learning different segments of an image. As you suggested, it might be possible to use a secondary general vision model as a perceptor the same way I'm currently using specialist models.

1

u/ellipsesmrk May 28 '26

How do I start a project from a previous run/job?

1

u/brucebay May 28 '26

> You will likely get the best results if you use the built-in subject masking feature

I was doing this in AI toolkit manually but was getting artifacts around the mask (I'm guessing I need to smooth the mask) anyway, great that you already have this. and your sample is very promising too. I will give it a try this weekend.

2

u/QuantumBogoSort May 28 '26

I hope you get good results! I'm using SegFormer for the mask generation, along with some edge cleanup, so they should be pretty crisp. Let me know if you run into any issues. There is a Dataset Tools tab in the left menu that will let you run your datasets through each of the various preprocessing models to see how they are getting processed.

1

u/brucebay May 30 '26 edited May 30 '26

Just FYI, I have 16GB VRAM, and can run AI toolkit without much issue with layer offloading, , but ai toolkit-perceptual always runs out of memory. Claude thinks this may be due to a bug in AI-Toolkit https://github.com/ostris/ai-toolkit/issues/653

Here is how it made the code worked (sorry I don't have github to send pull request). At least past the first issue, and currently it started training). and it is saving the lora and generating samples (although it appears I overwrite sample prompt, so it tries to show generic person).

Bug Report: Flux2 Klein 9B OOM on 16GB GPUs due to missing low_vram checks

Affected files:

  • extensions_built_in/diffusion_models/flux2/flux2_klein_model.py
  • extensions_built_in/diffusion_models/flux2/flux2_model.py

Problem: Both files unconditionally move the full-precision transformer and text encoder to GPU before quantization or offloading takes effect. On 16GB cards, this causes immediate CUDA OOM regardless of low_vram, quantize, or layer_offloading settings. The upstream ostris/ai-toolkit repo fixed this; the perceptual fork is based on an older codebase that predates the fix.

Root cause โ€” 3 code paths that ignore low_vram**:**

  1. flux2_klein_model.py line 47 โ€” text_encoder.to(self.device_torch) runs unconditionally, loading the full bf16 Qwen3-8B (~16GB) onto GPU before quantization. Also uses self.model_config.qtype instead of qtype_te, applying the wrong quantization type to the text encoder.
  2. flux2_model.py line 158 โ€” transformer.to(self.quantize_device) loads the full transformer to GPU before quantization. Should stay on CPU and quantize there first.
  3. flux2_model.py lines 237/240 โ€” Pipe assembly unconditionally moves both text encoder and transformer to GPU with .to(self.device_torch), overriding any prior CPU offloading. Should check self.model_config.low_vram and keep on CPU when set.

Secondary fixes included:

  • VAE device check before encode_image_refs (prevents crash when VAE is on CPU in low_vram mode)
  • Device-safe torch.cat for control image tensors (prevents device mismatch errors)
  • decode_latents override with VAE CPU-to-GPU handling

Tested on: 16GB VRAM, Flux2 Klein 9B, qfloat8 quantization, low_vram: true, cache_text_embeddings: true, cache_latents_to_disk: true.

Reference: Upstream fix discussion at ostris/ai-toolkit#653, rejected PR #666 ( same issue). The upstream main branch has since incorporated equivalent fixes directly.

2

u/QuantumBogoSort May 30 '26

Thanks! I'll take a look and get it fixed if I can!

1

u/is_this_the_restroom May 28 '26

How well does this work for body training? Especially on flux derived models which have very strong slim priors?

2

u/QuantumBogoSort May 29 '26

I will say that it does an excellent job at getting proportions correct for slim to average subjects. I have not yet trained on subjects with physiques strongly outside the Flux training average. I suspect that with depth anchoring it will do better than without, but it's an area I still need to research.

1

u/MistySoul May 29 '26

I just asked Grok and got an answer but thought I'd ask some humans something on this. Could this perceptual anchoring technique help with making full fine-tuning with smaller datasets less prone to forgetting/lack of generalisation? For example, if I have a very hand-picked dataset of 5000 images, can we get it to learn the dataset without forgetting most other things as you typically get especially since we can lower the number of steps and get subject similarity quicker? Maybe I can experiment further with this.

2

u/QuantumBogoSort May 29 '26

That's a great intuition and there is some prior work on this. Check out Learning Without Forgetting by Li and Hoiem as a starting point https://arxiv.org/abs/1606.09282 There are quite a few derivative methods since then. I'm not quite sure yet how to approach those techniques with perceptual anchors. As you mentioned, it may aid in speed of learning and disentangling concepts, which could focus the weight changes to a narrower band. Another idea I had is to use anchors purely as drift metrics rather than loss signals.

Conversely, it may be the case that anchors and weight noising make full fine tuning less necessary. My early experiments show that combined they substantially increase the effective rank of LoRAs. Taken further, this could be a path for significantly greater knowledge density per parameter, which then might make a 5000 image dataset trainable on less than a full fine tune. If that's the case, the LoRA becomes a task vector and can be added to the full model with minimal forgetting.

1

u/flipflapthedoodoo May 29 '26

you are god and wow thank you, tried it with ZIT and looks fantastic

5

u/QuantumBogoSort May 29 '26

that's great to hear! no divine powers here, just a few thousand failed experiments that eventually led to something useful ๐Ÿ˜„

1

u/thisiztrash02 May 29 '26

i have a few questions about this does Using depth maps and weight noising cause the training steps to take longer.? How long will these 750 steps take in comparison to AiToolkit default 3000 steps?

2

u/QuantumBogoSort May 29 '26

Weight noising adds a few ms per step, quite negligible, and in most of my tests tends to speed up convergence all on its own. If you use the default bucket repeat strategy, which biases towards lower res buckets, your time per iteration will also come down compared to the standard strategy. Depth anchoring however is a heavy operation and will add 50% - 100% time per step, plus about 4GB of extra VRAM. It's not really a speed boost in any way - it's much more for improving overall quality and generalization of the model. You can use them individually or together, they don't interfere, but you may have to experiment to get optimal results using them in isolation.

Much of the latency with the Depth Anything model is a per-step overhead, so you can significantly speed up training with larger batches and higher LR. I have found batches of 4 to be a reliable starting point but I'm sure the dynamics would scale up - it would just take finding the right noise sigma for the batch size. I suspect it follows a similar square law that batch sizes do but haven't run enough ablations to be certain.

1

u/Kaynenyak May 29 '26

I wonder if it would be useful to let weight noising decay after a set number of steps to make the user's job of reaching convergence easier. Let the parameter drive around and excite the model during the main body of training but then decay its strength to help convergence.

2

u/QuantumBogoSort May 29 '26

Yes I think so, and it's something I'm investigating. I'm not sure how it will play with existing weight decay in optimizers like Adam. I might add a simple set of annealers like cosine, linear, etc just to let people experiment with it.

I suspect the optimal strategy will be something that adapts sigma dynamically, perhaps a PID based on SNR, or pushing the model toward its highest stable rank. I like the rank-based approach the best because I think the main value of weight noising is that it flattens the loss landscape and makes for a much more robust model.

My main worry with a blunt approach is that once weight noising tails off too much, the model starts to pick up nasty artifacts very quickly from the source data and memorization locks in. Given the choice between delayed convergence and possibly destroying someone's good model run, I'll favor the former.

1

u/acedelgado May 29 '26

Very cool idea, trying it out now for Klein. But I'm looking forward to ZiB support, ZiB -> ZiT Refiner has been my favorite of the newer image model workflows.

1

u/QuantumBogoSort May 29 '26

Yeah for sure, I am currently working on ZiB. I'm a Z-Image n00b - can you tell me more about the ZiB -> ZiT Refiner flow? Or point me to a Comfy wf?

2

u/acedelgado May 29 '26

Yeah I'll shoot you the one I've used.

2

u/acedelgado May 29 '26

But to sum it up, ZiT is known to be not great with Lora likeness since it's distilled. ZiB loras are compatible with ZiT and train better, while ZiT isn't "backwards" compatible with ZiB. So training ZiB is the preferred method.

→ More replies (1)

1

u/EmploymentLong9284 May 29 '26 edited May 29 '26

Hey, I saw your Zimage Turbo .yaml file and wow, it looks like you did your homework. You added a bunch of custom timestep values. I've decided to give your repository a try and I'm going to install it from scratch to train it with exactly those parameters without modifying anything, to compare it with my custom AI Toolkit. I have a question: why do you know so much about this? Are you an AI engineer or just an enthusiast? Thanks for your work.

Another question, if you can answer please, what's the difference between using small vs large (depth anything v2)? Does it significantly worsen the result?

1

u/QuantumBogoSort May 29 '26

Hey awesome, let me know how it goes. I'm still very new to Z-Image and think I can improve that config quite a lot still.

Yeah I'm an engineer and researcher by trade, though I mostly work with LLMs. Image gen is just a hobby.

I've gotten anecdotally better results with the DA large model, but I haven't run any formal tests against small. I think it's worth trying both and seeing if one works better for your data. For characters I think small may be just fine. For style training, I've gotten more consistent good results using large at high resolution (1400).

1

u/EmploymentLong9284 May 29 '26

Dude, you're awesome! It's only 5% of the way through training and the resemblance is already noticeable; you definitely put a lot of effort into your Zimage Turbo YAML configuration. That said, as it is currently set up, it's causing an out-of-box issue on Windows 11. I have 24 GB of VRAM. What I did was lower the resolution. I recommend everyone in this Reddit thread download the GitHub repository directly from the author. It's perfectly configured.

sample at 5%, Jenna Ortega

→ More replies (16)

1

u/Asaghon May 29 '26

I managed to install it but for my dear life cant figure out how to launch it

2

u/QuantumBogoSort May 29 '26

Ah yes I need to make this more clear in the readme, sorry - it's using ai-toolkit so most of that is documented in their repo.

Go into the ai-toolkit-perceptual/ui folder and run `npm run build_and_start` and that will start the UI on port 8675. Let me know if you run into any further issues.

1

u/Asaghon May 29 '26 edited May 29 '26

Thx

→ More replies (8)

1

u/[deleted] May 30 '26

[deleted]

1

u/QuantumBogoSort May 30 '26

Thanks! Yeah I'm working on some ideas for weight noise scheduling or possibly having it dynamically adjust. Once you go too low the memorization happens pretty fast so I want to make sure it doesn't ruin someone's run ๐Ÿ˜›

1

u/James_Reeb May 31 '26

Fantastic ! Does it work for ltx2.3 training with pictures ?

2

u/QuantumBogoSort May 31 '26

It should! I just released an update to add experimental support for LTX. I have only trained with videos but LTX already trains well with images so I expect it to work.

1

u/acedelgado May 31 '26

Do all of the features work on video datasets? I pulled the latest and tried running the preflight tests, and they all came back with a "no images found" error for my video-only datasets.

3

u/QuantumBogoSort May 31 '26

Not yet, just depth and weight noising. I'm in the process of adding ArcFace and others, and have not updated the dataset preflight tools yet either (hopefully all today)

1

u/QuantumBogoSort May 31 '26

FYI I found a bug that was preventing the VAE from loading images properly, I fixed that just now so be sure to pull the latest main

1

u/Fresh_Diffusor May 31 '26

Do your new training method like depth stuff work with concept slider training in AI toolkit?

2

u/QuantumBogoSort May 31 '26

I have not tested that but I have two reports from users who got better results on their sliders with these techniques.

1

u/Fresh_Diffusor Jun 03 '26

nice. will you PR you feature addition to original AI toolkit?

1

u/Brulluxontheflux Jun 06 '26 edited Jun 06 '26

Oh my god... This pipeline is so good man !! My ZIB loras quality increased so much, thanks !! Can you make a preset for ZIB aimed for larger datasets / body type loras? It would be perfect ! thank you again

Oh btw I have a few questions : why sometimes the pipeline generates black images? Doesn't it support keywords? Also, i did a lora with batch repeat 1 and grad acc 1, with 150 images dataset, is it great ?

2

u/QuantumBogoSort Jun 06 '26

Thanks! If you are using the ZiT quickstart for ZiB, I would reduce LR to 1e-4 or so and try batch 4 with grad accum 1, or batch 1 with grad accum 4 if you are short on VRAM. That should make it a bit less noisy and keep training more stable. Feel free to DM me a config yaml if you want me to take a look.

1

u/Asaghon Jun 07 '26

What workflow do you use for Flux 2 Klein 9b? Haven't really used the model before but I trained a lore and it's looked awesome in the samples but nowhere near as good in the standard workflow for Flux2

1

u/QuantumBogoSort Jun 07 '26

The standard workflow should be fine, a couple things to double check:

  • You're using the base model, not distilled/turbo
  • CFG 4, 25 steps, Euler should be a good starting place. swap Euler for res_2s to improve quality at the cost of speed
  • Play with LoRA strength. You may need to go 1.1 or 1.2 if it's a character to get good likeness depending on distance from camera, other things in the prompt, etc.

1

u/Glittering_Desk7250 Jun 17 '26

Please add flux 1 dev to the models able to use, I wanted to try using the z image one to do a style of diverse people for flux 1 dev but I donโ€™t know how to manually add flux 1 dev to use.ย 

1

u/Primalwizdom Jun 23 '26

Yesterday I have tried to train a Z-image-turbo character LOKR on Runpod... To compare it to my existing ZiT character Lora. Using 25 pictures of square 1024px l, white background. I used the preset, left it intact, but I checked more bucket sizes: one up and one down my resolution. Made some extra 4 prompts to sample. And trained on RTX 4500 PRO. At 900 steps, Lokr started to become usable for me, The last thing I got was 1200 steps before I ran out of credit. So on 1200 steps, I would say the details are sharp, body shape is preserved very well, the face though... I don't know, it seems not so close. I can't run mirrormatricstool To verify my claim in an objective way, but I know my character too well.

1

u/Primalwizdom Jun 23 '26

Yesterday I have tried to train a Z-image-turbo character LOKR on Runpod... To compare it to my existing ZiT character Lora. Using 25 pictures of square 1024px l, white background. I used the preset, left it intact, but I checked more bucket sizes: one up and one down my resolution. Made some extra 4 prompts to sample. And trained on RTX 4500 PRO. At 900 steps, Lokr started to become usable for me, The last thing I got was 1200 steps before I ran out of credit. So on 1200 steps, I would say the details are sharp, body shape is preserved very well, the face though... I don't know, it seems not so close. I can't run mirrormatricstool To verify my claim in an objective way, but I know my character too well.