Skip to content

Commit

Permalink
Merge branch 'release_candidate'
Browse files Browse the repository at this point in the history
  • Loading branch information
AUTOMATIC1111 committed Jun 5, 2023
2 parents b6af0a3 + 6f754ab commit baf6946
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.3.2

### Bug Fixes:
* fix files served out of tmp directory even if they are saved to disk

This comment has been minimized.

This comment has been minimized.

Copy link
@w-e-w

w-e-w Jun 6, 2023

Collaborator

I will bring this to Auto's attention
I suggest you join AUTO's Discord it's easier to communicate
link to server on wiki/Contributing

This comment was marked as off-topic.

Copy link
@BigDataXXL
* fix postprocessing overwriting parameters

## 1.3.1

### Features:
Expand Down
4 changes: 0 additions & 4 deletions modules/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
21 changes: 13 additions & 8 deletions modules/textual_inversion/image_embedding.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -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]):
Expand All @@ -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))

Expand All @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion requirements_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

4 comments on commit baf6946

@turoxixi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you solve a small bug? Thank you. In the script : Prompts from file or textbox , the program crashes and does not work after using "-- sd-Model"

@turoxixi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your work

@w-e-w
Copy link
Collaborator

@w-e-w w-e-w commented on baf6946 Jun 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@turoxixi don't post it here
open an issues providing details on how to recreate the issue asuch as what did you do what are personal are you on what do you expect to happen what's your setup

@jinglu678
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AUTOMATIC1111 Thank you very much for your work, it has been very helpful to us! We are not only using NV GPUs, but also using some new AI chips. We are currently making the new AI chips support sd-webui. Can we also submit our work to this project? Look forward to your reply, thank you very much!

Please sign in to comment.