Stability-AI / StableSwarmUI

StableSwarmUI, A Modular Stable Diffusion Web-User-Interface, with an emphasis on making powertools easily accessible, high performance, and extensibility.
MIT License
4.52k stars 361 forks source link

SwarmLoraLoader no longer working in ComfyUI backend #375

Closed TheCyberQuake closed 3 months ago

TheCyberQuake commented 3 months ago

Loras will no longer work in comfyui backend when using SwarmLoraLoader, and generates this error:

Error occurred when executing SwarmLoraLoader:

'NoneType' object has no attribute 'lower'

File "/media/thecyberquake/File_Cache/AI/StableSwarmUI/dlbackend/ComfyUI/execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/media/thecyberquake/File_Cache/AI/StableSwarmUI/dlbackend/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 "/media/thecyberquake/File_Cache/AI/StableSwarmUI/dlbackend/ComfyUI/execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "/media/thecyberquake/File_Cache/AI/StableSwarmUI/src/BuiltinExtensions/ComfyUIBackend/ExtraNodes/SwarmComfyCommon/SwarmLoraLoader.py", line 47, in load_loras lora = comfy.utils.load_torch_file(lora_path, safe_load=True) File "/media/thecyberquake/File_Cache/AI/StableSwarmUI/dlbackend/ComfyUI/comfy/utils.py", line 13, in load_torch_file if ckpt.lower().endswith(".safetensors"):

I've tried fully redownloading StableSwarmUI. Images generate fine running through the comfyui workflow without a lora, and I can generate images with a lora if I don't use a comfyui workflow.

TheCyberQuake commented 3 months ago

Not too familiar with the codebase, but I have found that it seems that the main front-end is truncating file extension from Lora files, but when that is passed to SwarmLoraLoader, the calls it makes to ComfyUI are also excluding the file extension (usually .safetensors) and is then causing it to throw the error. Manually adding the lora in the workflow with the .safetensors works, as does manually adding the lora using and making sure to add the .safetensors. Using the lora by clicking can't be made to work because that does not allow me to edit what gets passed.

mcmonkey4eva commented 3 months ago

Ohp, true -- fixed!