Skip to content

Commit baf6946

Browse files
committed
Merge branch 'release_candidate'
2 parents b6af0a3 + 6f754ab commit baf6946

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.3.2
2+
3+
### Bug Fixes:
4+
* fix files served out of tmp directory even if they are saved to disk
5+
* fix postprocessing overwriting parameters
6+
17
## 1.3.1
28

39
### Features:

modules/images.py

-4
Original file line numberDiff line numberDiff line change
@@ -488,10 +488,6 @@ def save_image_with_geninfo(image, geninfo, filename, extension=None, existing_p
488488

489489
image_format = Image.registered_extensions()[extension]
490490

491-
existing_pnginfo = existing_pnginfo or {}
492-
if opts.enable_pnginfo:
493-
existing_pnginfo['parameters'] = geninfo
494-
495491
if extension.lower() == '.png':
496492
if opts.enable_pnginfo:
497493
pnginfo_data = PngImagePlugin.PngInfo()

modules/textual_inversion/image_embedding.py

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import base64
22
import json
3+
import warnings
4+
35
import numpy as np
46
import zlib
5-
from PIL import Image, ImageDraw, ImageFont
7+
from PIL import Image, ImageDraw
68
import torch
79

810

@@ -129,14 +131,17 @@ def extract_image_data_embed(image):
129131

130132

131133
def caption_image_overlay(srcimage, title, footerLeft, footerMid, footerRight, textfont=None):
134+
from modules.images import get_font
135+
if textfont:
136+
warnings.warn(
137+
'passing in a textfont to caption_image_overlay is deprecated and does nothing',
138+
DeprecationWarning,
139+
stacklevel=2,
140+
)
132141
from math import cos
133142

134143
image = srcimage.copy()
135144
fontsize = 32
136-
if textfont is None:
137-
from modules.images import get_font
138-
textfont = get_font(fontsize)
139-
140145
factor = 1.5
141146
gradient = Image.new('RGBA', (1, image.size[1]), color=(0, 0, 0, 0))
142147
for y in range(image.size[1]):
@@ -147,12 +152,12 @@ def caption_image_overlay(srcimage, title, footerLeft, footerMid, footerRight, t
147152

148153
draw = ImageDraw.Draw(image)
149154

150-
font = ImageFont.truetype(textfont, fontsize)
155+
font = get_font(fontsize)
151156
padding = 10
152157

153158
_, _, w, h = draw.textbbox((0, 0), title, font=font)
154159
fontsize = min(int(fontsize * (((image.size[0]*0.75)-(padding*4))/w)), 72)
155-
font = ImageFont.truetype(textfont, fontsize)
160+
font = get_font(fontsize)
156161
_, _, w, h = draw.textbbox((0, 0), title, font=font)
157162
draw.text((padding, padding), title, anchor='lt', font=font, fill=(255, 255, 255, 230))
158163

@@ -163,7 +168,7 @@ def caption_image_overlay(srcimage, title, footerLeft, footerMid, footerRight, t
163168
_, _, w, h = draw.textbbox((0, 0), footerRight, font=font)
164169
fontsize_right = min(int(fontsize * (((image.size[0]/3)-(padding))/w)), 72)
165170

166-
font = ImageFont.truetype(textfont, min(fontsize_left, fontsize_mid, fontsize_right))
171+
font = get_font(min(fontsize_left, fontsize_mid, fontsize_right))
167172

168173
draw.text((padding, image.size[1]-padding), footerLeft, anchor='ls', font=font, fill=(255, 255, 255, 230))
169174
draw.text((image.size[0]/2, image.size[1]-padding), footerMid, anchor='ms', font=font, fill=(255, 255, 255, 230))

requirements_versions.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ transformers==4.25.1
33
accelerate==0.18.0
44
basicsr==1.4.2
55
gfpgan==1.3.8
6-
gradio==3.31.0
6+
gradio==3.32.0
77
numpy==1.23.5
88
Pillow==9.5.0
99
realesrgan==0.3.0

0 commit comments

Comments
 (0)