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
44c50973
Commit
44c50973
authored
Nov 05, 2023
by
Ritesh Gangnani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use devices.torch_gc() instead of empty_cache()
parent
44db35fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
5 deletions
+1
-5
modules/sd_hijack.py
modules/sd_hijack.py
+1
-4
modules/sd_models.py
modules/sd_models.py
+0
-1
No files found.
modules/sd_hijack.py
View file @
44c50973
import
gc
import
torch
from
torch.nn.functional
import
silu
from
types
import
MethodType
...
...
@@ -193,8 +191,7 @@ class StableDiffusionModelHijack:
delattr
(
m
.
model
.
diffusion_model
.
output_blocks
[
1
][
1
]
.
transformer_blocks
,
i
)
delattr
(
m
.
model
.
diffusion_model
.
output_blocks
[
4
][
1
]
.
transformer_blocks
,
'1'
)
delattr
(
m
.
model
.
diffusion_model
.
output_blocks
[
5
][
1
]
.
transformer_blocks
,
'1'
)
torch
.
cuda
.
empty_cache
()
gc
.
collect
()
devices
.
torch_gc
()
def
hijack
(
self
,
m
):
conditioner
=
getattr
(
m
,
'conditioner'
,
None
)
...
...
modules/sd_models.py
View file @
44c50973
...
...
@@ -347,7 +347,6 @@ def load_model_weights(model, checkpoint_info: CheckpointInfo, state_dict, timer
model
.
is_sd2
=
not
model
.
is_sdxl
and
hasattr
(
model
.
cond_stage_model
,
'model'
)
model
.
is_sd1
=
not
model
.
is_sdxl
and
not
model
.
is_sd2
model
.
is_ssd
=
model
.
is_sdxl
and
'model.diffusion_model.middle_block.1.transformer_blocks.0.attn1.to_q.weight'
not
in
state_dict
.
keys
()
if
model
.
is_sdxl
:
sd_models_xl
.
extend_sdxl
(
model
)
...
...
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