diff --git a/makeframeutils.py b/makeframeutils.py index 58e8db7..c354124 100644 --- a/makeframeutils.py +++ b/makeframeutils.py @@ -101,11 +101,10 @@ def ImgLabeler(img, text, size=72, color=(255,255,255)): draw = ImageDraw.Draw(img) # Get text size - text_size = draw.textsize(text, font=font) - + text_size = draw.textlength(text, font=font) # Calculate x, y coordinates of the text - x = (img.width - text_size[0]) / 2 - y = (img.height - text_size[1]) / 2 + x = (img.width - text_size) / 2 + y = (img.height - text_size) / 2 # Position for the text, centered text_position = (x, y) diff --git a/nodes/MakeFrame.py b/nodes/MakeFrame.py index 61d7e5c..f92bb40 100644 --- a/nodes/MakeFrame.py +++ b/nodes/MakeFrame.py @@ -6,7 +6,6 @@ import random from PIL import Image from .. import makeframeutils as mfu - device = torch.device("cuda" if torch.cuda.is_available() else "cpu") class BreakFrames: