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
51c65457
Commit
51c65457
authored
Aug 31, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
workaround for a weird bug in DDIM's make_schedule
parent
53e7616b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
webui.py
webui.py
+7
-2
No files found.
webui.py
View file @
51c65457
...
...
@@ -847,7 +847,6 @@ class VanillaStableDiffusionSampler:
def
__init__
(
self
,
constructor
):
self
.
sampler
=
constructor
(
sd_model
)
self
.
orig_p_sample_ddim
=
self
.
sampler
.
p_sample_ddim
self
.
sampler
.
p_sample_ddim
=
lambda
x_dec
,
cond
,
ts
,
*
args
,
**
kwargs
:
p_sample_ddim_hook
(
self
,
x_dec
,
cond
,
ts
,
*
args
,
**
kwargs
)
self
.
mask
=
None
self
.
nmask
=
None
self
.
init_latent
=
None
...
...
@@ -855,9 +854,15 @@ class VanillaStableDiffusionSampler:
def
sample_img2img
(
self
,
p
,
x
,
noise
,
conditioning
,
unconditional_conditioning
):
t_enc
=
int
(
min
(
p
.
denoising_strength
,
0.999
)
*
p
.
steps
)
self
.
sampler
.
make_schedule
(
ddim_num_steps
=
p
.
steps
,
ddim_eta
=
0.0
,
verbose
=
False
)
# existing code fail with cetin step counts, like 9
try
:
self
.
sampler
.
make_schedule
(
ddim_num_steps
=
p
.
steps
,
verbose
=
False
)
except
Exception
:
self
.
sampler
.
make_schedule
(
ddim_num_steps
=
p
.
steps
+
1
,
verbose
=
False
)
x1
=
self
.
sampler
.
stochastic_encode
(
x
,
torch
.
tensor
([
t_enc
]
*
int
(
x
.
shape
[
0
]))
.
to
(
device
),
noise
=
noise
)
self
.
sampler
.
p_sample_ddim
=
lambda
x_dec
,
cond
,
ts
,
*
args
,
**
kwargs
:
p_sample_ddim_hook
(
self
,
x_dec
,
cond
,
ts
,
*
args
,
**
kwargs
)
self
.
mask
=
p
.
mask
self
.
nmask
=
p
.
nmask
self
.
init_latent
=
p
.
init_latent
...
...
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