Open dchatel opened 3 weeks ago
Sooo, can you send me you LoRA so I do nodes compatible with this?
Well, it's in the zip file I attached to the original message, under the link caption "a flux lora trained on civitai".
I have the same error using a Lora I trained myself using ai-toolkit.
!!! Exception during processing !!! Error(s) in loading state_dict for DoubleStreamBlockLoraProcessor:
Missing key(s) in state_dict: "qkv_lora1.down.weight", "qkv_lora1.up.weight", "proj_lora1.down.weight", "proj_lora1.up.weight", "qkv_lora2.down.weight", "qkv_lora2.up.weight", "proj_lora2.down.weight", "proj_lora2.up.weight".
Traceback (most recent call last):
File "C:\Users\foo\ai\ComfyUI\execution.py", line 317, 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 "C:\Users\foo\ai\ComfyUI\execution.py", line 192, 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 "C:\Users\foo\ai\ComfyUI\execution.py", line 169, in _map_node_over_list
process_inputs(input_dict, i)
File "C:\Users\foo\ai\ComfyUI\execution.py", line 158, in process_inputs
results.append(getattr(obj, func)(**inputs))
File "C:\Users\foo\ai\ComfyUI\custom_nodes\x-flux-comfyui\nodes.py", line 153, in loadmodel
lora_attn_procs[name].load_state_dict(lora_state_dict)
File "C:\Users\foo\ai\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2215, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for DoubleStreamBlockLoraProcessor:
Missing key(s) in state_dict: "qkv_lora1.down.weight", "qkv_lora1.up.weight", "proj_lora1.down.weight", "proj_lora1.up.weight", "qkv_lora2.down.weight", "qkv_lora2.up.weight", "proj_lora2.down.weight", "proj_lora2.up.weight".
i have the same problem loading a LoRA with XFlux made locally by with the ostris ai-toolkit script:
Error occurred when executing FluxLoraLoader:
Error(s) in loading state_dict for DoubleStreamBlockLoraProcessor:
Missing key(s) in state_dict: "qkv_lora1.down.weight", "qkv_lora1.up.weight", "proj_lora1.down.weight", "proj_lora1.up.weight", "qkv_lora2.down.weight", "qkv_lora2.up.weight", "proj_lora2.down.weight", "proj_lora2.up.weight".
File "D:\_AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 317, 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 "D:\_AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 192, 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 "D:\_AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list
process_inputs(input_dict, i)
File "D:\_AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs
results.append(getattr(obj, func)(**inputs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\x-flux-comfyui\nodes.py", line 153, in loadmodel
lora_attn_procs[name].load_state_dict(lora_state_dict)
File "D:\_AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 2152, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
I have the same error using a Lora I trained myself using ai-toolkit.
!!! Exception during processing !!! Error(s) in loading state_dict for DoubleStreamBlockLoraProcessor: Missing key(s) in state_dict: "qkv_lora1.down.weight", "qkv_lora1.up.weight", "proj_lora1.down.weight", "proj_lora1.up.weight", "qkv_lora2.down.weight", "qkv_lora2.up.weight", "proj_lora2.down.weight", "proj_lora2.up.weight". Traceback (most recent call last): File "C:\Users\foo\ai\ComfyUI\execution.py", line 317, 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 "C:\Users\foo\ai\ComfyUI\execution.py", line 192, 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 "C:\Users\foo\ai\ComfyUI\execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "C:\Users\foo\ai\ComfyUI\execution.py", line 158, in process_inputs results.append(getattr(obj, func)(**inputs)) File "C:\Users\foo\ai\ComfyUI\custom_nodes\x-flux-comfyui\nodes.py", line 153, in loadmodel lora_attn_procs[name].load_state_dict(lora_state_dict) File "C:\Users\foo\ai\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 2215, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for DoubleStreamBlockLoraProcessor: Missing key(s) in state_dict: "qkv_lora1.down.weight", "qkv_lora1.up.weight", "proj_lora1.down.weight", "proj_lora1.up.weight", "qkv_lora2.down.weight", "qkv_lora2.up.weight", "proj_lora2.down.weight", "proj_lora2.up.weight".
Using the normal Lora model loader will not report an error
Using the lora workflow provided on x-flux-comfyui to load and use a flux lora trained on civitai, I get this error:
This is due to the following:
Basically, that first tensor in the checkpoint is a scalar, so it has no dimension, thus you can't iterate over its dimensions (obviously).
But if I do a quick "fix" like this:
Then I get the following error: