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
028b67b6
Commit
028b67b6
authored
Nov 18, 2022
by
Muhammad Rizqi Nur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use underscore naming for "private" functions in sd_vae
parent
9fdc343d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
sd_vae.py
modules/sd_vae.py
+3
-3
No files found.
modules/sd_vae.py
View file @
028b67b6
...
...
@@ -55,7 +55,7 @@ def restore_base_vae(model):
global
loaded_vae_file
if
base_vae
is
not
None
and
checkpoint_info
==
model
.
sd_checkpoint_info
:
print
(
"Restoring base VAE"
)
load_vae_dict
(
model
,
base_vae
)
_
load_vae_dict
(
model
,
base_vae
)
loaded_vae_file
=
None
delete_base_vae
()
...
...
@@ -147,7 +147,7 @@ def load_vae(model, vae_file=None):
store_base_vae
(
model
)
vae_ckpt
=
torch
.
load
(
vae_file
,
map_location
=
shared
.
weight_load_location
)
vae_dict_1
=
{
k
:
v
for
k
,
v
in
vae_ckpt
[
"state_dict"
]
.
items
()
if
k
[
0
:
4
]
!=
"loss"
and
k
not
in
vae_ignore_keys
}
load_vae_dict
(
model
,
vae_dict_1
)
_
load_vae_dict
(
model
,
vae_dict_1
)
# If vae used is not in dict, update it
# It will be removed on refresh though
...
...
@@ -164,7 +164,7 @@ def load_vae(model, vae_file=None):
# don't call this from outside
def
load_vae_dict
(
model
,
vae_dict_1
):
def
_
load_vae_dict
(
model
,
vae_dict_1
):
model
.
first_stage_model
.
load_state_dict
(
vae_dict_1
)
model
.
first_stage_model
.
to
(
devices
.
dtype_vae
)
...
...
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