I am going to explain how I managed to make my ComfyUI portable + Lora Training-in-Comfy custom node work: Most of us do not have knowledge about the use of python scripts and we have to spend our lives searching for information on the Git or Reddit networks and yet not all errors can be addressed in the same way and I hope this can be useful for those who your ComfyUi portable throws you all kinds of errors. The first thing is to make sure that if you have any version of Python installed on your operating system (I use Windows 10) that your system environment (cmd, powershell) does not try to run your external python, what interests us is that everything is run from the "python_embeded" folder so that it makes use of its corresponding modules in " Python_embeded/Lib/site-packages) otherwise your "CMD" will run external libraries/modules in an installation that is located in another Python directory (another version of python that you already have installed can generate errors in its different modules) and for this in my case I decided to eliminate all Python paths on my Windows 10 system. Delete all Python-related "system environment variables" entries found in "Path" and then using file explorer copy the path (axample, C:\ComfyUI_windows_portable\python_embeded) to force the system to use of this Python and its modules in this way there will be no conflicts. You probably have to install get-pip.py, to let you run Pip commands in your CMD (use from the gpt chat browser) it will guide you without problems Once this is done, use file explorer and go to the Custom_nodes/Lora Training-in-Comfy custom node folder and using the CMD on your Windows system open a cmd in the same file explorer bar and use pip install requirements_win.txt ( _win for those of us who use Windows, requirements.txt for other systems) so that all the modules required for the Lora trainer are installed. Once this is done, go to Comfyui/custom_nodes/Lora-Training-in-Comfy-main/sd-scripts/ and repeat the same process with the file explorer, insert cmd in the bar and pip install requirements.txt to install modules important ones like "library" that usually generate errors. Finally, you must add a few lines of code with your text editor so that Comfyui does not generate a "setup_logging" error. inside the library folder (python_embeded/Lib/site-packages/ library) is the exscript "utils.py" this must be edited. my configuration that has worked for me provided by ChatGPT: import threading import log def setup_logging(log_file=None): """Configure the logging system.""" # Defines the log format log_format = '%(asctime)s - %(levelname)s - %(message)s' logging.basicConfig(format=log_format, level=logging.INFO, filename=log_file) # Example of how to add an additional console handler (optional) console_handler = logging.StreamHandler() console_handler.setLevel(logging.INFO) console_handler.setFormatter(logging.Formatter(log_format)) logging.getLogger('').addHandler(console_handler) def fire_in_thread(f, *args, **kwargs): """Executes a function in a thread.""" threading.Thread(target=f, args=args, kwargs=kwargs).start() With this it still gives me some errors but I can now train my parrots. edit: if the problem persists, start again from 0 but this time update ComfyUI portable from the .bat file in ComfyUI_windows_portable/update ->update_comfyui_and_python_dependencies.bat I updated it from the beginning but this may cause conflicts with other versions of pytorch remember to have CUDA and its tools installed, this is very important.
@@asyrofmuzakki and a png can implement metadata how the image was done... ultra important for keeping a record for later, or for sharing ... especially in COMFY,... i drop images form civitai into comfy and can see all the nodes and settings which were used...
Dev never updated, so now it's broken and doesn't work with Comfyui, half of the nodes are missing from the menu. There's no Lora checkpoint nodes at all.
: Error while finding module specification for 'accelerate.commands.launch' (ModuleNotFoundError: No module named 'accelerate') I get this error although there is a folder called accelerate in my ComfyUI_windows_portable\python_embeded\Lib\site-packages folder
At first I thought you were just being rude but then the weird ‘mhmm’s and moans got louder and more frequent. @AIFuzz59 I’m so curious what happened lol.
could one/ you implement a xy plot grid to do series of tests with different loras and different weights to be able to see better what combination looks best? if such a thing is possible where would that XY PLOT be implemented? after the checkpoint and before the prompt ? that xy plot grid implemantion could make an interesting video .... i think
@@AIFuzz59 cool... i think it actually the only way to figure out what lora works best and what weight etc works best, the only other way is to randomly guess each time, and manually enter continuously other parameters, whilst an xy grid one can go and do other more productive things and then come back after its done and be utmost precise with the next steps. i am just a noob, and only learned about this last week. and still have a hard time how it is actually done, and where one must implement such a xy plot in between checkpoint , loras , ksamplers, resamplers, and so on... so any help you could post in a video would be just amazing ;)
I have found that the Loras do work without trigger words however you can use the name Of the Lora as a trigger word and it will Increase the impact it has on the image
I've been trying for two days to get this running and to no avail. I've narrowed it down to the xformer not finding the GPU. I've done all the uninstalls of torch, making sure I'm using 1.2.1 but I can't seen to it to engage the GPU, it only wants to use the CPU which causes it to fail. I'm open to any suggestions. I've gone all through the developer's site as well regarding making sure my I have CUDA in my python path, still no dice.
Hey thanks for the reply. What finally got it working was adding the CUDA path to my env variables. ChatGTP was able to help me out. I'm getting a lot of little click away errors while it's starting up, but once it's going on the epochs it's finishing. Thanks for help!
doesn't work! in final step after push Queue prompt create an error "can't open file 'F:\\ComfyUI\\ComfyUI_windows_portable\\custom_nodes\\Lora-Training-in-Comfy\\sd-scripts\\train_network.py': [Errno 2] No such file or directory"
This does not work at all, the requirements text file is just straight up broken. Someone uploaded a hotfix last week that doesn't seem to actually fix anything.
One downside is it doesn't appear to have very many options that you can configure like what max size to scale the images down to or what network rank & alpha you want. You're stuck with whatever defaults it picked for you, but I haven't tried it so perhaps you might be able to adjust those settings in a configuration file somewhere. If you're already going to the trouble of making an alternate install of ComfyUI just for LoRA training, I'm not sure why you wouldn't just use Kohya or another dedicated training app instead and have full control over all of the settings. If it's a matter of wanting a simplied app, then I don't know why you are using ComfyUI at all because it is probably the highest learning curve of any AI image generator due to how you have to have a lot of knowledge to be able to wire everything up from scratch or be limited to only using pre-made workflows, whereas other apps allow you to do many complex things with the click of a few buttons.
@@jsnavely76 it’s time. I have trained Loras on Khoya and it takes several hours. This is a quicker way to get Lota training done. It can be done in less than 30 minutes. That also allows you to experiment with training and trying different things out.
@@jsnavely76 I know many people who have several installations of ComfyUI. It’s not uncommon. It is very helpful as well since there Are times custom nodes do clash with one another
@@AIFuzz59yup I had my comfy completely crash after loading someone's workflow. Couldn't get out of it and had to reinstall. Thank goodness I had a backup alternate comfy install.
I seem to have a issue when I start the training, the prompt is executed in less then a second and nothing is generated: "Error while finding module specification for 'accelerate.commands.launch' (ModuleNotFoundError: No module named 'accelerate')"
For quick lora training it works well. I am sure if the data set were larger, outcome would improve but so will time. I do have a slower machine so also keep that in mind
Hi, i installed this node to ComfyUI and it just doesn't open. I will try a few things i saw on github, but how can I uninstall it if the Comfy doesn't open?
please help me, i get an error like this: C:\My Program Files\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\Lora-Training-in-Comfy/sd-scripts/train_network.py C:\My Program Files\AI\ComfyUI_windows_portable\python_embeded\python.exe: Error while finding module specification for 'accelerate.commands.launch' (ModuleNotFoundError: No module named 'accelerate') how to fix it?
It seems that you can't give us an explanation, like you I also have the same problem and through chatgpt (by asking and pasting the errors) I have managed to solve some errors but it's still the same, the training ends in less than 15 seconds because now It gives me errors with synchronization libraries like Aio.lib and Libaio
AssertionError: Torch not compiled with CUDA enabled I keep getting this error on the clean comfyUI install everytime. I've followed the instructions on what to do about that on the main ComfyUI Github page about uninstalling the Torch an re-installing it, still get the error. Has anyone else had this issue? Also, after downloading and installing the LJRE nodes, I don't see the loader or saver nodes, just the Training and Training Advanced options.
I followed as you guide and i successfully generate captioning for all of my images after that when i try to train Lora and hit the button Queue Prompt it did not do anything and below is the log of my CMD C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Lora-Training-in-Comfy/sd-scripts/train_network.py The following values were not passed to `accelerate launch` and had defaults used instead: `--num_processes` was set to a value of `1` `--num_machines` was set to a value of `1` `--mixed_precision` was set to a value of `'no'` `--dynamo_backend` was set to a value of `'no'` To avoid this warning pass in values for each of the problematic parameters or run `accelerate config`. Traceback (most recent call last): File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Lora-Training-in-Comfy\sd-scripts\train_network.py", line 26, in from diffusers import DDPMScheduler File "C: oop-unleashed-main\installer\installer_files\env\lib\site-packages\diffusers\__init__.py", line 4, in from .utils import is_inflect_available, is_transformers_available, is_unidecode_available File "C: oop-unleashed-main\installer\installer_files\env\lib\site-packages\diffusers\utils\__init__.py", line 18, in import importlib_metadata ModuleNotFoundError: No module named 'importlib_metadata' Traceback (most recent call last): File "C: oop-unleashed-main\installer\installer_files\env\lib unpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C: oop-unleashed-main\installer\installer_files\env\lib unpy.py", line 86, in _run_code exec(code, run_globals) File "C: oop-unleashed-main\installer\installer_files\env\lib\site-packages\accelerate\commands\launch.py", line 996, in main() File "C: oop-unleashed-main\installer\installer_files\env\lib\site-packages\accelerate\commands\launch.py", line 992, in main launch_command(args) File "C: oop-unleashed-main\installer\installer_files\env\lib\site-packages\accelerate\commands\launch.py", line 986, in launch_command simple_launcher(args) File "C: oop-unleashed-main\installer\installer_files\env\lib\site-packages\accelerate\commands\launch.py", line 628, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['C:\ oop-unleashed-main\\installer\\installer_files\\env\\python.exe', 'C:/ComfyUI_windows_portable/ComfyUI/custom_nodes/Lora-Training-in-Comfy/sd-scripts/train_network.py', '--enable_bucket', '--pretrained_model_name_or_path=C:\\ComfyUI_windows_portable\\ComfyUI\\models\\checkpoints\\epicrealism_naturalSinRC1VAE.safetensors', '--train_data_dir=C:/database', '--output_dir=models/loras', '--logging_dir=./logs', '--log_prefix=Nini_Lora_jibMixRealisticXL', '--resolution=512,512', '--network_module=networks.lora', '--max_train_epochs=50', '--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=Nini_Lora_jibMixRealisticXL', '--train_batch_size=1', '--save_every_n_epochs=10', '--mixed_precision=fp16', '--save_precision=fp16', '--seed=14', '--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', '--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
Thanks for your tutorial. but I've got an error. 'C:\StabilityMatrix-win-x64\Data\Assets\Python310\python.exe: Error while finding module specification for 'accelerate.commands.launch' (ModuleNotFoundError: No module named 'accelerate')' , could you let me know how to fix it?
shouldn't it install the updated python code when comfy UI updates? and how would you know if the version installed has the correct version? @@AIFuzz59
You don’t have to but I did because my main ComfyUI has many custom nodes and slows up start time. Having a several ComfyUI installs is pretty common especially for testing different nodes
@@AIFuzz59 Indeed, I noticed :) Tried a fresh Comfyui install under windows 11 only for the purpose of training and the UI worked, then, after installing the training node all hell broke loose. Eh, I'll try again in a couple of days and keep you posted in Git :)
hi, unfortunately in the final part when you show all the windows are connected, I get stuck because I don't know how to connect them. Then on Lora name I get undefined. towards the end your tutorial becomes a mess
c:\users\admin\appdata\local\programs\python\python311\python.exe:error finding module parameters for speed.commands.launch (modulenotfounderror:no module named `accelerate`) ship is completed I'm having this error, can you help me? Thank you very much. @@AIFuzz59
All my captions were generated, and at the moment of execution, after having correctly set up the advanced LoRA training node in Comfy, I started the training and received the following error message: Error occurred when executing LoRA Caption Save: list index out of range File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\Image-Captioning-in-ComfyUI\LoRAcaption.py", line 53, in save_text_file filename = self.generate_filename(path, namelistsplit, file_extension) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\Image-Captioning-in-ComfyUI\LoRAcaption.py", line 65, in generate_filename filename = f"{namelistsplit[counter-1]}{extension}" ~~~~~~~~~~~~~^^^^^^^^^^^
@@AIFuzz59 in fact everything is ok I even optimized and cleaned all the captions one by one, I installed all the dependencies which were necessary and indicated in the document "requirements_win.txt" and the training does not want to start
I got this error, please help to fix it. Error occurred when executing LoRA Caption Load: cannot access local variable 'image1' where it is not associated with a value File "E:\Stable\ComfyUI_win\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Stable\ComfyUI_win\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Stable\ComfyUI_win\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Stable\ComfyUI_win\ComfyUI\custom_nodes\Image-Captioning-in-ComfyUI\LoRAcaption.py", line 148, in captionload return text, path, image1, len(images)
@@AIFuzz59 i already had the node in comfy. it stops at 97 percent of load. i am trying to make a folder named "database" and put there the folder with the png files. it didn't work. the console writes timeout error from none. as you can see i am quite slow in this. very grateful for your answer.
Programs\Python\Python311\python.exe: Error while finding module specification for 'accelerate.commands.launch' (ModuleNotFoundError: No module named 'accelerate') Train finished. i get this error while training, any help ?
raise RuntimeError('Error(s) in loading state_dict for {}: \t{}'.format( RuntimeError: Error(s) in loading state_dict for CLIPTextModel: Unexpected key(s) in state_dict: "text_model.embeddings.position_ids".
LORA CAPTION LOAD, i got this error, can you help me Error occurred when executing LoRA Caption Load: cannot access local variable 'image1' where it is not associated with a value File "D:\Stable Diffusion\ComfyUI_windows_portabless\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Stable Diffusion\ComfyUI_windows_portabless\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Stable Diffusion\ComfyUI_windows_portabless\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Stable Diffusion\ComfyUI_windows_portabless\ComfyUI\custom_nodes\Image-Captioning-in-ComfyUI\LoRAcaption.py", line 148, in captionload return text, path, image1, len(images) ^^^^^^
hey i get this error when tryhing to generate caption: Error occurred when executing LoRA Caption Load: cannot access local variable 'image1' where it is not associated with a value File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\Image-Captioning-in-ComfyUI-main\LoRAcaption.py", line 148, in captionload return text, path, image1, len(images) ^^^^^^ what can i do?
I am going to explain how I managed to make my ComfyUI portable + Lora Training-in-Comfy custom node work:
Most of us do not have knowledge about the use of python scripts and we have to spend our lives searching for information on the Git or Reddit networks and yet not all errors can be addressed in the same way and I hope this can be useful for those who your ComfyUi portable throws you all kinds of errors.
The first thing is to make sure that if you have any version of Python installed on your operating system (I use Windows 10) that your system environment (cmd, powershell) does not try to run your external python, what interests us is that everything is run from the "python_embeded" folder so that it makes use of its corresponding modules in " Python_embeded/Lib/site-packages) otherwise your "CMD" will run external libraries/modules in an installation that is located in another Python directory (another version of python that you already have installed can generate errors in its different modules) and for this in my case I decided to eliminate all Python paths on my Windows 10 system.
Delete all Python-related "system environment variables" entries found in "Path" and then using file explorer copy the path (axample, C:\ComfyUI_windows_portable\python_embeded) to force the system to use of this Python and its modules in this way there will be no conflicts.
You probably have to install get-pip.py, to let you run Pip commands in your CMD (use from the gpt chat browser) it will guide you without problems
Once this is done, use file explorer and go to the Custom_nodes/Lora Training-in-Comfy custom node folder and using the CMD on your Windows system open a cmd in the same file explorer bar and use pip install requirements_win.txt ( _win for those of us who use Windows, requirements.txt for other systems) so that all the modules required for the Lora trainer are installed.
Once this is done, go to Comfyui/custom_nodes/Lora-Training-in-Comfy-main/sd-scripts/ and repeat the same process with the file explorer, insert cmd in the bar and pip install requirements.txt to install modules important ones like "library" that usually generate errors.
Finally, you must add a few lines of code with your text editor so that Comfyui does not generate a "setup_logging" error.
inside the library folder (python_embeded/Lib/site-packages/ library) is the exscript "utils.py" this must be edited.
my configuration that has worked for me provided by ChatGPT:
import threading
import log
def setup_logging(log_file=None):
"""Configure the logging system."""
# Defines the log format
log_format = '%(asctime)s - %(levelname)s - %(message)s'
logging.basicConfig(format=log_format, level=logging.INFO, filename=log_file)
# Example of how to add an additional console handler (optional)
console_handler = logging.StreamHandler()
console_handler.setLevel(logging.INFO)
console_handler.setFormatter(logging.Formatter(log_format))
logging.getLogger('').addHandler(console_handler)
def fire_in_thread(f, *args, **kwargs):
"""Executes a function in a thread."""
threading.Thread(target=f, args=args, kwargs=kwargs).start()
With this it still gives me some errors but I can now train my parrots.
edit: if the problem persists, start again from 0 but this time update ComfyUI portable from the .bat file in ComfyUI_windows_portable/update ->update_comfyui_and_python_dependencies.bat
I updated it from the beginning but this may cause conflicts with other versions of pytorch
remember to have CUDA and its tools installed, this is very important.
PRO TIP: make sure your images are in PNG format. If not, you may get an error during the tagging phase.
THANK YOU BUDDY! YOU TOTALLY SAVED MY LIFE :)
@@asyrofmuzakki and a png can implement metadata how the image was done... ultra important for keeping a record for later, or for sharing ... especially in COMFY,... i drop images form civitai into comfy and can see all the nodes and settings which were used...
but jpg can store some prompt too
bro thank you
Dev never updated, so now it's broken and doesn't work with Comfyui, half of the nodes are missing from the menu. There's no Lora checkpoint nodes at all.
i was able to fix this buy running the comfyui manager installer then rerun the comfyui updater script.
@@shaunlake8016 Thank you
: Error while finding module specification for 'accelerate.commands.launch' (ModuleNotFoundError: No module named 'accelerate') I get this error although there is a folder called accelerate in my ComfyUI_windows_portable\python_embeded\Lib\site-packages folder
Thanks. Not yet tested but I think N-nodes GPT-loader simple and GPT-sampler could also be included in the captioning process.
How do I get the 1.21 version of pytorch for a separate portable install?
that's what im sayin' wtf this guy doesnt explain shit
I have wd14 and training nodes installed, my comfyui uses cu 121 however I do not see lora caption load or lora caption save?
Missing for me too...
Thank you so much for making the video on this interesting topic. Will try out the technique....
No problem! Have fun with it!
audio is sooo weird
Thanks!
Rude
At first I thought you were just being rude but then the weird ‘mhmm’s and moans got louder and more frequent. @AIFuzz59 I’m so curious what happened lol.
@@dmcdcm It is typical sound after overuse of noise reduction
Was that a baby in the background?
Awesome thank you for this tutorial! I'm going to try it! :)
Sure thing! Let us know how it goes
could one/ you implement a xy plot grid to do series of tests with different loras and different weights to be able to see better what combination looks best? if such a thing is possible where would that XY PLOT be implemented? after the checkpoint and before the prompt ? that xy plot grid implemantion could make an interesting video .... i think
Great idea! We did a video on XY plotting a while back. It would be interesting to work it into this one
@@AIFuzz59 cool... i think it actually the only way to figure out what lora works best and what weight etc works best, the only other way is to randomly guess each time, and manually enter continuously other parameters, whilst an xy grid one can go and do other more productive things and then come back after its done and be utmost precise with the next steps. i am just a noob, and only learned about this last week. and still have a hard time how it is actually done, and where one must implement such a xy plot in between checkpoint , loras , ksamplers, resamplers, and so on... so any help you could post in a video would be just amazing ;)
Thank you so much for the tutorial! One question, how to set the trigger word for lora? Or you don't need it for these loras?
I have found that the Loras do work without trigger words however you can use the name
Of the Lora as a trigger word and it will
Increase the impact it has on the image
not working anymore if it was ever working at all
Awesome! Thanks for the vid
No problem!
SDXL models training lora is not working with that node((
I've been trying for two days to get this running and to no avail. I've narrowed it down to the xformer not finding the GPU. I've done all the uninstalls of torch, making sure I'm using 1.2.1 but I can't seen to it to engage the GPU, it only wants to use the CPU which causes it to fail. I'm open to any suggestions. I've gone all through the developer's site as well regarding making sure my I have CUDA in my python path, still no dice.
Have you tried to uninstall xformers and install it fresh? Also are you using a new fresh ComfyUI install? You also should not update ComfyUi
Hey thanks for the reply. What finally got it working was adding the CUDA path to my env variables. ChatGTP was able to help me out. I'm getting a lot of little click away errors while it's starting up, but once it's going on the epochs it's finishing. Thanks for help!
ayo whats that background noise 🌚
I am sure he is using AI Voice.
It's called an "hallucination" when you use a trained voice
doesn't work! in final step after push Queue prompt create an error "can't open file 'F:\\ComfyUI\\ComfyUI_windows_portable\\custom_nodes\\Lora-Training-in-Comfy\\sd-scripts\\train_network.py': [Errno 2] No such file or directory"
This does not work at all, the requirements text file is just straight up broken. Someone uploaded a hotfix last week that doesn't seem to actually fix anything.
it works actually
Thanks for this. How do you install the requirements? Python?
th-cam.com/video/W75iBfnFmnU/w-d-xo.html
Very cool!! Is it possible to train SDXL Loras?
Yes!
Just make sure the base model
You train on is an sdxl model
Lol were you hungry when you recorded the voice over?
Yes very
please tell me if there is an error - list index out of range , how to fix it?
@@dmitriy_fatio9992 are you photos labeled correctly and in the right format?
thank you for this tutorial. Are there any downsides in comparison to Kohya training?
So far the only downside is that with some models, it doesn’t click with the Lora
One downside is it doesn't appear to have very many options that you can configure like what max size to scale the images down to or what network rank & alpha you want. You're stuck with whatever defaults it picked for you, but I haven't tried it so perhaps you might be able to adjust those settings in a configuration file somewhere. If you're already going to the trouble of making an alternate install of ComfyUI just for LoRA training, I'm not sure why you wouldn't just use Kohya or another dedicated training app instead and have full control over all of the settings. If it's a matter of wanting a simplied app, then I don't know why you are using ComfyUI at all because it is probably the highest learning curve of any AI image generator due to how you have to have a lot of knowledge to be able to wire everything up from scratch or be limited to only using pre-made workflows, whereas other apps allow you to do many complex things with the click of a few buttons.
@@jsnavely76 it’s time. I have trained Loras on Khoya and it takes several hours. This is a quicker way to get Lota training done. It can be done in less than 30 minutes. That also allows you to experiment with training and trying different things out.
@@jsnavely76 I know many people who have several installations of ComfyUI. It’s not uncommon. It is very helpful as well since there
Are times custom nodes do clash with one another
@@AIFuzz59yup I had my comfy completely crash after loading someone's workflow. Couldn't get out of it and had to reinstall. Thank goodness I had a backup alternate comfy install.
I seem to have a issue when I start the training, the prompt is executed in less then a second and nothing is generated:
"Error while finding module specification for 'accelerate.commands.launch' (ModuleNotFoundError: No module named 'accelerate')"
You may need to install accelerate
so 38min for 19 images - Slower than Khoya - but seems to get a good quality, maybe worth a try.
For quick lora training it works well. I am sure if the data set were larger, outcome would improve but so will time. I do have a slower machine so also keep that in mind
@AIFuzz59 shit ive trained dfl models for 3 weeks, this is so much easier.😂
@@AIFuzz59 what machine are you running? I'm trying to workout roughly how quick this will be on a NVIDIA L4 32 GB
Thx Bro, really good and helpfull
Where can I find LJRE ??? I don't find it on the manager
Hi, i installed this node to ComfyUI and it just doesn't open. I will try a few things i saw on github, but how can I uninstall it if the Comfy doesn't open?
kudos for not using friggin AI voice. I am tired of all the sibilant artifacts distracting me while trying to actually figure something out
I am issues installing the requirement files.... giving me error
me too, u solve this ?
you get a new follower :) nice video! ... do you know how to merge loras in comfyui ? thx
Yes, there are a few Lora merge custom nodes out there. You can even use a Lora stacker which works well. I’ll find some and do a video on the options
@@AIFuzz59 nice!
please help me, i get an error like this:
C:\My Program Files\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\Lora-Training-in-Comfy/sd-scripts/train_network.py
C:\My Program Files\AI\ComfyUI_windows_portable\python_embeded\python.exe: Error while finding module specification for 'accelerate.commands.launch' (ModuleNotFoundError: No module named 'accelerate')
how to fix it?
It seems that you can't give us an explanation, like you I also have the same problem and through chatgpt (by asking and pasting the errors) I have managed to solve some errors but it's still the same, the training ends in less than 15 seconds because now It gives me errors with synchronization libraries like Aio.lib and Libaio
@@seaviwtf9796 got this error too :(
pip install accelerate
i wrote this in cmd and it fixed it.
RuntimeError: unmatched '}' in format string
Don't know how to fix it....
AssertionError: Torch not compiled with CUDA enabled
I keep getting this error on the clean comfyUI install everytime. I've followed the instructions on what to do about that on the main ComfyUI Github page about uninstalling the Torch an re-installing it, still get the error. Has anyone else had this issue?
Also, after downloading and installing the LJRE nodes, I don't see the loader or saver nodes, just the Training and Training Advanced options.
Did you figure it out?
@@amorgan5844 hi yes! Thanks. Took a while and I’m not even sure what I did but it works now.
same here, did everything, installing Pytorch, installing cuda different versions...nothing works
If you do not have a Nvidia card then CUDA will not work so uninstall it and be prepared for longer wait times. Spent days finally working this out.
I followed as you guide and i successfully generate captioning for all of my images after that when i try to train Lora and hit the button Queue Prompt it did not do anything and below is the log of my CMD
C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Lora-Training-in-Comfy/sd-scripts/train_network.py
The following values were not passed to `accelerate launch` and had defaults used instead:
`--num_processes` was set to a value of `1`
`--num_machines` was set to a value of `1`
`--mixed_precision` was set to a value of `'no'`
`--dynamo_backend` was set to a value of `'no'`
To avoid this warning pass in values for each of the problematic parameters or run `accelerate config`.
Traceback (most recent call last):
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Lora-Training-in-Comfy\sd-scripts\train_network.py", line 26, in
from diffusers import DDPMScheduler
File "C:
oop-unleashed-main\installer\installer_files\env\lib\site-packages\diffusers\__init__.py", line 4, in
from .utils import is_inflect_available, is_transformers_available, is_unidecode_available
File "C:
oop-unleashed-main\installer\installer_files\env\lib\site-packages\diffusers\utils\__init__.py", line 18, in
import importlib_metadata
ModuleNotFoundError: No module named 'importlib_metadata'
Traceback (most recent call last):
File "C:
oop-unleashed-main\installer\installer_files\env\lib
unpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:
oop-unleashed-main\installer\installer_files\env\lib
unpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:
oop-unleashed-main\installer\installer_files\env\lib\site-packages\accelerate\commands\launch.py", line 996, in
main()
File "C:
oop-unleashed-main\installer\installer_files\env\lib\site-packages\accelerate\commands\launch.py", line 992, in main
launch_command(args)
File "C:
oop-unleashed-main\installer\installer_files\env\lib\site-packages\accelerate\commands\launch.py", line 986, in launch_command
simple_launcher(args)
File "C:
oop-unleashed-main\installer\installer_files\env\lib\site-packages\accelerate\commands\launch.py", line 628, in simple_launcher
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['C:\
oop-unleashed-main\\installer\\installer_files\\env\\python.exe', 'C:/ComfyUI_windows_portable/ComfyUI/custom_nodes/Lora-Training-in-Comfy/sd-scripts/train_network.py', '--enable_bucket', '--pretrained_model_name_or_path=C:\\ComfyUI_windows_portable\\ComfyUI\\models\\checkpoints\\epicrealism_naturalSinRC1VAE.safetensors', '--train_data_dir=C:/database', '--output_dir=models/loras', '--logging_dir=./logs', '--log_prefix=Nini_Lora_jibMixRealisticXL', '--resolution=512,512', '--network_module=networks.lora', '--max_train_epochs=50', '--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=Nini_Lora_jibMixRealisticXL', '--train_batch_size=1', '--save_every_n_epochs=10', '--mixed_precision=fp16', '--save_precision=fp16', '--seed=14', '--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', '--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
Thanks for your tutorial. but I've got an error. 'C:\StabilityMatrix-win-x64\Data\Assets\Python310\python.exe: Error while finding module specification for 'accelerate.commands.launch' (ModuleNotFoundError: No module named 'accelerate')' , could you let me know how to fix it?
Can you try to reinstall accelerate?
Can you guide me on how to accelerate?@@AIFuzz59
@@AIFuzz59 How to reinstall accelerate?
So what version of torch was the bad one ??? and how would you roll back to the right version?
It would be 1.18
shouldn't it install the updated python code when comfy UI updates? and how would you know if the version installed has the correct version?
@@AIFuzz59
Hm, as long as we have to make a second installation of comfy, i don't know why i should prefer this to kohya...
You don’t have to but I did because my main ComfyUI has many custom nodes and slows up start time. Having a several ComfyUI installs is pretty common especially for testing different nodes
I don’t understand the ‘comfy version’ thing at the beginning… someone can help me?
it's data base not betabase
i instaled in the custom nodes, but are missing the load and save node of lora training, any advice? thanks
same here
It's the custom node called Image-Captioning-in-ComfyUI
Is that your microphone, or have you not eaten for a day or so?
I've installed, reinstalled and run updates.... only 3 nodes apear for me
thats because he didn't mention you have to install the others ones appart, I struggled with this too
I must ask...how much VRAM for 1.5 vs SDXL?
I have 8gb VRAM and am able to train both Sd 1.5 and SDXL so I would say at least 8
@@AIFuzz59 I see. Well, tomorrow I'll try training with my 2070QMax on an SDXL model and get back with the results. ThankS!
I just throws an error as soon as I start training so...I'll get back to You on github :D
@@Muhilica what error are you getting? The version of Pystorch is pretty important and throws a lot of errors
@@AIFuzz59 Indeed, I noticed :) Tried a fresh Comfyui install under windows 11 only for the purpose of training and the UI worked, then, after installing the training node all hell broke loose. Eh, I'll try again in a couple of days and keep you posted in Git :)
do you have to link to the pytourch cu121 ???
Lora Training in Comfyui does nothing.
hi, unfortunately in the final part when you show all the windows are connected, I get stuck because I don't know how to connect them. Then on Lora name I get undefined. towards the end your tutorial becomes a mess
Ok I apologize, I’m going to upload an updated version soon
@@AIFuzz59 hi, let me know when the new updated tutorial comes out :)
@@AIFuzz59 Hi, have you done the new updated tutorial?
Does comfy ui also work with fine tuning LLMs?
Not yet but hopefully soon
I'm getting this error, can you help me?, (cannot access local variable 'image1' where it is not associated with a value.)
All the images need to be in png format. You will get that error if they are not
Thank you very much, I have done it.@@AIFuzz59
c:\users\admin\appdata\local\programs\python\python311\python.exe:error finding module parameters for speed.commands.launch (modulenotfounderror:no module named `accelerate`)
ship is completed
I'm having this error, can you help me? Thank you very much. @@AIFuzz59
Thx btw but not work for me. Tons for errors... Back to old method
All my captions were generated, and at the moment of execution, after having correctly set up the advanced LoRA training node in Comfy, I started the training and received the following error message: Error occurred when executing LoRA Caption Save:
list index out of range
File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\Image-Captioning-in-ComfyUI\LoRAcaption.py", line 53, in save_text_file
filename = self.generate_filename(path, namelistsplit, file_extension)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\Image-Captioning-in-ComfyUI\LoRAcaption.py", line 65, in generate_filename
filename = f"{namelistsplit[counter-1]}{extension}"
~~~~~~~~~~~~~^^^^^^^^^^^
Did the captions save as txt files in the folder?
@@AIFuzz59 in fact everything is ok I even optimized and cleaned all the captions one by one, I installed all the dependencies which were necessary and indicated in the document "requirements_win.txt" and the training does not want to start
it give me error when using the wd14
am having an issue in which it can't find my images in database for some reason , mines are all in PNG's aswell, can I get anyones help pls?
according to the original doc of it, you should rename the directory of training images into {number}_{whatever} format
Bruh you better off using a normal tts that AI voice filter or voice is really really weird
How do I install the node?
You would go to their GitHub page and install it to your custom nodes folder in ComfyUI
FLUX.1 ؟
Not working, after done nothing its created.
Your stomach noises are hilarious. Hope you finally had a sandwich.
I got this error, please help to fix it.
Error occurred when executing LoRA Caption Load:
cannot access local variable 'image1' where it is not associated with a value
File "E:\Stable\ComfyUI_win\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\Stable\ComfyUI_win\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\Stable\ComfyUI_win\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\Stable\ComfyUI_win\ComfyUI\custom_nodes\Image-Captioning-in-ComfyUI\LoRAcaption.py", line 148, in captionload
return text, path, image1, len(images)
something similar here too
same here
same here!!!
same
when using png (not jpg) it does work
failed to download tagger. why'?
Is this downloading it from the GitHub?
@@AIFuzz59 i already had the node in comfy. it stops at 97 percent of load. i am trying to make a folder named "database" and put there the folder with the png files. it didn't work. the console writes timeout error from none. as you can see i am quite slow in this. very grateful for your answer.
finally it works ! great nodes @@AIFuzz59
DON'T install this dependency, it destroyed my ComfyUI installation! Now it says it cannot find the torch Cuda.
It works fine. I suggested using a fresh install of ComfyUI if you are nervous and don’t know what you are doing.
@@AIFuzz59 same here every time, after a fresh install ComfyUI If I just install the node the same error appears what could it be? win11?
@@kinenbib what error is it?
Is this AI narrated?
Programs\Python\Python311\python.exe: Error while finding module specification for 'accelerate.commands.launch' (ModuleNotFoundError: No module named 'accelerate')
Train finished.
i get this error while training, any help ?
Go to the install packages and type in Accelerate, restart ComfyuI and you should have it
@@AIFuzz59 sorry i just got time to get on comfy, where do i find these install packages ? sorry to burden u cant u guide me through it if u dont mind
@@AIFuzz59 Install Packages? Sorry do you mean Custom Nodes Manager, i'm not sure where to look :(
@@AIFuzz59 oh i just had to write: pip install accelerate
in cmd
Wtf is going on with your voice? Filter?
raise RuntimeError('Error(s) in loading state_dict for {}:
\t{}'.format(
RuntimeError: Error(s) in loading state_dict for CLIPTextModel:
Unexpected key(s) in state_dict: "text_model.embeddings.position_ids".
LORA CAPTION LOAD, i got this error, can you help me
Error occurred when executing LoRA Caption Load:
cannot access local variable 'image1' where it is not associated with a value
File "D:\Stable Diffusion\ComfyUI_windows_portabless\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Stable Diffusion\ComfyUI_windows_portabless\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Stable Diffusion\ComfyUI_windows_portabless\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Stable Diffusion\ComfyUI_windows_portabless\ComfyUI\custom_nodes\Image-Captioning-in-ComfyUI\LoRAcaption.py", line 148, in captionload
return text, path, image1, len(images)
^^^^^^
Works only with png files
I got that error because I hadn't set the location of the png file correctly.
hey i get this error when tryhing to generate caption:
Error occurred when executing LoRA Caption Load:
cannot access local variable 'image1' where it is not associated with a value
File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\Image-Captioning-in-ComfyUI-main\LoRAcaption.py", line 148, in captionload
return text, path, image1, len(images)
^^^^^^
what can i do?
All the images need to be in PNG format. You will get that error if they are in jpg or any other format
I got that error because I hadn't set the location of the png file correctly.