LarryJane491 / Lora-Training-in-Comfy

This custom node lets you train LoRA directly in ComfyUI!
364 stars 50 forks source link

Training Failure #53

Open gt8101 opened 3 months ago

gt8101 commented 3 months ago

D:\Blender_ComfyUI\ComfyUI\custom_nodes\Lora-Training-in-Comfy/sd-scripts/train_network.py The following values were not passed toaccelerate launchand had defaults used instead: --num_processeswas set to a value of1 --num_machineswas set to a value of1 --mixed_precisionwas set to a value of'no' --dynamo_backendwas set to a value of'no' To avoid this warning pass in values for each of the problematic parameters or runaccelerate config. prepare tokenizer Traceback (most recent call last): File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\Lora-Training-in-Comfy\sd-scripts\train_network.py", line 1012, in <module> trainer.train(args) File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\Lora-Training-in-Comfy\sd-scripts\train_network.py", line 148, in train tokenizer = self.load_tokenizer(args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\Lora-Training-in-Comfy\sd-scripts\train_network.py", line 106, in load_tokenizer tokenizer = train_util.load_tokenizer(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\Lora-Training-in-Comfy\sd-scripts\library\train_util.py", line 3783, in load_tokenizer tokenizer = CLIPTokenizer.from_pretrained(original_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Blender_ComfyUI\ComfyUI\.ext\Lib\site-packages\transformers\tokenization_utils_base.py", line 2032, in from_pretrained raise EnvironmentError( OSError: Can't load tokenizer for 'openai/clip-vit-large-patch14'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'openai/clip-vit-large-patch14' is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer. Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "D:\Blender_ComfyUI\ComfyUI\.ext\Lib\site-packages\accelerate\commands\launch.py", line 1027, in <module> main() File "D:\Blender_ComfyUI\ComfyUI\.ext\Lib\site-packages\accelerate\commands\launch.py", line 1023, in main launch_command(args) File "D:\Blender_ComfyUI\ComfyUI\.ext\Lib\site-packages\accelerate\commands\launch.py", line 1017, in launch_command simple_launcher(args) File "D:\Blender_ComfyUI\ComfyUI\.ext\Lib\site-packages\accelerate\commands\launch.py", line 637, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['D:\\Blender_ComfyUI\\ComfyUI\\.ext\\python.exe', 'D:/Blender_ComfyUI/ComfyUI/custom_nodes/Lora-Training-in-Comfy/sd-scripts/train_network.py', '--enable_bucket', '--pretrained_model_name_or_path=D:\\Blender_ComfyUI\\ComfyUI\\models\\checkpoints\\epicphotogasm_zUniversal.safetensors', '--train_data_dir=D:/Blender_ComfyUI/ComfyUI/output', '--output_dir=D:\\Blender_ComfyUI\\ComfyUI\\models\\loras', '--logging_dir=./logs', '--log_prefix=realvix', '--resolution=512,512', '--network_module=networks.lora', '--max_train_epochs=10', '--learning_rate=1e-4', '--unet_lr=1e-4', '--text_encoder_lr=1e-5', '--lr_scheduler=cosine_with_restarts', '--lr_warmup_steps=0', '--lr_scheduler_num_cycles=1', '--network_dim=32', '--network_alpha=32', '--output_name=realvix', '--train_batch_size=2', '--save_every_n_epochs=10', '--mixed_precision=fp16', '--save_precision=fp16', '--seed=17', '--cache_latents', '--prior_loss_weight=1', '--max_token_length=225', '--caption_extension=.txt', '--save_model_as=safetensors', '--min_bucket_reso=256', '--max_bucket_reso=1584', '--keep_tokens=0', '--xformers', '--shuffle_caption', '--clip_skip=2', '--optimizer_type=AdamW8bit', '--persistent_data_loader_workers', '--log_with=tensorboard', '--clip_skip=2', '--optimizer_type=AdamW8bit', '--persistent_data_loader_workers', '--log_with=tensorboard']' returned non-zero exit status 1. Train finished 2024-06-11 02:48:59,195- root:124- INFO- Prompt executed in 156.70 seconds

Mintbeer96 commented 3 months ago

I encounter the same issue. I think the problem is that I updated the comfyui for sd3 and suddenly everything is broken. I am still debugging this and hopefully I can find something.

Mintbeer96 commented 3 months ago

It turns out the transformer package and the kohya training script both updated. Just pull the lasted git and update your comfyui should work. The kohya script should go to sd-script.