Banjo Obayomi commited on
Commit
822b846
1 Parent(s): 06bbddc

update text pos

Browse files
Files changed (1) hide show
  1. mario_gpt/utils.py +2 -2
mario_gpt/utils.py CHANGED
@@ -32,9 +32,9 @@ def add_prompt_to_image(img: Image.Image, prompt: str) -> Image.Image:
32
  wrapped_text = "\n".join(wrap(prompt, width=max_width // font.getlength(" ")))
33
 
34
  # Calculate the position to draw the prompt text
35
- text_width, text_height = draw.textlength(prompt, font)
36
  x = 10 # Adjust the x-coordinate as desired
37
- y = text_height - 10 # Adjust the y-coordinate as desired
38
 
39
  # Draw the prompt text on the image
40
  draw.text((x, y), wrapped_text, font=font, fill=(255, 255, 255))
 
32
  wrapped_text = "\n".join(wrap(prompt, width=max_width // font.getlength(" ")))
33
 
34
  # Calculate the position to draw the prompt text
35
+ # text_height = draw.textlength(prompt, font)
36
  x = 10 # Adjust the x-coordinate as desired
37
+ y = 10 # Adjust the y-coordinate as desired
38
 
39
  # Draw the prompt text on the image
40
  draw.text((x, y), wrapped_text, font=font, fill=(255, 255, 255))