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
97431f29
Commit
97431f29
authored
Nov 17, 2023
by
aria1th
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix double gc and decoding with unet context
parent
ffd0f8dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
modules/processing.py
modules/processing.py
+2
-3
No files found.
modules/processing.py
View file @
97431f29
...
...
@@ -874,7 +874,7 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
else
:
if
opts
.
sd_vae_decode_method
!=
'Full'
:
p
.
extra_generation_params
[
'VAE Decoder'
]
=
opts
.
sd_vae_decode_method
with
hypertile_context_
unet
(
p
.
sd_model
.
model
,
aspect_ratio
=
p
.
width
/
p
.
height
,
tile_size
=
largest_tile_size_available
(
p
.
width
,
p
.
height
),
is_sdxl
=
shared
.
sd_model
.
is_sdxl
,
opts
=
shared
.
opts
):
with
hypertile_context_
vae
(
p
.
sd_model
.
first_stage_model
,
aspect_ratio
=
p
.
width
/
p
.
height
,
tile_size
=
largest_tile_size_available
(
p
.
width
,
p
.
height
)
,
opts
=
shared
.
opts
):
x_samples_ddim
=
decode_latent_batch
(
p
.
sd_model
,
samples_ddim
,
target_device
=
devices
.
cpu
,
check_for_nans
=
True
)
x_samples_ddim
=
torch
.
stack
(
x_samples_ddim
)
.
float
()
...
...
@@ -1146,11 +1146,11 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
tile_size
=
largest_tile_size_available
(
self
.
width
,
self
.
height
)
with
hypertile_context_vae
(
self
.
sd_model
.
first_stage_model
,
aspect_ratio
=
aspect_ratio
,
tile_size
=
tile_size
,
opts
=
shared
.
opts
):
with
hypertile_context_unet
(
self
.
sd_model
.
model
,
aspect_ratio
=
aspect_ratio
,
tile_size
=
tile_size
,
is_sdxl
=
shared
.
sd_model
.
is_sdxl
,
opts
=
shared
.
opts
):
devices
.
torch_gc
()
samples
=
self
.
sampler
.
sample
(
self
,
x
,
conditioning
,
unconditional_conditioning
,
image_conditioning
=
self
.
txt2img_image_conditioning
(
x
))
del
x
if
not
self
.
enable_hr
:
return
samples
devices
.
torch_gc
()
if
self
.
latent_scale_mode
is
None
:
with
hypertile_context_vae
(
self
.
sd_model
.
first_stage_model
,
aspect_ratio
=
aspect_ratio
,
tile_size
=
tile_size
,
opts
=
shared
.
opts
):
...
...
@@ -1536,7 +1536,6 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing):
tile_size
=
largest_tile_size_available
(
self
.
width
,
self
.
height
)
with
hypertile_context_vae
(
self
.
sd_model
.
first_stage_model
,
aspect_ratio
=
aspect_ratio
,
tile_size
=
tile_size
,
opts
=
shared
.
opts
):
with
hypertile_context_unet
(
self
.
sd_model
.
model
,
aspect_ratio
=
aspect_ratio
,
tile_size
=
tile_size
,
is_sdxl
=
shared
.
sd_model
.
is_sdxl
,
opts
=
shared
.
opts
):
devices
.
torch_gc
()
samples
=
self
.
sampler
.
sample_img2img
(
self
,
self
.
init_latent
,
x
,
conditioning
,
unconditional_conditioning
,
image_conditioning
=
self
.
image_conditioning
)
if
self
.
mask
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