Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
2162be51
Commit
2162be51
authored
Sep 30, 2022
by
d8ahazard
Committed by
GitHub
Sep 30, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into master
parents
9fc1e49b
3a876b16
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
11 deletions
+18
-11
embeddings/Place Textual Inversion embeddings here.txt
embeddings/Place Textual Inversion embeddings here.txt
+0
-0
modules/bsrgan_model.py
modules/bsrgan_model.py
+1
-1
modules/images.py
modules/images.py
+10
-8
modules/sd_hijack.py
modules/sd_hijack.py
+6
-1
modules/ui.py
modules/ui.py
+1
-1
No files found.
embeddings/Place Textual Inversion embeddings here.txt
0 → 100644
View file @
2162be51
modules/bsrgan_model.py
View file @
2162be51
...
...
@@ -67,7 +67,7 @@ class UpscalerBSRGAN(modules.upscaler.Upscaler):
else
:
filename
=
path
if
not
os
.
path
.
exists
(
filename
)
or
filename
is
None
:
print
(
"Unable to load
%
s from
%
s"
%
(
self
.
model_path
,
filename
)
)
print
(
f
"BSRGAN: Unable to load model from {filename}"
,
file
=
sys
.
stderr
)
return
None
model
=
RRDBNet
(
in_nc
=
3
,
out_nc
=
3
,
nf
=
64
,
nb
=
23
,
gc
=
32
,
sf
=
2
)
# define network
model
.
load_state_dict
(
torch
.
load
(
filename
),
strict
=
True
)
...
...
modules/images.py
View file @
2162be51
...
...
@@ -213,17 +213,19 @@ def resize_image(resize_mode, im, width, height):
if
opts
.
upscaler_for_img2img
is
None
or
opts
.
upscaler_for_img2img
==
"None"
or
im
.
mode
==
'L'
:
return
im
.
resize
((
w
,
h
),
resample
=
LANCZOS
)
upscalers
=
[
x
for
x
in
shared
.
sd_upscalers
if
x
.
name
==
opts
.
upscaler_for_img2img
]
assert
len
(
upscalers
)
>
0
,
f
"could not find upscaler named {opts.upscaler_for_img2img}"
upscaler
=
upscalers
[
0
]
scale
=
max
(
w
/
im
.
width
,
h
/
im
.
height
)
upscaled
=
upscaler
.
scaler
.
upscale
(
im
,
scale
,
upscaler
.
data_path
)
if
upscaled
.
width
!=
w
or
upscaled
.
height
!=
h
:
upscaled
=
im
.
resize
((
w
,
h
),
resample
=
LANCZOS
)
if
scale
>
1.0
:
upscalers
=
[
x
for
x
in
shared
.
sd_upscalers
if
x
.
name
==
opts
.
upscaler_for_img2img
]
assert
len
(
upscalers
)
>
0
,
f
"could not find upscaler named {opts.upscaler_for_img2img}"
upscaler
=
upscalers
[
0
]
im
=
upscaler
.
scaler
.
upscale
(
im
,
scale
,
upscaler
.
data_path
)
if
im
.
width
!=
w
or
im
.
height
!=
h
:
im
=
im
.
resize
((
w
,
h
),
resample
=
LANCZOS
)
return
upscaled
return
im
if
resize_mode
==
0
:
res
=
resize
(
im
,
width
,
height
)
...
...
modules/sd_hijack.py
View file @
2162be51
...
...
@@ -232,7 +232,12 @@ class StableDiffusionModelHijack:
for
fn
in
os
.
listdir
(
dirname
):
try
:
process_file
(
os
.
path
.
join
(
dirname
,
fn
),
fn
)
fullfn
=
os
.
path
.
join
(
dirname
,
fn
)
if
os
.
stat
(
fullfn
)
.
st_size
==
0
:
continue
process_file
(
fullfn
,
fn
)
except
Exception
:
print
(
f
"Error loading emedding {fn}:"
,
file
=
sys
.
stderr
)
print
(
traceback
.
format_exc
(),
file
=
sys
.
stderr
)
...
...
modules/ui.py
View file @
2162be51
...
...
@@ -599,7 +599,7 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo, run_modelmerger):
mask_mode
=
gr
.
Radio
(
label
=
"Mask mode"
,
show_label
=
False
,
choices
=
[
"Draw mask"
,
"Upload mask"
],
type
=
"index"
,
value
=
"Draw mask"
,
elem_id
=
"mask_mode"
)
inpainting_mask_invert
=
gr
.
Radio
(
label
=
'Masking mode'
,
show_label
=
False
,
choices
=
[
'Inpaint masked'
,
'Inpaint not masked'
],
value
=
'Inpaint masked'
,
type
=
"index"
)
inpainting_fill
=
gr
.
Radio
(
label
=
'Masked content'
,
choices
=
[
'fill'
,
'original'
,
'latent noise'
,
'latent nothing'
],
value
=
'
fil
l'
,
type
=
"index"
)
inpainting_fill
=
gr
.
Radio
(
label
=
'Masked content'
,
choices
=
[
'fill'
,
'original'
,
'latent noise'
,
'latent nothing'
],
value
=
'
origina
l'
,
type
=
"index"
)
with
gr
.
Row
():
inpaint_full_res
=
gr
.
Checkbox
(
label
=
'Inpaint at full resolution'
,
value
=
False
)
...
...
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