chflame163 / ComfyUI_LayerStyle

A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
MIT License
676 stars 33 forks source link

LayerColor:AutoAdjust issue. #93

Closed axior closed 1 week ago

axior commented 1 month ago

Hello, I am testing your AutoAdjust node and it somehow breaks the comfyui workflow, it works well if attaching the node to a previewer or save node, but when I link it to another part of the workflow (image batch or depthanything for example) it gives an error, this is the error I got for image batch: Sizes of tensors must match except in dimension 0. Expected size 4 but got size 3 for tensor number 1 in the list.

File "D:\AI\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute

output_data, output_ui = get_output_data(obj, input_data_all)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "D:\AI\ComfyUI\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 "D:\AI\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-0246\utils.py", line 381, in new_func

res_value = old_func(*final_args, **kwargs)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "D:\AI\ComfyUI\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 "D:\AI\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\masquerade-nodes-comfyui\MaskNodes.py", line 1124, in append

result = torch.cat((result, image2), 0)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I have tried with other nodes from LayerStyle and those work without any issues.

Here is a screenshot recreating the issue with Depth Anything

Screenshot 2024-05-13 alle 21 33 53

chflame163 commented 1 month ago

That is a bug. Cause of the issue is that AutoAdjust node output is set to RGBA mode, it has been fixed now. But note that if the input image is RGBA, then will still be output to RGBA. At this time, if the subsequent node does not support such format, please convert it to RGB first. You can use ImageRemoveAlpha node to implement it.

axior commented 1 month ago

That is a bug. Cause of the issue is that AutoAdjust node output is set to RGBA mode, it has been fixed now. But note that if the input image is RGBA, then will still be output to RGBA. At this time, if the subsequent node does not support such format, please convert it to RGB first. You can use ImageRemoveAlpha node to implement it.

Thank you!! Damn of course it's alpha, don't know why I didn't think of this, it also happened in the past and I figured it out, I'm getting old..