--- license: other license_name: fair-ai-public-license-1.0-sd license_link: https://freedevproject.org/faipl-1.0-sd/ base_model: - CabalResearch/NoobAI-Flux2VAE-RectifiedFlow library_name: diffusers --- ## Model Details A continuation of the [NoobAI Flux2 VAE experiment](https://huggingface.co/CabalResearch/NoobAI-Flux2VAE-RectifiedFlow) More info on supporting us: [click me](https://huggingface.co/CabalResearch/NoobAI-Flux2VAE-RectifiedFlow-0.3#potential-future) ### Model Description Resumed for 4 more epochs, model has shown a nice improvement. We observe good convergence to new details, that were hard to achieve on prior arch. Compositions and stability are strongly improved relative to Epoch 2, as well as downstream trainability (like LoRAs). Current state is usable for normal generations, so we encourage you to try it. We will provide an [easy node for ComfyUI](https://github.com/Anzhc/SDXL-Flux2VAE-ComfyUI-Node), as well as basic workflow. If you are an A1111 user, please use [ReForge](https://github.com/Panchovix/stable-diffusion-webui-reForge), it has native support, instructions will be below. ![e2-6 progress](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/luRNeWtDiT78z-cfuMI8k.png) Once again, we are working with limited compute, but are quite happy with the result so far, and hope to continue working on the model. - **Developed by:** Cabal Research (Bluvoll, Anzhc) - **Funded by:** Community - **License:** [fair-ai-public-license-1.0-sd](https://freedevproject.org/faipl-1.0-sd/) - **Finetuned from model:** [NoobAI Flux2 VAE experiment](https://huggingface.co/CabalResearch/NoobAI-Flux2VAE-RectifiedFlow) ## Bias and Limitations While we are seeing new level of details, it is still early to call it a day. Complex intersections, extremely small details, abstract and wide shots will pose a significant challenge to model and result in noise-like patterns, but we see steady progression in resolving that noise through epochs. Most biases of official dataset will apply(Blue Archive, etc.). We are yet to get to steady composition and anatomy, but good LoRAs help drastically with this at current stage. ## Model Output Examples ![00182-1507939795](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/aGUOjzYm857vyJ4Bw3A3s.png) ![00175-1757655322](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/910YmdSXDkPfixIwyKbfv.png) ![00180-26729011](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/19dUzddyfZDdBfWI38B5P.png) ![00177-246779580](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/6ZZQd3m5TeG2OQYbaDSeq.png) ![00178-1560785548](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/RzsGySlS8YEBLginowFSZ.png) ![00181-1519334009](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/2dZug4PjLhmgr7YSTaOFe.png) ![00179-1426592070](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/gsWqweJ-__V2L4-a0sncF.png) P.S. We are pretty bad at generating images, on Epoch 2 we've seen quite a few examples of much better generations that what we've shown, wonder if this time it will also be the case. # Recommendations ### Inference #### Comfy ![image](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/urIE5XGaUpjkaXutaiebs.png) (Workflow is available alongside model in repo) We will provide a Node, and hope it will be adapted natively in main repo eventually: **https://github.com/Anzhc/SDXL-Flux2VAE-ComfyUI-Node** Same as your normal inference, but with addition of SD3 sampling node, as this model is Flow-based. Recommended Parameters: **Sampler**: Euler, Euler A, DPM++ SDE, etc. **Steps**: 20-28 **CFG**: 6-9 **Shift**: 3-12 **Schedule**: Normal/Simple/SGM Uniform/Quadratic **Positive Quality Tags**: `masterpiece, best quality` **Negative Tags**: `worst quality, normal quality, bad anatomy` #### A1111 WebUI (All screenshots are repeating our RF release, as there is no difference in setup) Recommended WebUI: [ReForge](https://github.com/Panchovix/stable-diffusion-webui-reForge) - has native support for Flow models, and we've PR'd our native support for Flux2vae-based SDXL modification. **How to use in ReForge**: ![изображение](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/UV5Yp66H7YlccdQqborPf.png) (ignore Sigma max field at the top, this is not used in RF) Support for RF in ReForge is being implemented through a built-in extension: ![изображение](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/LpMF0lmC96X001Au9fFU_.png) ![imagen](https://cdn-uploads.huggingface.co/production/uploads/634cf025fe861cc73a2e7dd0/siEBfX41E6D_DUEqaXMgs.png) Set parameters to that, and you're good to go. Flux2VAE does not currently have an appropriate high quality preview method, please use Approx Cheap option, which would allow you to see simple PCA projection(ReForge). Recommended Parameters: **Sampler**: Euler A Comfy RF, Euler A2, Euler, DPM++ SDE Comfy, etc. **ALL VARIANTS MUST BE RF OR COMFY, IF AVAILABLE. In ComfyUI routing is automatic, but not in the case of WebUI.** **Steps**: 20-28 **CFG**: 6-9 **Shift**: 3-12 **Schedule**: Normal/Simple/SGM Uniform **Positive Quality Tags**: `masterpiece, best quality` **Negative Tags**: `worst quality, normal quality, bad anatomy` **ADETAILER FIX FOR RF**: By default, Adetailer discards Advanced Model Sampling extension, which breaks RF. You need to add AMS to this part of settings: ![изображение](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/RQMtfm5Xi3V7oNsqXoZJN.png) Add: `advanced_model_sampling_script,advanced_model_sampling_script_backported` to there. If that does not work, go into adetailer extension, find args.py, open it, replace _builtin_scripts like this: ![изображение](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/rmnS-i_kciJzTZmeR-mGP.png) Here is a copypaste for easy copy: ``` _builtin_script = ( "advanced_model_sampling_script", "advanced_model_sampling_script_backported", "hypertile_script", "soft_inpainting", ) ``` Or use my fork of Adetailer - https://github.com/Anzhc/aadetailer-reforge ## Training ### Model Composition (Relative to base it's trained from) Unet: Same CLIP L: Same, Frozen CLIP G: Same, Frozen VAE: [Flux2 VAE](https://huggingface.co/black-forest-labs/FLUX.2-dev/tree/main/vae) ### Training Details (Main Stage Training) **Samples seen**(unbatched steps): ~50 million samples seen **Learning Rate**: 6-5e-5 (mixed) **Effective Batch size**: ~1400 **Precision**: Mixed BF16 **Optimizer**: AdamW8bit with Kahan Summation **Weight Decay**: 0.01 **Schedule**: Constant with warmup **Timestep Sampling Strategy**: Logit-Normal -0.2 1.5 (sometimes referred to as Lognorm), Shift 2.5 **Text Encoders**: Frozen **Keep Token**: False **Tag Dropout**: 10% **Uncond Dropout**: 10% **Shuffle**: True **VAE Conv Padding**: False **VAE Shift**: 0.0760 **VAE Scale**: 0.6043 **Additional Features used**: Protected Tags, Cosine Optimal Transport. #### Training Data 6 epochs of the original NoobAI dataset, including images up to October 2024, minus screencap data(was not shared). ### LoRA Training Current state of the model provides adequate trainability, but expect the need to train for a bit longer, as we are still undertrained. My current style training settings (Anzhc): **Learning Rate**: tested up to **7.5e-4** **Batch Size**: 144 (6 real * 24 accum), using SGA(Stochastic Gradient Accumulation) - without SGA I probably would lower accum to 4-8. **Optimizer**: Adamw8bit with Kahan summation **Schedule**: ReREX (Use REX for simplicity, or Cosine annealing) **Precision**: Full BF16 **Weight Decay**: 0.02 **Timestep Sampling Strategy**: Logit-Normal(either 0.0 1.0, or -0.2 1.5), Shift 2.5-4.5 **Dim/Alpha/Conv/Alpha**: 24/24/24/24 (Lycoris/Locon) **Text Encoders**: Frozen **Optimal Transport**: True **Expected Dataset Size**: 100-200 images (Can be even 10, but balance with repeats to roughly this target.) **Epochs**: 50 Concepts seem to train at similar speed to prior NoobAI models, but have not tested explicitly. ### Hardware Model was trained on cloud 8xH200 node. ### Software Custom fork of [SD-Scripts](https://github.com/bluvoll/sd-scripts)(maintained by Bluvoll) ## Acknowledgements ### Special Thanks **To a special supporter who singlehandidly sponsored whole run and preferred to stay anonymous** --- # Support If you wish to support our continuous effort of making waifus 0.2% better, you can do it here: ### **https://ko-fi.com/bluvoll** (Blu, donate here to support training) https://ko-fi.com/anzhc (Anzhc, non-training, just survival) ![image](https://cdn-uploads.huggingface.co/production/uploads/633b43d29fe04b13f46c8988/qpcOFLCI-B7QBADEYwMhA.png) Crypto link pending. # Potential future **Expected Compute Needed**: We still consider full run to be in range of 20+ epochs, but no longer think that it is the bare minimum for stable model, as progress with just current 6 epochs has been quite drastic in that regard. 10 epochs are likely a good marker for that. **Dataset**: We would love to start processing of the booru data with our in-house classification models to fix some of the glaring issues with the default Danbooru dataset, as well as thorough processing to some of the concepts, but we as of now we don't have budget to rent a dedicated server for persistent storage. **Future Training**: We have confirmation from Sponsor that we would continue training of the model beyond Epoch 6, but it will resume after a short break.