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
fe4e3c26
Commit
fe4e3c26
authored
Sep 08, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for PLMS live previews in txt2img
parent
ca3861e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
modules/sd_samplers.py
modules/sd_samplers.py
+4
-2
No files found.
modules/sd_samplers.py
View file @
fe4e3c26
...
@@ -87,7 +87,7 @@ ldm.models.diffusion.plms.tqdm = lambda *args, desc=None, **kwargs: extended_tdq
...
@@ -87,7 +87,7 @@ ldm.models.diffusion.plms.tqdm = lambda *args, desc=None, **kwargs: extended_tdq
class
VanillaStableDiffusionSampler
:
class
VanillaStableDiffusionSampler
:
def
__init__
(
self
,
constructor
,
sd_model
):
def
__init__
(
self
,
constructor
,
sd_model
):
self
.
sampler
=
constructor
(
sd_model
)
self
.
sampler
=
constructor
(
sd_model
)
self
.
orig_p_sample_ddim
=
self
.
sampler
.
p_sample_ddim
if
hasattr
(
self
.
sampler
,
'p_sample_ddim'
)
else
None
self
.
orig_p_sample_ddim
=
self
.
sampler
.
p_sample_ddim
if
hasattr
(
self
.
sampler
,
'p_sample_ddim'
)
else
self
.
sampler
.
p_sample_plms
self
.
mask
=
None
self
.
mask
=
None
self
.
nmask
=
None
self
.
nmask
=
None
self
.
init_latent
=
None
self
.
init_latent
=
None
...
@@ -113,7 +113,9 @@ class VanillaStableDiffusionSampler:
...
@@ -113,7 +113,9 @@ class VanillaStableDiffusionSampler:
return
samples
return
samples
def
sample
(
self
,
p
,
x
,
conditioning
,
unconditional_conditioning
):
def
sample
(
self
,
p
,
x
,
conditioning
,
unconditional_conditioning
):
self
.
sampler
.
p_sample_ddim
=
lambda
x_dec
,
cond
,
ts
,
*
args
,
**
kwargs
:
p_sample_ddim_hook
(
self
,
x_dec
,
cond
,
ts
,
*
args
,
**
kwargs
)
for
fieldname
in
[
'p_sample_ddim'
,
'p_sample_plms'
]:
if
hasattr
(
self
.
sampler
,
fieldname
):
setattr
(
self
.
sampler
,
fieldname
,
lambda
x_dec
,
cond
,
ts
,
*
args
,
**
kwargs
:
p_sample_ddim_hook
(
self
,
x_dec
,
cond
,
ts
,
*
args
,
**
kwargs
))
self
.
mask
=
None
self
.
mask
=
None
self
.
nmask
=
None
self
.
nmask
=
None
self
.
init_latent
=
None
self
.
init_latent
=
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