comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
55.34k stars 5.84k forks source link

[FLUX] SimpleTune + LoRA + ComfyUI + Load Flux Lora = Error #5071

Open DefinitlyEvil opened 1 month ago

DefinitlyEvil commented 1 month ago

Expected Behavior

lora to load.

Actual Behavior

error'ed out.

Steps to Reproduce

Train a LoRA using SimpleTune, put LoRA in xlabs/loras folder, use Load Flux LoRA node.

Debug Logs

Is model already patched? False
!!! Exception during processing !!! list index out of range
Traceback (most recent call last):
  File ".\ComfyUI\execution.py", line 323, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".\ComfyUI\execution.py", line 198, in get_output_data
    return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File ".\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".\ComfyUI\custom_nodes\x-flux-comfyui\nodes.py", line 133, in loadmodel
    checkpoint, lora_rank = load_flux_lora(os.path.join(dir_xlabs_loras, lora_name))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".\ComfyUI\custom_nodes\x-flux-comfyui\nodes.py", line 75, in load_flux_lora
    a1 = sorted(list(checkpoint[list(checkpoint.keys())[0]].shape))[0]
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range


### Other

_No response_
comfyanonymous commented 1 month ago

Use the regular load lora node.

DefinitlyEvil commented 1 month ago

Use the regular load lora node.

Hi, thanks. I tried it but it did not bring any effects. Probably the training didn't take effect or smth.