From b82f45197b273637b780273bf2f3cc850d93e876 Mon Sep 17 00:00:00 2001 From: rohitanshu <85547195+iamrohitanshu@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:46:36 +0530 Subject: [PATCH 1/6] fixed minor typo in README.md changed "Tfe" to "The". --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2b321f32..cb024b30b 100644 --- a/README.md +++ b/README.md @@ -241,7 +241,7 @@ To set up the project, follow these steps: .\setup.bat ``` - During the accelerate config step use the default values as proposed during the configuration unless you know your hardware demand otherwise. Tfe amount of VRAM on your GPU does not have an impact on the values used. + During the accelerate config step use the default values as proposed during the configuration unless you know your hardware demand otherwise. The amount of VRAM on your GPU does not have an impact on the values used. #### Optional: CUDNN 8.6 From f4182534fd2385503c6b4794a9308fc0ee15011a Mon Sep 17 00:00:00 2001 From: Arslan Musin Date: Tue, 24 Oct 2023 20:13:54 +0300 Subject: [PATCH 2/6] Update README.md fix win docker instruction --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b2b321f32..ae9972338 100644 --- a/README.md +++ b/README.md @@ -368,6 +368,7 @@ If you prefer to use Docker, follow the instructions below: ```bash git clone https://github.com/bmaltais/kohya_ss.git cd kohya_ss + docker compose create docker compose build docker compose run --service-ports kohya-ss-gui ``` From 80f37809660a1b2258ae7c14573caa10ee19a4e4 Mon Sep 17 00:00:00 2001 From: bmaltais Date: Tue, 31 Oct 2023 09:17:29 -0400 Subject: [PATCH 3/6] Update default win bnb version --- ...series by AI_Characters_Training v1.0.json | 88 +++++++++++++++++ ...DXL - LoRA aitrepreneur clothing v1.0.json | 97 +++++++++++++++++++ requirements_windows_torch2.txt | 2 +- 3 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 presets/finetune/SDXL - Essenz series by AI_Characters_Training v1.0.json create mode 100644 presets/lora/SDXL - LoRA aitrepreneur clothing v1.0.json diff --git a/presets/finetune/SDXL - Essenz series by AI_Characters_Training v1.0.json b/presets/finetune/SDXL - Essenz series by AI_Characters_Training v1.0.json new file mode 100644 index 000000000..89cec3866 --- /dev/null +++ b/presets/finetune/SDXL - Essenz series by AI_Characters_Training v1.0.json @@ -0,0 +1,88 @@ +{ + "adaptive_noise_scale": 0, + "additional_parameters": "", + "batch_size": "1", + "block_lr": "", + "bucket_no_upscale": false, + "bucket_reso_steps": 64, + "cache_latents": true, + "cache_latents_to_disk": true, + "caption_dropout_every_n_epochs": 0.0, + "caption_dropout_rate": 0, + "caption_extension": ".txt", + "caption_metadata_filename": "meta_cap.json", + "clip_skip": "1", + "color_aug": false, + "dataset_repeats": "1", + "epoch": 1, + "flip_aug": false, + "full_bf16": false, + "full_fp16": false, + "full_path": true, + "generate_caption_database": true, + "generate_image_buckets": true, + "gradient_accumulation_steps": 1.0, + "gradient_checkpointing": true, + "image_folder": "/kohya_ss/dataset/1_/", + "keep_tokens": 0, + "latent_metadata_filename": "meta_lat.json", + "learning_rate": 1e-06, + "logging_dir": "/kohya_ss/output/SDXL1.0_Essenz-series-by-AI_Characters_Concept_Morphing-v1.0", + "lr_scheduler": "constant", + "lr_scheduler_args": "", + "lr_warmup": 0, + "max_bucket_reso": "4096", + "max_data_loader_n_workers": "0", + "max_resolution": "1024,1024", + "max_timestep": 1000, + "max_token_length": "75", + "max_train_epochs": "100", + "mem_eff_attn": false, + "min_bucket_reso": "64", + "min_snr_gamma": 0, + "min_timestep": 0, + "mixed_precision": "fp16", + "model_list": "stabilityai/stable-diffusion-xl-base-1.0", + "multires_noise_discount": 0, + "multires_noise_iterations": 0, + "noise_offset": 0, + "noise_offset_type": "Original", + "num_cpu_threads_per_process": 2, + "optimizer": "AdamW8bit", + "optimizer_args": "", + "output_dir": "/kohya_ss/output/SDXL1.0_Essenz-series-by-AI_Characters_Concept_Morphing-v1.0", + "output_name": "SDXL1.0_Essenz-series-by-AI_Characters_Concept_Morphing-v1.0", + "persistent_data_loader_workers": false, + "pretrained_model_name_or_path": "stabilityai/stable-diffusion-xl-base-1.0", + "random_crop": false, + "resume": "", + "sample_every_n_epochs": 0, + "sample_every_n_steps": 0, + "sample_prompts": "", + "sample_sampler": "k_dpm_2", + "save_every_n_epochs": 10, + "save_every_n_steps": 0, + "save_last_n_steps": 0, + "save_last_n_steps_state": 0, + "save_model_as": "safetensors", + "save_precision": "fp16", + "save_state": false, + "scale_v_pred_loss_like_noise_pred": false, + "sdxl_cache_text_encoder_outputs": false, + "sdxl_checkbox": true, + "sdxl_no_half_vae": true, + "seed": "", + "shuffle_caption": false, + "train_batch_size": 1, + "train_dir": "/kohya_ss/output/SDXL1.0_Essenz-series-by-AI_Characters_Concept_Morphing-v1.0", + "train_text_encoder": true, + "use_latent_files": "Yes", + "use_wandb": false, + "v2": false, + "v_parameterization": false, + "v_pred_like_loss": 0, + "vae_batch_size": 0, + "wandb_api_key": "", + "weighted_captions": false, + "xformers": "xformers" +} \ No newline at end of file diff --git a/presets/lora/SDXL - LoRA aitrepreneur clothing v1.0.json b/presets/lora/SDXL - LoRA aitrepreneur clothing v1.0.json new file mode 100644 index 000000000..48d049fd1 --- /dev/null +++ b/presets/lora/SDXL - LoRA aitrepreneur clothing v1.0.json @@ -0,0 +1,97 @@ +{ + "LoRA_type": "Standard", + "adaptive_noise_scale": 0, + "additional_parameters": "", + "block_alphas": "", + "block_dims": "", + "block_lr_zero_threshold": "", + "bucket_no_upscale": true, + "bucket_reso_steps": 64, + "cache_latents": true, + "cache_latents_to_disk": true, + "caption_dropout_every_n_epochs": 0.0, + "caption_dropout_rate": 0, + "caption_extension": ".txt", + "clip_skip": "1", + "color_aug": false, + "conv_alpha": 32, + "conv_block_alphas": "", + "conv_block_dims": "", + "conv_dim": 32, + "decompose_both": false, + "dim_from_weights": false, + "down_lr_weight": "", + "enable_bucket": true, + "epoch": 15, + "factor": -1, + "flip_aug": false, + "full_bf16": false, + "full_fp16": false, + "gradient_accumulation_steps": 2, + "gradient_checkpointing": true, + "keep_tokens": "0", + "learning_rate": 0.0009, + "lora_network_weights": "", + "lr_scheduler": "constant", + "lr_scheduler_args": "", + "lr_scheduler_num_cycles": "1", + "lr_scheduler_power": "", + "lr_warmup": 0, + "max_bucket_reso": 2048, + "max_data_loader_n_workers": "0", + "max_resolution": "1024,1024", + "max_timestep": 1000, + "max_token_length": "75", + "max_train_epochs": "", + "max_train_steps": "", + "mem_eff_attn": false, + "mid_lr_weight": "", + "min_bucket_reso": 256, + "min_snr_gamma": 0, + "min_timestep": 0, + "mixed_precision": "bf16", + "module_dropout": 0, + "multires_noise_discount": 0, + "multires_noise_iterations": 0, + "network_alpha": 1, + "network_dim": 128, + "network_dropout": 0, + "no_token_padding": false, + "noise_offset": 0, + "noise_offset_type": "Original", + "num_cpu_threads_per_process": 2, + "optimizer": "Adafactor", + "optimizer_args": "scale_parameter=False relative_step=False warmup_init=False", + "persistent_data_loader_workers": false, + "prior_loss_weight": 1.0, + "random_crop": false, + "rank_dropout": 0, + "save_every_n_epochs": 1, + "save_every_n_steps": 0, + "save_last_n_steps": 0, + "save_last_n_steps_state": 0, + "save_precision": "bf16", + "scale_v_pred_loss_like_noise_pred": false, + "scale_weight_norms": 0, + "sdxl": true, + "sdxl_cache_text_encoder_outputs": false, + "sdxl_no_half_vae": true, + "seed": "12345", + "shuffle_caption": false, + "stop_text_encoder_training": 0, + "text_encoder_lr": 0.0009, + "train_batch_size": 1, + "train_on_input": true, + "training_comment": "trigger: supergirl costume", + "unet_lr": 0.0009, + "unit": 1, + "up_lr_weight": "", + "use_cp": false, + "use_wandb": false, + "v2": false, + "v_parameterization": false, + "v_pred_like_loss": 0, + "vae_batch_size": 0, + "weighted_captions": false, + "xformers": "xformers" +} \ No newline at end of file diff --git a/requirements_windows_torch2.txt b/requirements_windows_torch2.txt index 783c52729..a093afbff 100644 --- a/requirements_windows_torch2.txt +++ b/requirements_windows_torch2.txt @@ -1,6 +1,6 @@ torch==2.0.1+cu118 torchvision==0.15.2+cu118 --index-url https://download.pytorch.org/whl/cu118 # no_verify xformers==0.0.21 -bitsandbytes==0.35.0 # no_verify +bitsandbytes==0.41.1 # no_verify # https://github.com/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.41.1-py3-none-win_amd64.whl # no_verify tensorboard==2.14.1 tensorflow==2.14.0 -r requirements.txt From ee5a970e9000d97e26c89359de04922b7078713c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 06:01:41 +0000 Subject: [PATCH 4/6] Bump crate-ci/typos from 1.16.18 to 1.16.21 Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.16.18 to 1.16.21. - [Release notes](https://github.com/crate-ci/typos/releases) - [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md) - [Commits](https://github.com/crate-ci/typos/compare/v1.16.18...v1.16.21) --- updated-dependencies: - dependency-name: crate-ci/typos dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/typos.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/typos.yaml b/.github/workflows/typos.yaml index e45ea6820..11269e1e7 100644 --- a/.github/workflows/typos.yaml +++ b/.github/workflows/typos.yaml @@ -18,4 +18,4 @@ jobs: - uses: actions/checkout@v4 - name: typos-action - uses: crate-ci/typos@v1.16.18 + uses: crate-ci/typos@v1.16.21 From 587bebbae437c3e49c348ab000a856457edfcfad Mon Sep 17 00:00:00 2001 From: bmaltais Date: Fri, 3 Nov 2023 07:58:57 -0400 Subject: [PATCH 5/6] Tensorboard headless validation --- .release | 2 +- README.md | 2 ++ dreambooth_gui.py | 2 +- finetune_gui.py | 2 +- library/tensorboard_gui.py | 15 +++++++++------ lora_gui.py | 2 +- textual_inversion_gui.py | 2 +- 7 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.release b/.release index 379b25d1c..2966b959b 100644 --- a/.release +++ b/.release @@ -1 +1 @@ -v22.1.0 +v22.1.1 diff --git a/README.md b/README.md index 9e4b16902..a2baeeac4 100644 --- a/README.md +++ b/README.md @@ -627,6 +627,8 @@ save_file(state_dict, file) ControlNet-LLLite, a novel method for ControlNet with SDXL, is added. See [documentation](./docs/train_lllite_README.md) for details. ## Change History +* 2023/11/03 (v22.1.1) + - Implement headless support for tensorboard as proposed by @sammcj * 2023/10/10 (v22.1.0) - Remove support for torch 1 to align with kohya_ss sd-scripts code base. diff --git a/dreambooth_gui.py b/dreambooth_gui.py index 92277d933..d036f7b0e 100644 --- a/dreambooth_gui.py +++ b/dreambooth_gui.py @@ -780,7 +780,7 @@ def dreambooth_tab( button_start_tensorboard.click( start_tensorboard, - inputs=folders.logging_dir, + inputs=[dummy_headless, folders.logging_dir], show_progress=False, ) diff --git a/finetune_gui.py b/finetune_gui.py index 38c6f7556..9302af847 100644 --- a/finetune_gui.py +++ b/finetune_gui.py @@ -906,7 +906,7 @@ def list_presets(path): button_start_tensorboard.click( start_tensorboard, - inputs=logging_dir, + inputs=[dummy_headless, logging_dir], ) button_stop_tensorboard.click( diff --git a/library/tensorboard_gui.py b/library/tensorboard_gui.py index b34bc3a85..a340c360e 100644 --- a/library/tensorboard_gui.py +++ b/library/tensorboard_gui.py @@ -13,8 +13,10 @@ TENSORBOARD = 'tensorboard' if os.name == 'posix' else 'tensorboard.exe' -def start_tensorboard(logging_dir, wait_time=5): +def start_tensorboard(headless, logging_dir, wait_time=5): global tensorboard_proc + + headless_bool = True if headless.get('label') == 'True' else False if not os.listdir(logging_dir): log.info('Error: log folder is empty') @@ -46,12 +48,13 @@ def start_tensorboard(logging_dir, wait_time=5): log.error('Failed to start Tensorboard:', e) return - # Wait for some time to allow TensorBoard to start up - time.sleep(wait_time) + if not headless_bool: + # Wait for some time to allow TensorBoard to start up + time.sleep(wait_time) - # Open the TensorBoard URL in the default browser - log.info('Opening tensorboard url in browser...') - webbrowser.open('http://localhost:6006') + # Open the TensorBoard URL in the default browser + log.info('Opening tensorboard url in browser...') + webbrowser.open('http://localhost:6006') def stop_tensorboard(): diff --git a/lora_gui.py b/lora_gui.py index 645b42eb5..e4346a36a 100644 --- a/lora_gui.py +++ b/lora_gui.py @@ -1538,7 +1538,7 @@ def update_LoRA_settings(LoRA_type): button_start_tensorboard.click( start_tensorboard, - inputs=folders.logging_dir, + inputs=[dummy_headless, folders.logging_dir], show_progress=False, ) diff --git a/textual_inversion_gui.py b/textual_inversion_gui.py index 6cfa137b2..9e9c63f89 100644 --- a/textual_inversion_gui.py +++ b/textual_inversion_gui.py @@ -839,7 +839,7 @@ def ti_tab( button_start_tensorboard.click( start_tensorboard, - inputs=folders.logging_dir, + inputs=[dummy_headless, folders.logging_dir], show_progress=False, ) From 063ca93b59c9bb32a882579a24c86afa9da4895c Mon Sep 17 00:00:00 2001 From: Tom Brewe Date: Fri, 10 Nov 2023 19:04:25 +0100 Subject: [PATCH 6/6] chore: fix recommended parameter "train_unet_only" -> "network_train_unet_only" --- docs/LoRA/top_level.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LoRA/top_level.md b/docs/LoRA/top_level.md index d2c3c6d3a..b9848bc84 100644 --- a/docs/LoRA/top_level.md +++ b/docs/LoRA/top_level.md @@ -8,7 +8,7 @@ Access EDG's tutorials here: https://ko-fi.com/post/EDGs-tutorials-P5P6KT5MT - Set the `Max resolution` to at least 1024x1024, as this is the standard resolution for SDXL. - Use a GPU that has at least 12GB memory for the LoRA training process. -- We strongly recommend using the `--train_unet_only` option for SDXL LoRA to avoid unforeseen training results caused by dual text encoders in SDXL. +- We strongly recommend using the `--network_train_unet_only` option for SDXL LoRA to avoid unforeseen training results caused by dual text encoders in SDXL. - PyTorch 2 tends to use less GPU memory than PyTorch 1. Here's an example configuration for the Adafactor optimizer with a fixed learning rate: