From eeb685b0e53c2bbb99a020037ede523d4db83b8b Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Fri, 2 Jun 2023 10:34:59 +0300 Subject: [PATCH 1/4] bump gradio version to fix tmp filenames for images --- requirements_versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_versions.txt b/requirements_versions.txt index de501fda..31b179a9 100644 --- a/requirements_versions.txt +++ b/requirements_versions.txt @@ -3,7 +3,7 @@ transformers==4.25.1 accelerate==0.18.0 basicsr==1.4.2 gfpgan==1.3.8 -gradio==3.31.0 +gradio==3.32.0 numpy==1.23.5 Pillow==9.5.0 realesrgan==0.3.0 From cbc38a903b1257362c8da0326749cba1c6ac7769 Mon Sep 17 00:00:00 2001 From: AUTOMATIC1111 <16777216c@gmail.com> Date: Thu, 1 Jun 2023 06:54:19 +0300 Subject: [PATCH 2/4] Merge pull request #10905 from AUTOMATIC1111/fix-10896-pnginfo-parameters fix 10896 pnginfo parameters --- modules/images.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/images.py b/modules/images.py index 3f60e944..40efc96c 100644 --- a/modules/images.py +++ b/modules/images.py @@ -488,10 +488,6 @@ def save_image_with_geninfo(image, geninfo, filename, extension=None, existing_p image_format = Image.registered_extensions()[extension] - existing_pnginfo = existing_pnginfo or {} - if opts.enable_pnginfo: - existing_pnginfo['parameters'] = geninfo - if extension.lower() == '.png': if opts.enable_pnginfo: pnginfo_data = PngImagePlugin.PngInfo() From eed7b2776ec7b8917824f470f506e732d8b7375d Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Fri, 2 Jun 2023 10:39:16 +0300 Subject: [PATCH 3/4] add changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3c57fe0..57f2dde7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.3.2 + +### Bug Fixes: + * fix files served out of tmp directory even if they are saved to disk + * fix postprocessing overwriting parameters + ## 1.3.1 ### Features: From 6f754ab98bcd4b61f5cc6d6a9bfc6be7722373a9 Mon Sep 17 00:00:00 2001 From: AUTOMATIC1111 <16777216c@gmail.com> Date: Wed, 31 May 2023 19:37:58 +0300 Subject: [PATCH 4/4] Merge pull request #10780 from akx/image-emb-fonts Mark caption_image_overlay's textfont as deprecated; fix #10778 --- modules/textual_inversion/image_embedding.py | 21 ++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/textual_inversion/image_embedding.py b/modules/textual_inversion/image_embedding.py index 5858a55f..81cff7bf 100644 --- a/modules/textual_inversion/image_embedding.py +++ b/modules/textual_inversion/image_embedding.py @@ -1,8 +1,10 @@ import base64 import json +import warnings + import numpy as np import zlib -from PIL import Image, ImageDraw, ImageFont +from PIL import Image, ImageDraw import torch @@ -129,14 +131,17 @@ def extract_image_data_embed(image): def caption_image_overlay(srcimage, title, footerLeft, footerMid, footerRight, textfont=None): + from modules.images import get_font + if textfont: + warnings.warn( + 'passing in a textfont to caption_image_overlay is deprecated and does nothing', + DeprecationWarning, + stacklevel=2, + ) from math import cos image = srcimage.copy() fontsize = 32 - if textfont is None: - from modules.images import get_font - textfont = get_font(fontsize) - factor = 1.5 gradient = Image.new('RGBA', (1, image.size[1]), color=(0, 0, 0, 0)) for y in range(image.size[1]): @@ -147,12 +152,12 @@ def caption_image_overlay(srcimage, title, footerLeft, footerMid, footerRight, t draw = ImageDraw.Draw(image) - font = ImageFont.truetype(textfont, fontsize) + font = get_font(fontsize) padding = 10 _, _, w, h = draw.textbbox((0, 0), title, font=font) fontsize = min(int(fontsize * (((image.size[0]*0.75)-(padding*4))/w)), 72) - font = ImageFont.truetype(textfont, fontsize) + font = get_font(fontsize) _, _, w, h = draw.textbbox((0, 0), title, font=font) draw.text((padding, padding), title, anchor='lt', font=font, fill=(255, 255, 255, 230)) @@ -163,7 +168,7 @@ def caption_image_overlay(srcimage, title, footerLeft, footerMid, footerRight, t _, _, w, h = draw.textbbox((0, 0), footerRight, font=font) fontsize_right = min(int(fontsize * (((image.size[0]/3)-(padding))/w)), 72) - font = ImageFont.truetype(textfont, min(fontsize_left, fontsize_mid, fontsize_right)) + font = get_font(min(fontsize_left, fontsize_mid, fontsize_right)) draw.text((padding, image.size[1]-padding), footerLeft, anchor='ls', font=font, fill=(255, 255, 255, 230)) draw.text((image.size[0]/2, image.size[1]-padding), footerMid, anchor='ms', font=font, fill=(255, 255, 255, 230))