kohya-ss / kohya-ss/sd-scripts

what's the value for --noise_offset

Open
#211 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.2k
Forks
1.2k
Avg merge
11m
Merged PRs (30d)
2

Description

(venv) PS G:\sd-scripts> accelerate launch --num_cpu_threads_per_process 2 train_network.py `
>> --pretrained_model_name_or_path=F:\stable-diffusion-webui\models\Stable-diffusion\dreamshaper_332BakedVaeClipFix.safetensors `
>> --train_data_dir=G:\dls\all\4 `
>> --output_dir=F:\stable-diffusion-webui\models\Lora `
>> --output_name=t1 `
>> --caption_extension=.txt `
>> --prior_loss_weight=1.0 `
>> --resolution=768,768 `
>> --enable_bucket `
>> --train_batch_size=6 `
>> --learning_rate=5e-4 `
>> --unet_lr=5e-4 `
>> --text_encoder_lr=5e-5 `
>> --max_train_epochs=6 `
>> --network_module=networks.lora `
>> --network_dim=128 `
>> --network_alpha=128 `
>> --use_8bit_adam `
>> --xformers `
>> --mixed_precision=bf16 `
>> --lr_scheduler=constant `
>> --verbose `
>> --noise_offset `
>> --save_every_n_epochs=1 `
>> --save_model_as=safetensors --clip_skip=1 --seed=42 `
>> --persistent_data_loader_workers
usage: train_network.py [-h] [--v2] [--v_parameterization] [--pretrained_model_name_or_path PRETRAINED_MODEL_NAME_OR_PATH] [--train_data_dir TRAIN_DATA_DIR] [--shuffle_caption] [--caption_extension CAPTION_EXTENSION]
[--caption_extention CAPTION_EXTENTION] [--keep_tokens KEEP_TOKENS] [--color_aug] [--flip_aug] [--face_crop_aug_range FACE_CROP_AUG_RANGE] [--random_crop] [--debug_dataset] [--resolution RESOLUTION]
[--cache_latents] [--enable_bucket] [--min_bucket_reso MIN_BUCKET_RESO] [--max_bucket_reso MAX_BUCKET_RESO] [--bucket_reso_steps BUCKET_RESO_STEPS] [--bucket_no_upscale]
[--caption_dropout_rate CAPTION_DROPOUT_RATE] [--caption_dropout_every_n_epochs CAPTION_DROPOUT_EVERY_N_EPOCHS] [--caption_tag_dropout_rate CAPTION_TAG_DROPOUT_RATE] [--reg_data_dir REG_DATA_DIR]
[--in_json IN_JSON] [--dataset_repeats DATASET_REPEATS] [--output_dir OUTPUT_DIR] [--output_name OUTPUT_NAME] [--save_precision {None,float,fp16,bf16}] [--save_every_n_epochs SAVE_EVERY_N_EPOCHS]
[--save_n_epoch_ratio SAVE_N_EPOCH_RATIO] [--save_last_n_epochs SAVE_LAST_N_EPOCHS] [--save_last_n_epochs_state SAVE_LAST_N_EPOCHS_STATE] [--save_state] [--resume RESUME] [--train_batch_size TRAIN_BATCH_SIZE]
[--max_token_length {None,150,225}] [--use_8bit_adam] [--use_lion_optimizer] [--mem_eff_attn] [--xformers] [--vae VAE] [--learning_rate LEARNING_RATE] [--max_train_steps MAX_TRAIN_STEPS]
[--max_train_epochs MAX_TRAIN_EPOCHS] [--max_data_loader_n_workers MAX_DATA_LOADER_N_WORKERS] [--persistent_data_loader_workers] [--seed SEED] [--gradient_checkpointing]
[--gradient_accumulation_steps GRADIENT_ACCUMULATION_STEPS] [--mixed_precision {no,fp16,bf16}] [--full_fp16] [--clip_skip CLIP_SKIP] [--logging_dir LOGGING_DIR] [--log_prefix LOG_PREFIX]
[--lr_scheduler LR_SCHEDULER] [--lr_warmup_steps LR_WARMUP_STEPS] [--noise_offset NOISE_OFFSET] [--lowram] [--prior_loss_weight PRIOR_LOSS_WEIGHT] [--no_metadata] [--save_model_as {None,ckpt,pt,safetensors}]
[--unet_lr UNET_LR] [--text_encoder_lr TEXT_ENCODER_LR] [--lr_scheduler_num_cycles LR_SCHEDULER_NUM_CYCLES] [--lr_scheduler_power LR_SCHEDULER_POWER] [--network_weights NETWORK_WEIGHTS]
[--network_module NETWORK_MODULE] [--network_dim NETWORK_DIM] [--network_alpha NETWORK_ALPHA] [--network_args [NETWORK_ARGS ...]] [--network_train_unet_only] [--network_train_text_encoder_only]
[--training_comment TRAINING_COMMENT]
train_network.py: error: argument --noise_offset: expected one argument
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "G:\sd-scripts\venv\Scripts\accelerate.exe\__main__.py", line 7, in
File "G:\sd-scripts\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main
args.func(args)
File "G:\sd-scripts\venv\lib\site-packages\accelerate\commands\launch.py", line 1104, in launch_command
simple_launcher(args)
File "G:\sd-scripts\venv\lib\site-packages\accelerate\commands\launch.py", line 567, in simple_launcher
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['G:\\sd-scripts\\venv\\Scripts\\python.exe', 'train_network.py', '--pretrained_model_name_or_path=F:\\stable-diffusion-webui\\models\\Stable-diffusion\\dreamshaper_332BakedVaeClipFix.safetensors', '--train_data_dir=G:\\dls\\all\\4', '--output_dir=F:\\stable-diffusion-webui\\models\\Lora', '--output_name=t1', '--caption_extension=.txt', '--prior_loss_weight=1.0', '--resolution=768,768', '--enable_bucket', '--train_batch_size=6', '--learning_rate=5e-4', '--unet_lr=5e-4', '--text_encoder_lr=5e-5', '--max_train_epochs=6', '--network_module=networks.lora', '--network_dim=128', '--network_alpha=128', '--use_8bit_adam', '--xformers', '--mixed_precision=bf16', '--lr_scheduler=constant', '--verbose', '--noise_offset', '--save_every_n_epochs=1', '--save_model_as=safetensors', '--clip_skip=1', '--seed=42', '--persistent_data_loader_workers']' returned non-zero exit status 2.
(venv) PS G:\sd-scripts>

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the argument definitions and help output in train_network.py, focusing on --noise_offset and the command shown in the issue. Check how the option is parsed and how its value is consumed during training. Done means documenting the option's expected argument, purpose, and a valid command-line example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, machine-learning
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.