Code Monkey home page Code Monkey logo

kohya-sd-scripts-webui's Introduction

kohya-sd-scripts-webui's People

Contributors

ddpn08 avatar nameless1117 avatar nemuruibai avatar noma-machiko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

kohya-sd-scripts-webui's Issues

Missing UI Config ?

I tried this as webui extension and tested the finetune pipline. And I got this error.

Invalid user config / ユーザ設定の形式が正しくないようです
Traceback (most recent call last):
File "E:\stablediffusion\novelai-webui-aki-v2\extensions\kohya-sd-scripts-webui\kohya_ss\fine_tune.py", line 365, in
train(args)
File "E:\stablediffusion\novelai-webui-aki-v2\extensions\kohya-sd-scripts-webui\kohya_ss\fine_tune.py", line 54, in train
blueprint = blueprint_generator.generate(user_config, args, tokenizer=tokenizer)
File "E:\stablediffusion\novelai-webui-aki-v2\py310\lib\site-packages\library\config_util.py", line 299, in generate
sanitized_user_config = self.sanitizer.sanitize_user_config(user_config)
File "E:\stablediffusion\novelai-webui-aki-v2\py310\lib\site-packages\library\config_util.py", line 265, in sanitize_user_config
return self.user_config_validator(user_config)
File "E:\stablediffusion\novelai-webui-aki-v2\py310\lib\site-packages\voluptuous\schema_builder.py", line 272, in call
return self._compiled([], data)
File "E:\stablediffusion\novelai-webui-aki-v2\py310\lib\site-packages\voluptuous\schema_builder.py", line 595, in validate_dict
return base_validate(path, iteritems(data), out)
File "E:\stablediffusion\novelai-webui-aki-v2\py310\lib\site-packages\voluptuous\schema_builder.py", line 433, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: expected str for dictionary value @ data['datasets'][0]['subsets'][0]['metadata_file']

I think it is caused by the finetune ui doesn't have in_json setting.

module 'tensorflow' has no attribute 'io'

`Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Commit hash: <none>
Installing requirements for Web UI
Installing requirements for kohya sd-scripts

Installing sd-dynamic-prompts requirements.txt

If submitting an issue on github, please provide the full startup log for debugging purposes.

Initializing Dreambooth
Dreambooth revision: 926ae204ef5de17efca2059c334b6098492a0641
Successfully installed accelerate-0.18.0 bitsandbytes-0.35.4 diffusers-0.14.0 fastapi-0.94.1 gitpython-3.1.31 keras-2.12.0 protobuf-4.22.1 tensorboard-2.12.0 tensorboard-data-server-0.7.0 tensorflow-2.12.0 tensorflow-estimator-2.12.0 transformers-4.26.1

Does your project take forever to startup?
Repetitive dependency installation may be the reason.
Automatic1111's base project sets strict requirements on outdated dependencies.
If an extension is using a newer version, the dependency is uninstalled and reinstalled twice every startup.

[!] xformers NOT installed.
[+] torch version 2.0.0+cu118 installed.
[+] torchvision version 0.15.1+cu118 installed.
[+] accelerate version 0.18.0 installed.
[+] diffusers version 0.14.0 installed.
[+] transformers version 4.26.1 installed.
[+] bitsandbytes version 0.35.4 installed.

Installing requirements for Unprompted - img2pez
Installing requirements for Unprompted - pix2pix_zero

Launching Web UI with arguments: --opt-sdp-attention
Traceback (most recent call last):
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\transformers\utils\import_utils.py", line 1110, in _get_module
    return importlib.import_module("." + module_name, self.__name__)
  File "I:\Users\Silver\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\transformers\modeling_utils.py", line 83, in <module>
    from accelerate import __version__ as accelerate_version
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\accelerate\__init__.py", line 3, in <module>
    from .accelerator import Accelerator
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\accelerate\accelerator.py", line 37, in <module>
    from .tracking import LOGGER_TYPE_TO_CLASS, GeneralTracker, filter_trackers
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\accelerate\tracking.py", line 42, in <module>
    from torch.utils import tensorboard
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\torch\utils\tensorboard\__init__.py", line 12, in <module>
    from .writer import FileWriter, SummaryWriter  # noqa: F401
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\torch\utils\tensorboard\writer.py", line 16, in <module>
    from ._embedding import (
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\torch\utils\tensorboard\_embedding.py", line 9, in <module>
    _HAS_GFILE_JOIN = hasattr(tf.io.gfile, "join")
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\tensorboard\lazy.py", line 65, in __getattr__
    return getattr(load_once(self), attr_name)
AttributeError: module 'tensorflow' has no attribute 'io'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "I:\Projects\stable-diffusion-webui-master\launch.py", line 356, in <module>
    start()
  File "I:\Projects\stable-diffusion-webui-master\launch.py", line 347, in start
    import webui
  File "I:\Projects\stable-diffusion-webui-master\webui.py", line 21, in <module>
    import pytorch_lightning # pytorch_lightning should be imported after torch, but it re-enables warnings on import so import once to disable them
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\pytorch_lightning\__init__.py", line 35, in <module>
    from pytorch_lightning.callbacks import Callback  # noqa: E402
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\pytorch_lightning\callbacks\__init__.py", line 14, in <module>
    from pytorch_lightning.callbacks.batch_size_finder import BatchSizeFinder
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\pytorch_lightning\callbacks\batch_size_finder.py", line 24, in <module>
    from pytorch_lightning.callbacks.callback import Callback
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\pytorch_lightning\callbacks\callback.py", line 25, in <module>
    from pytorch_lightning.utilities.types import STEP_OUTPUT
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\pytorch_lightning\utilities\types.py", line 27, in <module>
    from torchmetrics import Metric
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\torchmetrics\__init__.py", line 14, in <module>
    from torchmetrics import functional  # noqa: E402
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\torchmetrics\functional\__init__.py", line 82, in <module>
    from torchmetrics.functional.text.bleu import bleu_score
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\torchmetrics\functional\text\__init__.py", line 30, in <module>
    from torchmetrics.functional.text.bert import bert_score  # noqa: F401
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\torchmetrics\functional\text\bert.py", line 24, in <module>
    from torchmetrics.functional.text.helper_embedding_metric import (
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\torchmetrics\functional\text\helper_embedding_metric.py", line 26, in <module>
    from transformers import AutoModelForMaskedLM, AutoTokenizer, PreTrainedModel, PreTrainedTokenizerBase
  File "<frozen importlib._bootstrap>", line 1075, in _handle_fromlist
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\transformers\utils\import_utils.py", line 1100, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "I:\Projects\stable-diffusion-webui-master\venv\lib\site-packages\transformers\utils\import_utils.py", line 1112, in _get_module
    raise RuntimeError(
RuntimeError: Failed to import transformers.modeling_utils because of the following error (look up to see its traceback):
module 'tensorflow' has no attribute 'io'`

web-ui version didn't matter. Spent the day trying to figure out the issue. I tried to manually install Tensorflow but I think the script uninstalls and installs it again automatically anyway.

xformers 0.0.17.dev451

The version xformers 0.0.17.dev451 doesn't appear on pip:

https://pypi.org/project/xformers/#history

Error in google collab:

Command: "/content/kohya-sd-scripts-webui/venv/bin/python3" -m pip install xformers==0.0.17.dev451 --prefer-binary
Error code: 1
stdout: Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/

stderr: ERROR: Could not find a version that satisfies the requirement xformers==0.0.17.dev451 (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.0.11, 0.0.12, 0.0.13, 0.0.16rc424, 0.0.16rc425, 0.0.16, 0.0.17.dev464, 0.0.17.dev465, 0.0.17.dev466, 0.0.17.dev473)
ERROR: No matching distribution found for xformers==0.0.17.dev451

Suggest change to newer version using xformers==0.0.17.dev473:

launch.run_pip("install xformers==0.0.17.dev451", "xformers")

Tested with:

sed -i 's/xformers==0\.0\.17\.dev[0-9]\+/xformers==0.0.17.dev473/g' install.py

Locon

Please support network module locon

Missing t in the tansformers distribution folders.

stderr: WARNING: Ignoring invalid distribution -ransformers (c:\users\shiftspace\sd.webui\system\python\lib\site-packages)


*** WARNING: Ignoring invalid distribution -ransformers (c:\users\shiftspace\sd.webui\system\python\lib\site-packages)


*** ERROR: Exception:

Since this issue only arose after adding Kohya-sd-scripts-webui extension to my webui, I can only assume that someone missed a t when adding the folders for distribution.

extentionとして利用した際のnetworksタブのMerge loraでエラーが出る

Merge loraを利用した際に下記のエラーが出るようです。

usage: merge_lora.py [-h] [--v2] [--save_precision {None,float,fp16,bf16}]
                     [--precision {float,fp16,bf16}] [--sd_model SD_MODEL]
                     [--save_to SAVE_TO] [--models [MODELS ...]]
                     [--ratios [RATIOS ...]]
merge_lora.py: error: argument --ratios: invalid float value: '[1.0]'

エラー時の設定は牡蠣のとおりにしていました
image

Error loading script: ui_overrides.py

2023-03-06 05:11:40.050208: E tensorflow/stream_executor/cuda/cuda_blas.cc:2981] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
/usr/local/lib/python3.8/dist-packages/pytorch_lightning/utilities/distributed.py:258: LightningDeprecationWarning: pytorch_lightning.utilities.distributed.rank_zero_only has been deprecated in v1.8.1 and will be removed in v2.0.0. You can import it from pytorch_lightning.utilities instead.
rank_zero_deprecation(
Checkpoint in --ckpt argument not found (Possible it was moved to /content/stable-diffusion-webui/models/Stable-diffusion:
/usr/local/lib/python3.8/dist-packages/pytorch_lightning/utilities/distributed.py:258: LightningDeprecationWarning: pytorch_lightning.utilities.distributed.rank_zero_only has been deprecated in v1.8.1 and will be removed in v2.0.0. You can import it from pytorch_lightning.utilities instead.
rank_zero_deprecation(
Error loading script: ui_overrides.py
Traceback (most recent call last):
File "/content/stable-diffusion-webui/modules/scripts.py", line 229, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/content/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module
module_spec.loader.exec_module(module)
File "", line 848, in exec_module
File "", line 219, in _call_with_frames_removed
File "/content/stable-diffusion-webui/extensions/kohya-sd-scripts-webui/scripts/ui_overrides.py", line 1, in
from . import shared
ModuleNotFoundError: No module named 'ui_overrides'

SDXLは対応していますか?

使いやすい拡張機能をありがとうございます!
AUTOMATIC1111のwebuiでsdxlも学習したいなと思ってます。
こちら対応していますでしょうか?

I got this error in the terminal, can someone help?

A matching Triton is not available, some optimizations will not be enabled.
Error caught was: No module named 'triton'
+--------------------- Traceback (most recent call last) ---------------------+
| C:\AI\stable-diffusion-webui\extensions\kohya-sd-scripts-webui\kohya_ss\tra |
| in_network.py:659 in |
| |
| 656 help="arbitrary comment string stored in metada |
| 657 |
| 658 args = parser.parse_args() |
| > 659 train(args) |
| 660 |
| |
| C:\AI\stable-diffusion-webui\extensions\kohya-sd-scripts-webui\kohya_ss\tra |
| in_network.py:52 in train |
| |
| 49 def train(args): |
| 50 session_id = random.randint(0, 2**32) |
| 51 training_started_at = time.time() |
| > 52 train_util.verify_training_args(args) |
| 53 train_util.prepare_dataset_args(args, True) |
| 54 |
| 55 cache_latents = args.cache_latents |
| |
| C:\AI\stable-diffusion-webui\extensions\kohya-sd-scripts-webui\kohya_ss\lib |
| rary\train_util.py:1612 in verify_training_args |
| |
| 1609 if args.v_parameterization and not args.v2: |
| 1610 print("v_parameterization should be with v2 / v1\u3067v_parameteriza |
| 1611 if args.v2 and args.clip_skip is not None: |
| > 1612 print("v2 with clip_skip will be unexpected / v2\u3067clip_skip\u3092\u4f7f |
| 1613 |
| 1614 |
| 1615 def add_dataset_arguments(parser: argparse.ArgumentParser, support_d |
| |
| C:\Users\RINO\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252. |
| py:19 in encode |
| |
| 16 |
| 17 class IncrementalEncoder(codecs.IncrementalEncoder): |
| 18 def encode(self, input, final=False): |
| > 19 return codecs.charmap_encode(input,self.errors,encoding_table |
| 20 |
| 21 class IncrementalDecoder(codecs.IncrementalDecoder): |
| 22 def decode(self, input, final=False): |
+-----------------------------------------------------------------------------+
UnicodeEncodeError: 'charmap' codec can't encode character '\u3067' in position
41: character maps to

add_dataset_arguments() missing 1 required positional argument: 'support_caption_dropout'

Failed to load scripts.tabs.training.fine_tune
add_dataset_arguments() missing 1 required positional argument: 'support_caption_dropout'
Failed to load scripts.tabs.training.train_db
add_dataset_arguments() missing 1 required positional argument: 'support_caption_dropout'
Failed to load scripts.tabs.training.train_network
add_dataset_arguments() missing 1 required positional argument: 'support_caption_dropout'
Failed to load scripts.tabs.training.train_textual_inversion
add_dataset_arguments() missing 1 required positional argument: 'support_caption_dropout'
Running on local URL: http://127.0.0.1:7860

preparationのあらゆる機能が死んでいる気がする

preparationのMerge Tags, Prepare latentsのどちらもでもpathが通らないエラーが起きる気がします。
in_json, out_jsonやモデルファイルを自作ディレクトリを作ってその配下に入れたりすると、エラーが起きると思います。

下記はstable-diffusion-webui配下にdreamboothsetupディレクトリを作成してその中にmeta.jsonを格納した際のエラーです。

以前はこちらで動いておりましたが、要求されるディレクトリ構造が変わりましたかね?
stable-diffusion-webui配下のディレクトリにアクセスできないため、同様の話として、stable-diffusion-webui配下のmodelsとかにはいってるckptファイルなどにアクセスできないので不便です。

エラー文

Traceback (most recent call last):
File "/home/xxxxx/stable-diffusion-webui/extensions/kohya-sd-scripts-webui/kohya_ss/finetune/merge_dd_tags_to_metadata.py", line 62, in <module>
main(args)
File "/home/xxxxx/stable-diffusion-webui/extensions/kohya-sd-scripts-webui/kohya_ss/finetune/merge_dd_tags_to_metadata.py", line 42, in main
Path(args.out_json).write_text(json.dumps(metadata, indent=2), encoding='utf-8')
File "/home/xxxxx/anaconda3/lib/python3.9/pathlib.py", line 1285, in write_text
with self.open(mode='w', encoding=encoding, errors=errors) as f:
File "/home/xxxxx/anaconda3/lib/python3.9/pathlib.py", line 1252, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/xxxxx/anaconda3/lib/python3.9/pathlib.py", line 1120, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: 'dreamboothsetup/meta.json'

TypeError: Input must be callable

Hi i have this error when i try to train with lora

2023-03-04 07:23:28.640947: E tensorflow/stream_executor/cuda/cuda_blas.cc:2981] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
Traceback (most recent call last):
File "/content/stable-diffusion-webui/extensions/kohya-sd-scripts-webui/kohya_ss/train_network.py", line 20, in
import library.config_util as config_util
File "/content/stable-diffusion-webui/extensions/kohya-sd-scripts-webui/kohya_ss/library/config_util.py", line 113, in
class ConfigSanitizer:
File "/content/stable-diffusion-webui/extensions/kohya-sd-scripts-webui/kohya_ss/library/config_util.py", line 116, in ConfigSanitizer
def __validate_and_convert_twodim(klass, value: Sequence) -> Tuple:
File "/usr/local/lib/python3.8/dist-packages/toolz/functoolz.py", line 201, in init
raise TypeError("Input must be callable")
TypeError: Input must be callable

AttributeError: 'Slider' object has no attribute 'elem_classes'

This is happen when I run Automatic1111 Webui through colab, and only when there is kohya-sd-scripts-webui in the extensions folder.

Output notebook cells
Python 3.9.16 (main, Dec  7 2022, 01:11:51) 
[GCC 9.4.0]
Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
Installing requirements for Web UI



Installing requirements for kohya sd-scripts

Launching Web UI with arguments: --api --share --xformers --lowram --no-half-vae --lora-dir /content/drive/MyDrive/Colab/stable-diffusion-webui/models/Lora --ckpt-dir //content/drive/MyDrive/Colab/stable-diffusion-webui/models/Stable-diffusion --hypernetwork-dir //content/drive/MyDrive/Colab/stable-diffusion-webui/models/hypernetworks --disable-console-progressbars --enable-insecure-extension-access
2023-03-31 04:19:33.980831: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-03-31 04:19:35.040074: E tensorflow/stream_executor/cuda/cuda_blas.cc:2981] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2023-03-31 04:19:37.448647: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/lib64-nvidia
2023-03-31 04:19:37.448904: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/lib64-nvidia
2023-03-31 04:19:37.448930: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
Loading weights [2f1e33c4bb] from /content/drive/MyDrive/Colab/stable-diffusion-webui/models/Stable-diffusion/WhiteDistance-v2-non-ema-fp32.safetensors
Creating model from config: /content/drive/MyDrive/Colab/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(10): bad_prompt, bad_prompt_version2, bad-artist-anime, bad-artist, ng_deepnegative_v1_75t, bad-hands-5, deformityv6, verybadimagenegative_v1.2-6400, discomix, verybadimagenegative_v1.3
Textual inversion embeddings skipped(2): wdgoodprompt, wdbadprompt
Model loaded in 34.1s (load weights from disk: 29.3s, create model: 1.0s, apply weights to model: 2.5s, apply half(): 0.5s, move model to device: 0.6s).
╭───────────────────── Traceback (most recent call last) ──────────────────────
│ /content/drive/MyDrive/Colab/stable-diffusion-webui/launch.py:356 in         
│ <module>                                                                     
│                                                                              
│   353                                                                        
│   354 if __name__ == "__main__":                                             
│   355 │   prepare_environment()                                              
│ ❱ 356 │   start()                                                            
│   357                                                                        
│                                                                              
│ /content/drive/MyDrive/Colab/stable-diffusion-webui/launch.py:351 in start   
│                                                                              
│   348 │   if '--nowebui' in sys.argv:                                        
│   349 │       webui.api_only()                                               
│   350 │   else:                                                              
│ ❱ 351 │      webui.webui()                                                  
│   352                                                                        
│   353                                                                        
│   354 if __name__ == "__main__":                                             
│                                                                              
│ /content/drive/MyDrive/Colab/stable-diffusion-webui/webui.py:243 in webui    
│                                                                              
│   240 │       modules.script_callbacks.before_ui_callback()                  
│   241 │        startup_timer.record("scripts before_ui_callback")             
│   242 │                                                                     
│ ❱ 243 │       shared.demo = modules.ui.create_ui()                           
│   244 │       startup_timer.record("create ui")                              
│   245 │                                                                      
│   246 │       if not cmd_opts.no_gradio_queue:                               
│                                                                              
│ /content/drive/MyDrive/Colab/stable-diffusion-webui/modules/ui.py:446 in     
│ create_ui                                                                    
│                                                                              
│    443 │   parameters_copypaste.reset()                                      
│    444 │                                                                     
│    445 │   modules.scripts.scripts_current = modules.scripts.scripts_txt2img 
│ ❱  446 │   modules.scripts.scripts_txt2img.initialize_scripts(is_img2img=Fal 
│    447 │                                                                     
│    448 │   with gr.Blocks(analytics_enabled=False) as txt2img_interface:     
│    449 │       txt2img_prompt, txt2img_prompt_styles, txt2img_negative_promp 
│                                                                             
│ /content/drive/MyDrive/Colab/stable-diffusion-webui/modules/scripts.py:298   
│ in initialize_scripts                                                        
│                                                                              
│   295 │       auto_processing_scripts = scripts_auto_postprocessing.create_a 
│   296 │                                                                      
│   297 │       for script_class, path, basedir, script_module in auto_process 
│ ❱ 298 │           script = script_class()                                    
│   299 │           script.filename = path                                     
│   300 │           script.is_txt2img = not is_img2img                         
│   301 │           script.is_img2img = is_img2img                             
│                                                                              
│ /content/drive/MyDrive/Colab/stable-diffusion-webui/extensions/sd-webui-cont 
│ rolnet/scripts/controlnet.py:127 in __init__                                 
│                                                                             
│   124 │       self.unloadable = global_state.cn_preprocessor_unloadable      
│   125 │       self.input_image = None                                        
│   126 │       self.latest_model_hash = ""                                    
│ ❱ 127 │       self.txt2img_w_slider = gr.Slider()                            
│   128 │       self.txt2img_h_slider = gr.Slider()                            
│   129 │       self.img2img_w_slider = gr.Slider()                            
│   130 │       self.img2img_h_slider = gr.Slider()                            
│                                                                              
│ /usr/local/lib/python3.9/dist-packages/gradio/components.py:662 in __init__  │
│                                                                              
│    659 │           self.step = step                                          
│    660 │       if randomize:                                                 
│    661 │           value = self.get_random_value                             
│ ❱  662 │       IOComponent.__init__(                                         
│    663 │           self,                                                     
│    664 │           label=label,                                              
│    665 │           every=every,                                              
│                                                                              
│ /content/drive/MyDrive/Colab/stable-diffusion-webui/modules/scripts.py:544   
│ in IOComponent_init                                                         
│                                                                              
│   541 │                                                                      
│   542 │   res = original_IOComponent_init(self, *args, **kwargs)             
│   543 │                                                                      
│ ❱ 544 │   add_classes_to_gradio_component(self)                              
│   545 │                                                                      
│   546 │   script_callbacks.after_component_callback(self, **kwargs)          
│   547                                                                        
│                                                                              
│ /content/drive/MyDrive/Colab/stable-diffusion-webui/modules/scripts.py:529   
│ in add_classes_to_gradio_component                                           
│                                                                              
│   526 │   this adds gradio-* to the component for css styling (ie gradio-but 
│   527 │   """                                                                
│   528 │                                                                      
│ ❱ 529 │   comp.elem_classes = ["gradio-" + comp.get_block_name(), *(comp.ele 
│   530 │                                                                      
│   531 │   if getattr(comp, 'multiselect', False):                            
│   532 │       comp.elem_classes.append('multiselect')                        
╰──────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'Slider' object has no attribute 'elem_classes'

Some warnings in google colab

Hi thanks for this repo and all the work behind, i appreciate too much work at the end but i have this warnings i odnt know if this affect for teh proccess

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Installing torch and torchvision
Installing xformers
Installing gradio
Installing ngrok
Installing requirements for kohya sd-scripts
2023-02-13 17:03:25.840759: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-02-13 17:03:26.109682: E tensorflow/stream_executor/cuda/cuda_blas.cc:2981] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2023-02-13 17:03:27.283729: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /content/kohya-sd-scripts-webui/venv/lib/python3.10/site-packages/cv2/../../lib64:/usr/lib64-nvidia
2023-02-13 17:03:27.283989: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /content/kohya-sd-scripts-webui/venv/lib/python3.10/site-packages/cv2/../../lib64:/usr/lib64-nvidia
2023-02-13 17:03:27.284022: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
A matching Triton is not available, some optimizations will not be enabled.
Error caught was: No module named 'triton'

To create a public link, set share=True in launch().
Started Python: /content/kohya-sd-scripts-webui/kohya_ss/finetune/make_captions.py
Arguments: ['--pretrained_model_name_or_path', '/content/sample_data/Zv1-5-fp16.ckpt', '--train_data_dir', '/content/sample_data/arargue2', '--shuffle_caption', '--caption_extension', '.caption', '--flip_aug', '--resolution', '512', '--enable_bucket', '--min_bucket_reso', '256', '--max_bucket_reso', '1024', '--dataset_repeats', '1', '--output_dir', '/content/sample_data', '--output_name', 'arargue', '--save_precision', 'fp16', '--save_every_n_epochs', '5', '--train_batch_size', '1', '--use_8bit_adam', '--xformers', '--learning_rate', '0.0001', '--max_train_steps', '1600', '--max_data_loader_n_workers', '8', '--gradient_checkpointing', '--gradient_accumulation_steps', '1', '--mixed_precision', 'no', '--clip_skip', '2', '--lr_scheduler', 'constant', '--prior_loss_weight', '1.0', '--save_model_as', 'safetensors', '--network_module', 'networks.lora', '--network_dim', '16', '--network_alpha', '1.0']

TypeError: unsupported operand type(s) for |=: 'dict' and 'dict'

CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching /usr/local/cuda/lib64...
CUDA SETUP: CUDA runtime path found: /usr/local/cuda/lib64/libcudart.so
CUDA SETUP: Highest compute capability among GPUs detected: 7.5
CUDA SETUP: Detected CUDA version 118
CUDA SETUP: Loading binary /usr/local/lib/python3.8/dist-packages/bitsandbytes/libbitsandbytes_cuda118.so...
use 8-bit AdamW optimizer | {}
running training / 学習開始
num train images * repeats / 学習画像の数×繰り返し回数: 1575
num reg images / 正則化画像の数: 0
num batches per epoch / 1epochのバッチ数: 1575
num epochs / epoch数: 2
batch size per device / バッチサイズ: 1
gradient accumulation steps / 勾配を合計するステップ数 = 1
total optimization steps / 学習ステップ数: 1600
Traceback (most recent call last):
File "/content/stable-diffusion-webui/extensions/kohya-sd-scripts-webui/kohya_ss/train_network.py", line 642, in
train(args)
File "/content/stable-diffusion-webui/extensions/kohya-sd-scripts-webui/kohya_ss/train_network.py", line 411, in train
metadata |= {
TypeError: unsupported operand type(s) for |=: 'dict' and 'dict'

extentionとして利用した際のBLIPを用いたMake captionsにパスが通らないエラーがある

とても使いやすいライブラリの提供ありがとうございます。

automatic1111から拡張機能として使った際に、extensions/kohya-sd-scripts-webui/kohya_ss/finetune/へのパスが通らなくてmake_caption.pyの㉛行目がエラーになる気がします。

実際に動かすと下記のようなエラーがでます

Current Working Directory is: /home/xxxx/stable-diffusion-webui
Traceback (most recent call last):
File "/home/xxxx/stable-diffusion-webui/extensions/kohya-sd-scripts-webui/kohya_ss/finetune/make_captions.py", line 111, in <module>
main(args)
File "/home/xxxx/stable-diffusion-webui/extensions/kohya-sd-scripts-webui/kohya_ss/finetune/make_captions.py", line 31, in main
os.chdir('finetune')
FileNotFoundError: [Errno 2] No such file or directory: 'finetune'

current working directoryがおそらく、kohya_ssであることを想定している気がしますが、stable-diffusion-webuiになっています。

もし使い方が謝っているなどありましたら申し訳ありません。

Merging Lora with Model - "Ratios" - TypeError: sequence item 12: expected str instance, float found

I'm trying to merge a Lora into a checkpoint (safetensors), and it won't let me. I think it has something to do with the value in the "Ratios" field. What is the required format for this field?
When I put any integer or float value in the "ratios" field, such as "0.7" (without quotation marks), it gives me this:

Traceback (most recent call last):
File "/opt/conda/lib/python3.10/site-packages/gradio/routes.py", line 337, in run_predict
output = await app.get_blocks().process_api(
File "/opt/conda/lib/python3.10/site-packages/gradio/blocks.py", line 1015, in process_api
result = await self.call_function(
File "/opt/conda/lib/python3.10/site-packages/gradio/blocks.py", line 833, in call_function
prediction = await anyio.to_thread.run_sync(
File "/opt/conda/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/opt/conda/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/opt/conda/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/content/kohya-sd-scripts-webui/scripts/runner.py", line 38, in run
proc = run_python(script_file, get_templates(), get_options(), args)
File "/content/kohya-sd-scripts-webui/scripts/utilities.py", line 277, in run_python
print("Start process: ", " ".join(proc_args))
TypeError: sequence item 12: expected str instance, float found


If I leave the "ratios" field blank, it gives me this:

Traceback (most recent call last):
File "/content/kohya-sd-scripts-webui/kohya_ss/networks/merge_lora.py", line 243, in
merge(args)
File "/content/kohya-sd-scripts-webui/kohya_ss/networks/merge_lora.py", line 173, in merge
assert len(args.models) == len(args.ratios), f"number of models must be equal to number of ratios / モデルの数と重みの数は合わせてください"
TypeError: object of type 'NoneType' has no len()


Where are these typeerrors? What am I doing wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.