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
43278216
Commit
43278216
authored
Oct 08, 2022
by
Aidan Holland
Committed by
AUTOMATIC1111
Oct 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: Fix typos
parent
610a7f4e
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
17 additions
and
17 deletions
+17
-17
README.md
README.md
+1
-1
imageviewer.js
javascript/imageviewer.js
+1
-1
interrogate.py
modules/interrogate.py
+2
-2
processing.py
modules/processing.py
+1
-1
scunet_model_arch.py
modules/scunet_model_arch.py
+2
-2
sd_models.py
modules/sd_models.py
+2
-2
sd_samplers.py
modules/sd_samplers.py
+2
-2
shared.py
modules/shared.py
+3
-3
swinir_model_arch.py
modules/swinir_model_arch.py
+1
-1
ui.py
modules/ui.py
+2
-2
No files found.
README.md
View file @
43278216
...
...
@@ -34,7 +34,7 @@ Check the [custom scripts](https://github.com/AUTOMATIC1111/stable-diffusion-web
-
Sampling method selection
-
Interrupt processing at any time
-
4GB video card support (also reports of 2GB working)
-
Correct seeds for batches
-
Correct seeds for batches
-
Prompt length validation
-
get length of prompt in tokens as you type
-
get a warning after generation if some text was truncated
...
...
javascript/imageviewer.js
View file @
43278216
...
...
@@ -95,7 +95,7 @@ function showGalleryImage(){
e
.
addEventListener
(
'click'
,
function
(
evt
)
{
if
(
!
opts
.
js_modal_lightbox
)
return
;
modalZoomSet
(
gradioApp
().
getElementById
(
'modalImage'
),
opts
.
js_modal_lightbox_initialy_zoomed
)
modalZoomSet
(
gradioApp
().
getElementById
(
'modalImage'
),
opts
.
js_modal_lightbox_initial
l
y_zoomed
)
showModal
(
evt
)
},
true
);
}
...
...
modules/interrogate.py
View file @
43278216
...
...
@@ -140,11 +140,11 @@ class InterrogateModels:
res
=
caption
c
il
p_image
=
self
.
clip_preprocess
(
pil_image
)
.
unsqueeze
(
0
)
.
type
(
self
.
dtype
)
.
to
(
shared
.
device
)
c
li
p_image
=
self
.
clip_preprocess
(
pil_image
)
.
unsqueeze
(
0
)
.
type
(
self
.
dtype
)
.
to
(
shared
.
device
)
precision_scope
=
torch
.
autocast
if
shared
.
cmd_opts
.
precision
==
"autocast"
else
contextlib
.
nullcontext
with
torch
.
no_grad
(),
precision_scope
(
"cuda"
):
image_features
=
self
.
clip_model
.
encode_image
(
c
il
p_image
)
.
type
(
self
.
dtype
)
image_features
=
self
.
clip_model
.
encode_image
(
c
li
p_image
)
.
type
(
self
.
dtype
)
image_features
/=
image_features
.
norm
(
dim
=-
1
,
keepdim
=
True
)
...
...
modules/processing.py
View file @
43278216
...
...
@@ -386,7 +386,7 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
if
state
.
interrupted
or
state
.
skipped
:
# if we are interruped, sample returns just noise
# if we are interrup
t
ed, sample returns just noise
# use the image collected previously in sampler loop
samples_ddim
=
shared
.
state
.
current_latent
...
...
modules/scunet_model_arch.py
View file @
43278216
...
...
@@ -40,7 +40,7 @@ class WMSA(nn.Module):
Returns:
attn_mask: should be (1 1 w p p),
"""
# supporting sq
au
re.
# supporting sq
ua
re.
attn_mask
=
torch
.
zeros
(
h
,
w
,
p
,
p
,
p
,
p
,
dtype
=
torch
.
bool
,
device
=
self
.
relative_position_params
.
device
)
if
self
.
type
==
'W'
:
return
attn_mask
...
...
@@ -65,7 +65,7 @@ class WMSA(nn.Module):
x
=
rearrange
(
x
,
'b (w1 p1) (w2 p2) c -> b w1 w2 p1 p2 c'
,
p1
=
self
.
window_size
,
p2
=
self
.
window_size
)
h_windows
=
x
.
size
(
1
)
w_windows
=
x
.
size
(
2
)
# sq
au
re validation
# sq
ua
re validation
# assert h_windows == w_windows
x
=
rearrange
(
x
,
'b w1 w2 p1 p2 c -> b (w1 w2) (p1 p2) c'
,
p1
=
self
.
window_size
,
p2
=
self
.
window_size
)
...
...
modules/sd_models.py
View file @
43278216
...
...
@@ -147,7 +147,7 @@ def load_model_weights(model, checkpoint_file, sd_model_hash):
model
.
first_stage_model
.
load_state_dict
(
vae_dict
)
model
.
sd_model_hash
=
sd_model_hash
model
.
sd_model_checkpint
=
checkpoint_file
model
.
sd_model_checkp
o
int
=
checkpoint_file
def
load_model
():
...
...
@@ -175,7 +175,7 @@ def reload_model_weights(sd_model, info=None):
from
modules
import
lowvram
,
devices
,
sd_hijack
checkpoint_info
=
info
or
select_checkpoint
()
if
sd_model
.
sd_model_checkpint
==
checkpoint_info
.
filename
:
if
sd_model
.
sd_model_checkp
o
int
==
checkpoint_info
.
filename
:
return
if
shared
.
cmd_opts
.
lowvram
or
shared
.
cmd_opts
.
medvram
:
...
...
modules/sd_samplers.py
View file @
43278216
...
...
@@ -181,7 +181,7 @@ class VanillaStableDiffusionSampler:
self
.
initialize
(
p
)
# existing code fails with cetain step counts, like 9
# existing code fails with ce
r
tain step counts, like 9
try
:
self
.
sampler
.
make_schedule
(
ddim_num_steps
=
steps
,
ddim_eta
=
self
.
eta
,
ddim_discretize
=
p
.
ddim_discretize
,
verbose
=
False
)
except
Exception
:
...
...
@@ -204,7 +204,7 @@ class VanillaStableDiffusionSampler:
steps
=
steps
or
p
.
steps
# existing code fails with ce
t
in step counts, like 9
# existing code fails with ce
rta
in step counts, like 9
try
:
samples_ddim
,
_
=
self
.
sampler
.
sample
(
S
=
steps
,
conditioning
=
conditioning
,
batch_size
=
int
(
x
.
shape
[
0
]),
shape
=
x
[
0
]
.
shape
,
verbose
=
False
,
unconditional_guidance_scale
=
p
.
cfg_scale
,
unconditional_conditioning
=
unconditional_conditioning
,
x_T
=
x
,
eta
=
self
.
eta
)
except
Exception
:
...
...
modules/shared.py
View file @
43278216
...
...
@@ -141,9 +141,9 @@ class OptionInfo:
self
.
section
=
None
def
options_section
(
section_identifer
,
options_dict
):
def
options_section
(
section_identif
i
er
,
options_dict
):
for
k
,
v
in
options_dict
.
items
():
v
.
section
=
section_identifer
v
.
section
=
section_identif
i
er
return
options_dict
...
...
@@ -246,7 +246,7 @@ options_templates.update(options_section(('ui', "User interface"), {
"add_model_hash_to_info"
:
OptionInfo
(
True
,
"Add model hash to generation information"
),
"font"
:
OptionInfo
(
""
,
"Font for image grids that have text"
),
"js_modal_lightbox"
:
OptionInfo
(
True
,
"Enable full page image viewer"
),
"js_modal_lightbox_initialy_zoomed"
:
OptionInfo
(
True
,
"Show images zoomed in by default in full page image viewer"
),
"js_modal_lightbox_initial
l
y_zoomed"
:
OptionInfo
(
True
,
"Show images zoomed in by default in full page image viewer"
),
"show_progress_in_title"
:
OptionInfo
(
True
,
"Show generation progress in window title."
),
}))
...
...
modules/swinir_model_arch.py
View file @
43278216
...
...
@@ -166,7 +166,7 @@ class SwinTransformerBlock(nn.Module):
Args:
dim (int): Number of input channels.
input_resolution (tuple[int]): Input res
ulo
tion.
input_resolution (tuple[int]): Input res
olu
tion.
num_heads (int): Number of attention heads.
window_size (int): Window size.
shift_size (int): Shift size for SW-MSA.
...
...
modules/ui.py
View file @
43278216
...
...
@@ -38,7 +38,7 @@ from modules import prompt_parser
from
modules.images
import
save_image
import
modules.textual_inversion.ui
# this is a fix for Windows users. Without it, javascript files will be served with text/html content-type and the bowser will not show any UI
# this is a fix for Windows users. Without it, javascript files will be served with text/html content-type and the b
r
owser will not show any UI
mimetypes
.
init
()
mimetypes
.
add_type
(
'application/javascript'
,
'.js'
)
...
...
@@ -102,7 +102,7 @@ def save_files(js_data, images, index):
import
csv
filenames
=
[]
#quick dictionary to class object conversion. Its nec
ce
sary due apply_filename_pattern requiring it
#quick dictionary to class object conversion. Its nec
es
sary due apply_filename_pattern requiring it
class
MyObject
:
def
__init__
(
self
,
d
=
None
):
if
d
is
not
None
:
...
...
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