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
da468a58
Commit
da468a58
authored
Jul 03, 2023
by
Aarni Koskela
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typo: checkpoint_alisases
parent
da8916f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
modules/api/api.py
modules/api/api.py
+2
-2
modules/processing.py
modules/processing.py
+1
-1
modules/sd_models.py
modules/sd_models.py
+6
-5
No files found.
modules/api/api.py
View file @
da468a58
...
@@ -22,7 +22,7 @@ from modules.textual_inversion.textual_inversion import create_embedding, train_
...
@@ -22,7 +22,7 @@ from modules.textual_inversion.textual_inversion import create_embedding, train_
from
modules.textual_inversion.preprocess
import
preprocess
from
modules.textual_inversion.preprocess
import
preprocess
from
modules.hypernetworks.hypernetwork
import
create_hypernetwork
,
train_hypernetwork
from
modules.hypernetworks.hypernetwork
import
create_hypernetwork
,
train_hypernetwork
from
PIL
import
PngImagePlugin
,
Image
from
PIL
import
PngImagePlugin
,
Image
from
modules.sd_models
import
checkpoints_list
,
unload_model_weights
,
reload_model_weights
,
checkpoint_ali
s
ases
from
modules.sd_models
import
checkpoints_list
,
unload_model_weights
,
reload_model_weights
,
checkpoint_aliases
from
modules.sd_vae
import
vae_dict
from
modules.sd_vae
import
vae_dict
from
modules.sd_models_config
import
find_checkpoint_config_near_filename
from
modules.sd_models_config
import
find_checkpoint_config_near_filename
from
modules.realesrgan_model
import
get_realesrgan_models
from
modules.realesrgan_model
import
get_realesrgan_models
...
@@ -519,7 +519,7 @@ class Api:
...
@@ -519,7 +519,7 @@ class Api:
def
set_config
(
self
,
req
:
Dict
[
str
,
Any
]):
def
set_config
(
self
,
req
:
Dict
[
str
,
Any
]):
checkpoint_name
=
req
.
get
(
"sd_model_checkpoint"
,
None
)
checkpoint_name
=
req
.
get
(
"sd_model_checkpoint"
,
None
)
if
checkpoint_name
is
not
None
and
checkpoint_name
not
in
checkpoint_ali
s
ases
:
if
checkpoint_name
is
not
None
and
checkpoint_name
not
in
checkpoint_aliases
:
raise
RuntimeError
(
f
"model {checkpoint_name!r} not found"
)
raise
RuntimeError
(
f
"model {checkpoint_name!r} not found"
)
for
k
,
v
in
req
.
items
():
for
k
,
v
in
req
.
items
():
...
...
modules/processing.py
View file @
da468a58
...
@@ -606,7 +606,7 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
...
@@ -606,7 +606,7 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
try
:
try
:
# if no checkpoint override or the override checkpoint can't be found, remove override entry and load opts checkpoint
# if no checkpoint override or the override checkpoint can't be found, remove override entry and load opts checkpoint
if
sd_models
.
checkpoint_ali
s
ases
.
get
(
p
.
override_settings
.
get
(
'sd_model_checkpoint'
))
is
None
:
if
sd_models
.
checkpoint_aliases
.
get
(
p
.
override_settings
.
get
(
'sd_model_checkpoint'
))
is
None
:
p
.
override_settings
.
pop
(
'sd_model_checkpoint'
,
None
)
p
.
override_settings
.
pop
(
'sd_model_checkpoint'
,
None
)
sd_models
.
reload_model_weights
()
sd_models
.
reload_model_weights
()
...
...
modules/sd_models.py
View file @
da468a58
...
@@ -23,7 +23,8 @@ model_dir = "Stable-diffusion"
...
@@ -23,7 +23,8 @@ model_dir = "Stable-diffusion"
model_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
paths
.
models_path
,
model_dir
))
model_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
paths
.
models_path
,
model_dir
))
checkpoints_list
=
{}
checkpoints_list
=
{}
checkpoint_alisases
=
{}
checkpoint_aliases
=
{}
checkpoint_alisases
=
checkpoint_aliases
# for compatibility with old name
checkpoints_loaded
=
collections
.
OrderedDict
()
checkpoints_loaded
=
collections
.
OrderedDict
()
...
@@ -66,7 +67,7 @@ class CheckpointInfo:
...
@@ -66,7 +67,7 @@ class CheckpointInfo:
def
register
(
self
):
def
register
(
self
):
checkpoints_list
[
self
.
title
]
=
self
checkpoints_list
[
self
.
title
]
=
self
for
id
in
self
.
ids
:
for
id
in
self
.
ids
:
checkpoint_ali
s
ases
[
id
]
=
self
checkpoint_aliases
[
id
]
=
self
def
calculate_shorthash
(
self
):
def
calculate_shorthash
(
self
):
self
.
sha256
=
hashes
.
sha256
(
self
.
filename
,
f
"checkpoint/{self.name}"
)
self
.
sha256
=
hashes
.
sha256
(
self
.
filename
,
f
"checkpoint/{self.name}"
)
...
@@ -112,7 +113,7 @@ def checkpoint_tiles():
...
@@ -112,7 +113,7 @@ def checkpoint_tiles():
def
list_models
():
def
list_models
():
checkpoints_list
.
clear
()
checkpoints_list
.
clear
()
checkpoint_ali
s
ases
.
clear
()
checkpoint_aliases
.
clear
()
cmd_ckpt
=
shared
.
cmd_opts
.
ckpt
cmd_ckpt
=
shared
.
cmd_opts
.
ckpt
if
shared
.
cmd_opts
.
no_download_sd_model
or
cmd_ckpt
!=
shared
.
sd_model_file
or
os
.
path
.
exists
(
cmd_ckpt
):
if
shared
.
cmd_opts
.
no_download_sd_model
or
cmd_ckpt
!=
shared
.
sd_model_file
or
os
.
path
.
exists
(
cmd_ckpt
):
...
@@ -136,7 +137,7 @@ def list_models():
...
@@ -136,7 +137,7 @@ def list_models():
def
get_closet_checkpoint_match
(
search_string
):
def
get_closet_checkpoint_match
(
search_string
):
checkpoint_info
=
checkpoint_ali
s
ases
.
get
(
search_string
,
None
)
checkpoint_info
=
checkpoint_aliases
.
get
(
search_string
,
None
)
if
checkpoint_info
is
not
None
:
if
checkpoint_info
is
not
None
:
return
checkpoint_info
return
checkpoint_info
...
@@ -166,7 +167,7 @@ def select_checkpoint():
...
@@ -166,7 +167,7 @@ def select_checkpoint():
"""Raises `FileNotFoundError` if no checkpoints are found."""
"""Raises `FileNotFoundError` if no checkpoints are found."""
model_checkpoint
=
shared
.
opts
.
sd_model_checkpoint
model_checkpoint
=
shared
.
opts
.
sd_model_checkpoint
checkpoint_info
=
checkpoint_ali
s
ases
.
get
(
model_checkpoint
,
None
)
checkpoint_info
=
checkpoint_aliases
.
get
(
model_checkpoint
,
None
)
if
checkpoint_info
is
not
None
:
if
checkpoint_info
is
not
None
:
return
checkpoint_info
return
checkpoint_info
...
...
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