diontimmer/ComfyUI-Vextra-Nodes

Pillow 10.x deprecates "textsize" which breaks the add text node

Opened this issue · 0 comments

def add_text_to_image(img, font_ttf, size, x, y, text, color_rgb, center=False, rotate=0):
draw = ImageDraw.Draw(img)
myFont = ImageFont.truetype(font_ttf, size)
text_width, text_height = draw.textsize(text, font=myFont)

Suggestion from the error itself:

DeprecationWarning: textsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use textbbox or textlength instead.
textwidth, textheight = draw.textsize(text, font)