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
0ea61a74
Commit
0ea61a74
authored
Aug 14, 2023
by
Kohaku-Blueleaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add res(dpmdd 2m sde heun) and reorder the sampler list
parent
007ecfbb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
modules/sd_samplers_kdiffusion.py
modules/sd_samplers_kdiffusion.py
+14
-4
No files found.
modules/sd_samplers_kdiffusion.py
View file @
0ea61a74
...
@@ -8,10 +8,6 @@ from modules.shared import opts
...
@@ -8,10 +8,6 @@ from modules.shared import opts
import
modules.shared
as
shared
import
modules.shared
as
shared
samplers_k_diffusion
=
[
samplers_k_diffusion
=
[
(
'DPM++ 2M Karras'
,
'sample_dpmpp_2m'
,
[
'k_dpmpp_2m_ka'
],
{
'scheduler'
:
'karras'
}),
(
'DPM++ SDE Karras'
,
'sample_dpmpp_sde'
,
[
'k_dpmpp_sde_ka'
],
{
'scheduler'
:
'karras'
,
"second_order"
:
True
,
"brownian_noise"
:
True
}),
(
'DPM++ 2M SDE Exponential'
,
'sample_dpmpp_2m_sde'
,
[
'k_dpmpp_2m_sde_exp'
],
{
'scheduler'
:
'exponential'
,
"brownian_noise"
:
True
}),
(
'DPM++ 2M SDE Karras'
,
'sample_dpmpp_2m_sde'
,
[
'k_dpmpp_2m_sde_ka'
],
{
'scheduler'
:
'karras'
,
"brownian_noise"
:
True
}),
(
'Euler a'
,
'sample_euler_ancestral'
,
[
'k_euler_a'
,
'k_euler_ancestral'
],
{
"uses_ensd"
:
True
}),
(
'Euler a'
,
'sample_euler_ancestral'
,
[
'k_euler_a'
,
'k_euler_ancestral'
],
{
"uses_ensd"
:
True
}),
(
'Euler'
,
'sample_euler'
,
[
'k_euler'
],
{}),
(
'Euler'
,
'sample_euler'
,
[
'k_euler'
],
{}),
(
'LMS'
,
'sample_lms'
,
[
'k_lms'
],
{}),
(
'LMS'
,
'sample_lms'
,
[
'k_lms'
],
{}),
...
@@ -20,8 +16,15 @@ samplers_k_diffusion = [
...
@@ -20,8 +16,15 @@ samplers_k_diffusion = [
(
'DPM2 a'
,
'sample_dpm_2_ancestral'
,
[
'k_dpm_2_a'
],
{
'discard_next_to_last_sigma'
:
True
,
"uses_ensd"
:
True
}),
(
'DPM2 a'
,
'sample_dpm_2_ancestral'
,
[
'k_dpm_2_a'
],
{
'discard_next_to_last_sigma'
:
True
,
"uses_ensd"
:
True
}),
(
'DPM++ 2S a'
,
'sample_dpmpp_2s_ancestral'
,
[
'k_dpmpp_2s_a'
],
{
"uses_ensd"
:
True
,
"second_order"
:
True
}),
(
'DPM++ 2S a'
,
'sample_dpmpp_2s_ancestral'
,
[
'k_dpmpp_2s_a'
],
{
"uses_ensd"
:
True
,
"second_order"
:
True
}),
(
'DPM++ 2M'
,
'sample_dpmpp_2m'
,
[
'k_dpmpp_2m'
],
{}),
(
'DPM++ 2M'
,
'sample_dpmpp_2m'
,
[
'k_dpmpp_2m'
],
{}),
(
'DPM++ 2M Karras'
,
'sample_dpmpp_2m'
,
[
'k_dpmpp_2m_ka'
],
{
'scheduler'
:
'karras'
}),
(
'DPM++ SDE'
,
'sample_dpmpp_sde'
,
[
'k_dpmpp_sde'
],
{
"second_order"
:
True
,
"brownian_noise"
:
True
}),
(
'DPM++ SDE'
,
'sample_dpmpp_sde'
,
[
'k_dpmpp_sde'
],
{
"second_order"
:
True
,
"brownian_noise"
:
True
}),
(
'DPM++ SDE Karras'
,
'sample_dpmpp_sde'
,
[
'k_dpmpp_sde_ka'
],
{
'scheduler'
:
'karras'
,
"second_order"
:
True
,
"brownian_noise"
:
True
}),
(
'DPM++ 2M SDE'
,
'sample_dpmpp_2m_sde'
,
[
'k_dpmpp_2m_sde_ka'
],
{
"brownian_noise"
:
True
}),
(
'DPM++ 2M SDE'
,
'sample_dpmpp_2m_sde'
,
[
'k_dpmpp_2m_sde_ka'
],
{
"brownian_noise"
:
True
}),
(
'DPM++ 2M SDE Karras'
,
'sample_dpmpp_2m_sde'
,
[
'k_dpmpp_2m_sde_ka'
],
{
'scheduler'
:
'karras'
,
"brownian_noise"
:
True
}),
(
'DPM++ 2M SDE Exponential'
,
'sample_dpmpp_2m_sde'
,
[
'k_dpmpp_2m_sde_exp'
],
{
'scheduler'
:
'exponential'
,
"brownian_noise"
:
True
}),
(
'DPM++ 2M SDE Heun'
,
'sample_dpmpp_2m_sde'
,
[
'k_dpmpp_2m_sde_heun'
],
{
"brownian_noise"
:
True
,
"solver_type"
:
"heun"
}),
(
'DPM++ 2M SDE Heun Karras'
,
'sample_dpmpp_2m_sde'
,
[
'k_dpmpp_2m_sde_heun_ka'
],
{
'scheduler'
:
'karras'
,
"brownian_noise"
:
True
,
"solver_type"
:
"heun"
}),
(
'DPM++ 2M SDE Heun Exponential'
,
'sample_dpmpp_2m_sde'
,
[
'k_dpmpp_2m_sde_heun_exp'
],
{
'scheduler'
:
'exponential'
,
"brownian_noise"
:
True
,
"solver_type"
:
"heun"
}),
(
'DPM++ 3M SDE'
,
'sample_dpmpp_3m_sde'
,
[
'k_dpmpp_3m_sde'
],
{
'discard_next_to_last_sigma'
:
True
,
"brownian_noise"
:
True
}),
(
'DPM++ 3M SDE'
,
'sample_dpmpp_3m_sde'
,
[
'k_dpmpp_3m_sde'
],
{
'discard_next_to_last_sigma'
:
True
,
"brownian_noise"
:
True
}),
(
'DPM++ 3M SDE Karras'
,
'sample_dpmpp_3m_sde'
,
[
'k_dpmpp_3m_sde_ka'
],
{
'scheduler'
:
'karras'
,
'discard_next_to_last_sigma'
:
True
,
"brownian_noise"
:
True
}),
(
'DPM++ 3M SDE Karras'
,
'sample_dpmpp_3m_sde'
,
[
'k_dpmpp_3m_sde_ka'
],
{
'scheduler'
:
'karras'
,
'discard_next_to_last_sigma'
:
True
,
"brownian_noise"
:
True
}),
(
'DPM++ 3M SDE Exponential'
,
'sample_dpmpp_3m_sde'
,
[
'k_dpmpp_3m_sde_exp'
],
{
'scheduler'
:
'exponential'
,
'discard_next_to_last_sigma'
:
True
,
"brownian_noise"
:
True
}),
(
'DPM++ 3M SDE Exponential'
,
'sample_dpmpp_3m_sde'
,
[
'k_dpmpp_3m_sde_exp'
],
{
'scheduler'
:
'exponential'
,
'discard_next_to_last_sigma'
:
True
,
"brownian_noise"
:
True
}),
...
@@ -161,6 +164,9 @@ class KDiffusionSampler(sd_samplers_common.Sampler):
...
@@ -161,6 +164,9 @@ class KDiffusionSampler(sd_samplers_common.Sampler):
noise_sampler
=
self
.
create_noise_sampler
(
x
,
sigmas
,
p
)
noise_sampler
=
self
.
create_noise_sampler
(
x
,
sigmas
,
p
)
extra_params_kwargs
[
'noise_sampler'
]
=
noise_sampler
extra_params_kwargs
[
'noise_sampler'
]
=
noise_sampler
if
self
.
config
.
options
.
get
(
'solver_type'
,
None
)
==
'heun'
:
extra_params_kwargs
[
'solver_type'
]
=
'heun'
self
.
model_wrap_cfg
.
init_latent
=
x
self
.
model_wrap_cfg
.
init_latent
=
x
self
.
last_latent
=
x
self
.
last_latent
=
x
self
.
sampler_extra_args
=
{
self
.
sampler_extra_args
=
{
...
@@ -202,6 +208,9 @@ class KDiffusionSampler(sd_samplers_common.Sampler):
...
@@ -202,6 +208,9 @@ class KDiffusionSampler(sd_samplers_common.Sampler):
noise_sampler
=
self
.
create_noise_sampler
(
x
,
sigmas
,
p
)
noise_sampler
=
self
.
create_noise_sampler
(
x
,
sigmas
,
p
)
extra_params_kwargs
[
'noise_sampler'
]
=
noise_sampler
extra_params_kwargs
[
'noise_sampler'
]
=
noise_sampler
if
self
.
config
.
options
.
get
(
'solver_type'
,
None
)
==
'heun'
:
extra_params_kwargs
[
'solver_type'
]
=
'heun'
self
.
last_latent
=
x
self
.
last_latent
=
x
self
.
sampler_extra_args
=
{
self
.
sampler_extra_args
=
{
'cond'
:
conditioning
,
'cond'
:
conditioning
,
...
@@ -210,6 +219,7 @@ class KDiffusionSampler(sd_samplers_common.Sampler):
...
@@ -210,6 +219,7 @@ class KDiffusionSampler(sd_samplers_common.Sampler):
'cond_scale'
:
p
.
cfg_scale
,
'cond_scale'
:
p
.
cfg_scale
,
's_min_uncond'
:
self
.
s_min_uncond
's_min_uncond'
:
self
.
s_min_uncond
}
}
samples
=
self
.
launch_sampling
(
steps
,
lambda
:
self
.
func
(
self
.
model_wrap_cfg
,
x
,
extra_args
=
self
.
sampler_extra_args
,
disable
=
False
,
callback
=
self
.
callback_state
,
**
extra_params_kwargs
))
samples
=
self
.
launch_sampling
(
steps
,
lambda
:
self
.
func
(
self
.
model_wrap_cfg
,
x
,
extra_args
=
self
.
sampler_extra_args
,
disable
=
False
,
callback
=
self
.
callback_state
,
**
extra_params_kwargs
))
if
self
.
model_wrap_cfg
.
padded_cond_uncond
:
if
self
.
model_wrap_cfg
.
padded_cond_uncond
:
...
...
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