XLabs-AI / x-flux-comfyui

Apache License 2.0
1.15k stars 73 forks source link

Error if using GGUF checkpoint with Flux IP Adapter #72

Open EnragedAntelope opened 3 months ago

EnragedAntelope commented 3 months ago

!!! Exception during processing !!! 'Linear' object has no attribute 'out_features' Traceback (most recent call last): File "D:\ComfyUI\execution.py", line 316, 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:\ComfyUI\execution.py", line 191, 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:\ComfyUI\execution.py", line 168, in _map_node_over_list process_inputs(input_dict, i) File "D:\ComfyUI\execution.py", line 157, in process_inputs results.append(getattr(obj, func)(**inputs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\custom_nodes\x-flux-comfyui\nodes.py", line 495, in applymodel patches=FluxUpdateModules(tyanochky, pbar) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\custom_nodes\x-flux-comfyui\utils.py", line 81, in FluxUpdateModules patches[f"double_blocks.{i}"]=CopyDSB(flux_model.diffusion_model.double_blocks[i]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\custom_nodes\x-flux-comfyui\utils.py", line 19, in CopyDSB mlp_hidden_dim = tyan.img_mlp[0].out_features ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1915, in getattr raise AttributeError( AttributeError: 'Linear' object has no attribute 'out_features'

Arron17 commented 3 months ago

GGUF is currently unsupported unfortunately - https://huggingface.co/XLabs-AI/flux-ip-adapter/discussions/6

But they have added it into their "Todo" section - https://github.com/XLabs-AI/x-flux-comfyui/blob/main/CHANGELOG.md

hartmark commented 3 months ago

Too bad GGUF is not working because I run out of memory otherwise. I guess I have to wait a bit for GGUF to be implemented.

PS. They should make a note here in the readme that it's not currently supported.

cchance27 commented 3 months ago

Aw shit that sucks hope its fixed soon.

swearos commented 3 months ago

Comment out these two lines and temporarily hardcode: mlp_ratio = 4, https://github.com/XLabs-AI/x-flux-comfyui/blob/202d1977692876384200fc2ff5dccd84172f34c2/utils.py#L19

Slava-On commented 3 months ago

@swearos

I found utils.py in the following folder: ComfyUI\custom_nodes\x-flux-comfyui Commenting the suggested 2 lines and adding mlp_ratio = 4 did not fix the issue, that I was also getting. It started after updating ComfyUI yesterday, but workflows worked before... Shall I open a separate issue for it?

image

swearos commented 3 months ago

@Slava-On You should read the error message carefully, it is clearly written that numpy 2.0 does not support newbyteorder, you can try to reduce numpy version, such as 1.24.4

Slava-On commented 3 months ago

Thank you, @swearos I uninstalled numpy and it fixed my issue.

Anghellia commented 3 months ago

Hi, we added GGUF support in our nodes recently, please try again.

hartmark commented 3 months ago

Thanks, it works well with GGUF now