kohya-ss / kohya-ss/sd-scripts
Flux Schnell lora size is too small (1.42 MB) and Does not generate images of the character that it was trained on.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.2k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
I trained a custom character model using flux schnell, that training was success however the resulting lora is too small (1.42mb). And When I use that lora on the minimal inference I get totally different character that is not even close. My training dataset are well prepared and captioned well. Here are my configurations:
Config.toml:
```
pretrained_model_name_or_path = "/teamspace/studios/this_studio/kohya_ss/base/flux1-schnell.safetensors"
clip_l = "/teamspace/studios/this_studio/kohya_ss/base/clip_l.safetensors"
t5xxl = "/teamspace/studios/this_studio/kohya_ss/base/t5xxl_fp16.safetensors"
ae = "/teamspace/studios/this_studio/kohya_ss/base/ae.safetensors"
caption_extension = ".txt"
resolution = "1024,1024"
cache_latents = true
enable_bucket = true
bucket_no_upscale = true
output_dir = "/teamspace/studios/this_studio/kohya_ss/sd-scripts/trainings/model"
output_name = "w3r4jman"
save_precision = "bf16"
save_every_n_epochs = 1
train_batch_size = 2
max_token_length = 225
xformers = true
max_train_epochs = 10
persistent_data_loader_workers = true
gradient_checkpointing = true
mixed_precision = "bf16"
logging_dir = "/teamspace/studios/this_studio/kohya_ss/sd-scripts/trainings/log"
sample_every_n_epochs = 1
sample_prompts = "/teamspace/studios/this_studio/kohya_ss/sd-scripts/trainings/prompt.txt"
sample_sampler = "euler_a"
optimizer_type = "AdamW8bit"
learning_rate = 0.0001
lr_scheduler = "cosine_with_restarts"
lr_warmup_steps = 500
lr_scheduler_num_cycles = 3
dataset_config = "/teamspace/studios/this_studio/kohya_ss/sd-scripts/trainings/dataset_config.toml"
unet_lr = 0.0001
text_encoder_lr = 5e-5
network_module = "networks.lora"
network_dim = 8
network_alpha = 1
```
dataset_config.toml:
```
[[datasets]]
[[datasets.subsets]]
image_dir = '/teamspace/studios/this_studio/kohya_ss/sd-scripts/trainings/img'
caption_extension = '.txt'
class_tokens = 'w3r4jman'
num_repeats = 30
```
When I trained on sdxl base model on the same dataset and config, I got a lora size 57mb and that works good. So where is the problem in this case, can someone help me.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the Flux Schnell training with Config.toml and dataset_config.toml, then compare the generated LoRA with the working SDXL run using the same dataset. Check the training and minimal-inference entry points to determine whether the 1.42 MB output and character mismatch are expected or indicate a configuration problem. Done means identifying the cause and documenting a verified correction or limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100