Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
79cca257
Commit
79cca257
authored
Sep 09, 2022
by
orionaskatu
Committed by
AUTOMATIC1111
Sep 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Embed roboto
parent
86867e15
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
12 deletions
+8
-12
images.py
modules/images.py
+5
-1
shared.py
modules/shared.py
+1
-11
requirements_versions.txt
requirements_versions.txt
+2
-0
No files found.
modules/images.py
View file @
79cca257
...
@@ -5,6 +5,7 @@ import re
...
@@ -5,6 +5,7 @@ import re
import
numpy
as
np
import
numpy
as
np
from
PIL
import
Image
,
ImageFont
,
ImageDraw
,
PngImagePlugin
from
PIL
import
Image
,
ImageFont
,
ImageDraw
,
PngImagePlugin
from
fonts.ttf
import
Roboto
import
modules.shared
import
modules.shared
from
modules.shared
import
opts
from
modules.shared
import
opts
...
@@ -132,7 +133,10 @@ def draw_grid_annotations(im, width, height, hor_texts, ver_texts):
...
@@ -132,7 +133,10 @@ def draw_grid_annotations(im, width, height, hor_texts, ver_texts):
fontsize
=
(
width
+
height
)
//
25
fontsize
=
(
width
+
height
)
//
25
line_spacing
=
fontsize
//
2
line_spacing
=
fontsize
//
2
fnt
=
ImageFont
.
truetype
(
opts
.
font
,
fontsize
)
if
not
opts
.
font
:
fnt
=
ImageFont
.
truetype
(
Roboto
,
fontsize
)
else
:
fnt
=
ImageFont
.
truetype
(
opts
.
font
,
fontsize
)
color_active
=
(
0
,
0
,
0
)
color_active
=
(
0
,
0
,
0
)
color_inactive
=
(
153
,
153
,
153
)
color_inactive
=
(
153
,
153
,
153
)
...
...
modules/shared.py
View file @
79cca257
...
@@ -80,16 +80,6 @@ prompt_styles = modules.styles.load_styles(styles_filename)
...
@@ -80,16 +80,6 @@ prompt_styles = modules.styles.load_styles(styles_filename)
face_restorers
=
[]
face_restorers
=
[]
def
find_any_font
():
fonts
=
[
'/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf'
]
for
font
in
fonts
:
if
os
.
path
.
exists
(
font
):
return
font
return
"Arial.TTF"
class
Options
:
class
Options
:
class
OptionInfo
:
class
OptionInfo
:
def
__init__
(
self
,
default
=
None
,
label
=
""
,
component
=
None
,
component_args
=
None
):
def
__init__
(
self
,
default
=
None
,
label
=
""
,
component
=
None
,
component_args
=
None
):
...
@@ -121,7 +111,7 @@ class Options:
...
@@ -121,7 +111,7 @@ class Options:
"jpeg_quality"
:
OptionInfo
(
80
,
"Quality for saved jpeg images"
,
gr
.
Slider
,
{
"minimum"
:
1
,
"maximum"
:
100
,
"step"
:
1
}),
"jpeg_quality"
:
OptionInfo
(
80
,
"Quality for saved jpeg images"
,
gr
.
Slider
,
{
"minimum"
:
1
,
"maximum"
:
100
,
"step"
:
1
}),
"export_for_4chan"
:
OptionInfo
(
True
,
"If PNG image is larger than 4MB or any dimension is larger than 4000, downscale and save copy as JPG"
),
"export_for_4chan"
:
OptionInfo
(
True
,
"If PNG image is larger than 4MB or any dimension is larger than 4000, downscale and save copy as JPG"
),
"enable_pnginfo"
:
OptionInfo
(
True
,
"Save text information about generation parameters as chunks to png files"
),
"enable_pnginfo"
:
OptionInfo
(
True
,
"Save text information about generation parameters as chunks to png files"
),
"font"
:
OptionInfo
(
find_any_font
(),
"Font for image grids
that have text"
),
"font"
:
OptionInfo
(
""
,
"Font for image grids
that have text"
),
"enable_emphasis"
:
OptionInfo
(
True
,
"Use (text) to make model pay more attention to text text and [text] to make it pay less attention"
),
"enable_emphasis"
:
OptionInfo
(
True
,
"Use (text) to make model pay more attention to text text and [text] to make it pay less attention"
),
"save_txt"
:
OptionInfo
(
False
,
"Create a text file next to every image with generation parameters."
),
"save_txt"
:
OptionInfo
(
False
,
"Create a text file next to every image with generation parameters."
),
"ESRGAN_tile"
:
OptionInfo
(
192
,
"Tile size for upscaling. 0 = no tiling."
,
gr
.
Slider
,
{
"minimum"
:
0
,
"maximum"
:
512
,
"step"
:
16
}),
"ESRGAN_tile"
:
OptionInfo
(
192
,
"Tile size for upscaling. 0 = no tiling."
,
gr
.
Slider
,
{
"minimum"
:
0
,
"maximum"
:
512
,
"step"
:
16
}),
...
...
requirements_versions.txt
View file @
79cca257
...
@@ -9,3 +9,5 @@ transformers==4.19.2
...
@@ -9,3 +9,5 @@ transformers==4.19.2
omegaconf==2.1.1
omegaconf==2.1.1
pytorch_lightning==1.7.2
pytorch_lightning==1.7.2
scikit-image==0.19.2
scikit-image==0.19.2
fonts
font-roboto
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment