Nourepide / ComfyUI-Allor

ComfyUI plugin for image processing and work with alpha chanel.
MIT License
186 stars 22 forks source link

ImageTextMultilineOutlined error #15

Closed jgal14 closed 7 months ago

jgal14 commented 8 months ago

Hi there,

Having some trouble with the Multi-line text node.

It's throwing the following error;

Error occurred when executing ImageTextMultilineOutlined:

'FreeTypeFont' object has no attribute 'getsize_multiline'

File "F:\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "F:\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "F:\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "F:\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Allor\modules\ImageText.py", line 309, in node text_size = font.getsize_multiline(text)

Any suggestions?

Thanks!

HWiese1980 commented 8 months ago

Confirmed. I'm getting the same error with a TTF font

Nourepide commented 8 months ago

The resulting error is due to the fact that the getsize_multiline method has been removed in the Pillow library version 10.0 and above. This causes problems in code where this method is used.

The remaining method of getting the font size to calculate the container size is just awful, I need time to adapt the nodes to the new method.

Nourepide commented 8 months ago

Thanks for feedback. This error should be fixed now in f03591c.

You need to update Allor for the changes to take effect.

In addition, you can be one of the first to see the new documentation I'm writing for Allor.

jgal14 commented 7 months ago

Excellent, that looks to have fixed it! Thanks for your help.

The documentation looks to be coming together nicely too.

On a separate note, one piece of feedback (or potentially user error) is that a useful feature on the image resize nodes would be a 'max height' or 'max width' - I.E resizing to a max height or width dimension whilst maintaining existing aspect ratio.

Appreciate this may be easier said than done!

jgal14 commented 7 months ago

Fixed 👍