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
42ca30d6
Commit
42ca30d6
authored
Jun 27, 2024
by
AUTOMATIC1111
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix mdevram for SD1/SDXL
parent
d686e73d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
modules/lowvram.py
modules/lowvram.py
+3
-3
No files found.
modules/lowvram.py
View file @
42ca30d6
...
...
@@ -107,7 +107,7 @@ def setup_for_low_vram(sd_model, use_medvram):
setattr
(
obj
,
field
,
module
)
# register hooks for those the first three models
if
hasattr
(
sd_model
.
cond_stage_model
,
"medvram_modules"
):
if
hasattr
(
sd_model
,
"cond_stage_model"
)
and
hasattr
(
sd_model
.
cond_stage_model
,
"medvram_modules"
):
for
module
in
sd_model
.
cond_stage_model
.
medvram_modules
():
if
isinstance
(
module
,
ModuleWithParent
):
parent
=
module
.
parent
...
...
@@ -135,9 +135,9 @@ def setup_for_low_vram(sd_model, use_medvram):
sd_model
.
first_stage_model
.
register_forward_pre_hook
(
send_me_to_gpu
)
sd_model
.
first_stage_model
.
encode
=
first_stage_model_encode_wrap
sd_model
.
first_stage_model
.
decode
=
first_stage_model_decode_wrap
if
hasattr
(
sd_model
,
'depth_model'
)
:
if
getattr
(
sd_model
,
'depth_model'
,
None
)
is
not
None
:
sd_model
.
depth_model
.
register_forward_pre_hook
(
send_me_to_gpu
)
if
hasattr
(
sd_model
,
'embedder'
)
:
if
getattr
(
sd_model
,
'embedder'
,
None
)
is
not
None
:
sd_model
.
embedder
.
register_forward_pre_hook
(
send_me_to_gpu
)
if
use_medvram
:
...
...
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