AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
143.16k stars 26.98k forks source link

[Bug]: All custom Lora disappeared after using updated webui #12427

Closed WilliamChen-luckbob closed 1 year ago

WilliamChen-luckbob commented 1 year ago

Is there an existing issue for this?

What happened?

I have a collection of custom LoRa models that used to work well on an older version (unfortunately, I have forgotten the version... My web UI was initially installed on June 1st).

All of my LoRa models were trained by kohya_ss.

What I did was to copy my .safetensors file to stable-diffusion-webui/models/Lora, and it worked perfectly for 2 months.

Today, I decided to upgrade the web UI by pulling the latest master branch and simply running ./webui.sh.

To my surprise, I discovered that all of my LoRa models had disappeared, while the ones I had downloaded from civitai were still intact.

Furthermore, I have ensured that all of my extensions are up to date. However, this is not working.

And I'm sure the path is correct. image The ones I downloaded from Civitai work fine, but my .safetensors have disappeared. I had been using them for 2 months, continuing to train with them every day and conducting tests. Today, they just gone.... image

I'm quite perplexed and unsure about what might have caused this issue...

Steps to reproduce the problem

just up to date and start as usual

What should have happened?

My custom Lora should be seen.

Version or Commit where the problem happens

v1.5.1

What Python version are you running on ?

Python 3.10.x

What platforms do you use to access the UI ?

Linux

What device are you running WebUI on?

AMD GPUs (RX 6000 above)

Cross attention optimization

xformers

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

./webui.sh --server-name=0.0.0.0 --xformers

List of extensions

GroundingDINO https://github.com/IDEA-Research/GroundingDINO.git main 60d79682 Sun Jul 23 05:08:59 2023 Loading... a1111-sd-webui-tagcomplete

https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git main 4a415f1a Sat Jul 29 15:27:43 2023 Loading... corridor-crawler-outpainting https://github.com/brick2face/corridor-crawler-outpainting.git main 680aed7e Tue Mar 28 23:58:24 2023 Loading... danbooru-prompt https://github.com/EnsignMK/danbooru-prompt.git main ba2b2468 Mon Jul 17 22:55:06 2023 Loading... loopback_scaler https://github.com/Elldreth/loopback_scaler.git main 184a53e6 Fri Jun 23 21:42:22 2023 Loading... sd-extension-system-info

https://github.com/vladmandic/sd-extension-system-info.git main 9d3c0ca0 Fri Jul 14 19:46:48 2023 Loading... sd-webui-3d-open-pose-editor https://github.com/nonnonstop/sd-webui-3d-open-pose-editor.git main f2d5aac5 Sat Apr 15 13:21:06 2023 Loading... sd-webui-additional-networks

https://github.com/kohya-ss/sd-webui-additional-networks.git main e9f3d622 Tue May 23 12:31:15 2023 Loading... sd-webui-ar https://github.com/alemelis/sd-webui-ar.git main 04ee2c6c Thu Jul 6 10:14:29 2023 Loading... sd-webui-aspect-ratio-helper https://github.com/thomasasfk/sd-webui-aspect-ratio-helper.git main 99fcf9b0 Sun Jun 4 15:39:07 2023 Loading... sd-webui-bilingual-localization

https://github.com/journey-ad/sd-webui-bilingual-localization.git main 89a02280 Thu Apr 27 03:54:25 2023 Loading... sd-webui-controlnet

https://github.com/Mikubill/sd-webui-controlnet.git main 07bed6cc Sat Jul 8 20:54:01 2023 Loading... sd-webui-openpose-editor https://github.com/huchenlei/sd-webui-openpose-editor.git main 9ed77768 Sun Jul 16 21:22:37 2023 Loading... sd-webui-segment-anything https://github.com/continue-revolution/sd-webui-segment-anything.git master 5df716be Wed Jul 26 23:06:35 2023 Loading... sd_dreambooth_extension

https://github.com/d8ahazard/sd_dreambooth_extension.git main c2a5617c Sat Jul 8 13:35:47 2023 Loading... stable-diffusion-webui-aesthetic-gradients

https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients.git master 2624e5dd Fri Jan 6 10:59:30 2023 Loading... stable-diffusion-webui-dataset-tag-editor

https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor.git main 7a2f4c53 Mon Jun 5 10:12:00 2023 Loading... stable-diffusion-webui-images-browser

https://github.com/AlUlkesh/stable-diffusion-webui-images-browser.git main a3aeb93f Mon Jul 31 20:04:41 2023 Loading... stable-diffusion-webui-localization-zh_CN

https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN main 582ca24d Thu Mar 30 07:06:14 2023 Loading... video_loopback_for_webui https://github.com/fishslot/video_loopback_for_webui.git main 4e0bf8c5 Fri Apr 21 12:08:15 2023 Loading...

Console logs

just normal with none of my custom Lora found

Additional information

No response

w-e-w commented 1 year ago

I assumed that by disappeared you mean that it is not showing up in extra networks and not that file having deleted from your computer

it could be that you just misinterpret the situation

a new feature in webui is that it will only display the LoRA for the correct type of SD model you currently have loaded

if you are using SDXL then only SDXL LoRA will show

this only works for the models that have proper metadata some older models are indistinguishable because they don't have the metadata inside

WilliamChen-luckbob commented 1 year ago

I assumed that by disappeared you mean that it is not showing up in extra networks and not that file having deleted from your computer

it could be that you just misinterpret the situation

a new feature in webui is that it will only display the LoRA for the correct type of SD model you currently have loaded

if you are using SDXL then only SDXL LoRA will show

this only works for the models that have proper metadata some older models are indistinguishable because they don't have the metadata inside

Did you mean that I need to select the pretrained base model first, and then my custom LoRA would show up? I have tried but it seems not working...

w-e-w commented 1 year ago

can you upload the models that aren't showing

w-e-w commented 1 year ago

also disable all non-built-in extensions to make sure that it isn't extensions of causing strange issues

WilliamChen-luckbob commented 1 year ago

can you upload the models that aren't showing

While using kohya_ss to train, my server is incredibly slow when attempting to download packages by specifying the package path because the public network speed was only 500Kb/s.

As a result, I decided to directly download the required files from https://huggingface.co/SG161222/Realistic_Vision_V5.1_noVAE using my own device and then upload them to the server through our internal network.

I have put the package to /home/chenchen/Code/lora_trainer/nail_art_train_test/BASE_MODEL/Realistic_Vision5.1 like this: image

I trained my LoRA model based on these files and made no modifications.

Load my configuration json file and click start training to wait for LoRa .safetensors file.

And here is the pre setting json:

{
  "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": false,
  "caption_dropout_every_n_epochs": 0.0,
  "caption_dropout_rate": 0,
  "caption_extension": ".txt",
  "clip_skip": 2,
  "color_aug": false,
  "conv_alpha": 1,
  "conv_block_alphas": "",
  "conv_block_dims": "",
  "conv_dim": 1,
  "decompose_both": false,
  "dim_from_weights": false,
  "down_lr_weight": "",
  "enable_bucket": true,
  "epoch": 1,
  "factor": -1,
  "flip_aug": false,
  "full_bf16": false,
  "full_fp16": false,
  "gradient_accumulation_steps": 1.0,
  "gradient_checkpointing": false,
  "keep_tokens": "0",
  "learning_rate": 0.0001,
  "logging_dir": "/home/chenchen/Code/lora_trainer/face_train_test/LOG",
  "lora_network_weights": "",
  "lr_scheduler": "constant",
  "lr_scheduler_num_cycles": "",
  "lr_scheduler_power": "",
  "lr_warmup": 0,
  "max_bucket_reso": 2048,
  "max_data_loader_n_workers": "1",
  "max_resolution": "512,512",
  "max_timestep": 1000,
  "max_token_length": "75",
  "max_train_epochs": "",
  "mem_eff_attn": false,
  "mid_lr_weight": "",
  "min_bucket_reso": 256,
  "min_snr_gamma": 0,
  "min_timestep": 0,
  "mixed_precision": "fp16",
  "model_list": "custom",
  "module_dropout": 0,
  "multires_noise_discount": 0,
  "multires_noise_iterations": 0,
  "network_alpha": 128,
  "network_dim": 128,
  "network_dropout": 0,
  "no_token_padding": false,
  "noise_offset": 0,
  "noise_offset_type": "Original",
  "num_cpu_threads_per_process": 2,
  "optimizer": "AdamW8bit",
  "optimizer_args": "",
  "output_dir": "/home/chenchen/Code/lora_trainer/face_train_test/OUTPUT",
  "output_name": "williamchen_face_test",
  "persistent_data_loader_workers": false,
  "pretrained_model_name_or_path": "/home/chenchen/Code/lora_trainer/nail_art_train_test/BASE_MODEL/Realistic_Vision5.1",
  "prior_loss_weight": 1.0,
  "random_crop": false,
  "rank_dropout": 0,
  "reg_data_dir": "",
  "resume": "",
  "sample_every_n_epochs": 0,
  "sample_every_n_steps": 0,
  "sample_prompts": "",
  "sample_sampler": "euler_a",
  "save_every_n_epochs": 1,
  "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,
  "scale_weight_norms": 0,
  "sdxl": false,
  "sdxl_cache_text_encoder_outputs": false,
  "sdxl_no_half_vae": true,
  "seed": "1234",
  "shuffle_caption": false,
  "stop_text_encoder_training": 0,
  "text_encoder_lr": 5e-05,
  "train_batch_size": 6,
  "train_data_dir": "/home/chenchen/Code/lora_trainer/face_train_test/IMG",
  "train_on_input": true,
  "training_comment": "",
  "unet_lr": 0.0001,
  "unit": 1,
  "up_lr_weight": "",
  "use_cp": false,
  "use_wandb": false,
  "v2": true,
  "v_parameterization": true,
  "vae_batch_size": 0,
  "wandb_api_key": "",
  "weighted_captions": false,
  "xformers": true
}

and here is the output LoRa model @w-e-w

WilliamChen-luckbob commented 1 year ago

also disable all non-built-in extensions to make sure that it isn't extensions of causing strange issues

Yes, I have all my none-build-in extensions shut down and restart completely. LoRa not showing in this way. image

image

WilliamChen-luckbob commented 1 year ago

its my bad, I have my configuration wrong, this is due to settings.

w-e-w commented 1 year ago

what was the cause

WilliamChen-luckbob commented 1 year ago

what was the cause

In kohya_ss, I have checked v2, v_parameterization, SDXL_Model, and that caused the problem. with unchecking them and retrain LoRa, it works. I think it is due to SDXL_Model that I trained yesterday.

0ka9dkad commented 1 year ago

what was the cause

In kohya_ss, I have checked v2, v_parameterization, SDXL_Model, and that caused the problem. with unchecking them and retrain LoRa, it works. I think it is due to SDXL_Model that I trained yesterday.

inside the webui or in some configuration file? i have the same problem

w-e-w commented 1 year ago

a new feature in webui is that it will only display the LoRA for the correct type of SD model you currently have loaded

if you are using SDXL then only SDXL LoRA will show

WilliamChen-luckbob

In kohya_ss, I have checked v2, v_parameterization, SDXL_Model, and that caused the problem. with unchecking them and retrain LoRa, it works. I think it is due to SDXL_Model that I trained yesterday.

basically he thought that he trained a V1.x model, but actually he had trained it like a V2 model and because of this he couldn't get his model to show up under V1 (because it is not a V1 model)

michalakmichal commented 1 year ago

Check this field and reload sd UI. image