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
7882f76d
Commit
7882f76d
authored
May 22, 2023
by
Kohaku-Blueleaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace karras by k_diffusion, fix gen info
parent
f8210514
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
10 deletions
+12
-10
modules/img2img.py
modules/img2img.py
+1
-1
modules/processing.py
modules/processing.py
+7
-7
modules/sd_hijack.py
modules/sd_hijack.py
+1
-0
modules/sd_samplers_kdiffusion.py
modules/sd_samplers_kdiffusion.py
+2
-1
modules/txt2img.py
modules/txt2img.py
+1
-1
No files found.
modules/img2img.py
View file @
7882f76d
...
...
@@ -155,7 +155,7 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s
inpaint_full_res_padding
=
inpaint_full_res_padding
,
inpainting_mask_invert
=
inpainting_mask_invert
,
override_settings
=
override_settings
,
enable_
karras
=
enable_k_sched
,
enable_
custom_k_sched
=
enable_k_sched
,
k_sched_type
=
k_sched_type
,
sigma_min
=
sigma_min
,
sigma_max
=
sigma_max
,
...
...
modules/processing.py
View file @
7882f76d
...
...
@@ -106,7 +106,7 @@ class StableDiffusionProcessing:
"""
The first set of paramaters: sd_models -> do_not_reload_embeddings represent the minimum required to create a StableDiffusionProcessing
"""
def
__init__
(
self
,
sd_model
=
None
,
outpath_samples
=
None
,
outpath_grids
=
None
,
prompt
:
str
=
""
,
styles
:
List
[
str
]
=
None
,
seed
:
int
=
-
1
,
subseed
:
int
=
-
1
,
subseed_strength
:
float
=
0
,
seed_resize_from_h
:
int
=
-
1
,
seed_resize_from_w
:
int
=
-
1
,
seed_enable_extras
:
bool
=
True
,
sampler_name
:
str
=
None
,
batch_size
:
int
=
1
,
n_iter
:
int
=
1
,
steps
:
int
=
50
,
cfg_scale
:
float
=
7.0
,
width
:
int
=
512
,
height
:
int
=
512
,
restore_faces
:
bool
=
False
,
tiling
:
bool
=
False
,
do_not_save_samples
:
bool
=
False
,
do_not_save_grid
:
bool
=
False
,
extra_generation_params
:
Dict
[
Any
,
Any
]
=
None
,
overlay_images
:
Any
=
None
,
negative_prompt
:
str
=
None
,
eta
:
float
=
None
,
do_not_reload_embeddings
:
bool
=
False
,
denoising_strength
:
float
=
0
,
ddim_discretize
:
str
=
None
,
s_min_uncond
:
float
=
0.0
,
s_churn
:
float
=
0.0
,
s_tmax
:
float
=
None
,
s_tmin
:
float
=
0.0
,
s_noise
:
float
=
1.0
,
override_settings
:
Dict
[
str
,
Any
]
=
None
,
override_settings_restore_afterwards
:
bool
=
True
,
sampler_index
:
int
=
None
,
script_args
:
list
=
None
,
enable_
karras
:
bool
=
False
,
k_sched_type
:
str
=
"karras"
,
sigma_min
:
float
=
0.1
,
sigma_max
:
float
=
10.0
,
rho
:
float
=
7.0
):
def
__init__
(
self
,
sd_model
=
None
,
outpath_samples
=
None
,
outpath_grids
=
None
,
prompt
:
str
=
""
,
styles
:
List
[
str
]
=
None
,
seed
:
int
=
-
1
,
subseed
:
int
=
-
1
,
subseed_strength
:
float
=
0
,
seed_resize_from_h
:
int
=
-
1
,
seed_resize_from_w
:
int
=
-
1
,
seed_enable_extras
:
bool
=
True
,
sampler_name
:
str
=
None
,
batch_size
:
int
=
1
,
n_iter
:
int
=
1
,
steps
:
int
=
50
,
cfg_scale
:
float
=
7.0
,
width
:
int
=
512
,
height
:
int
=
512
,
restore_faces
:
bool
=
False
,
tiling
:
bool
=
False
,
do_not_save_samples
:
bool
=
False
,
do_not_save_grid
:
bool
=
False
,
extra_generation_params
:
Dict
[
Any
,
Any
]
=
None
,
overlay_images
:
Any
=
None
,
negative_prompt
:
str
=
None
,
eta
:
float
=
None
,
do_not_reload_embeddings
:
bool
=
False
,
denoising_strength
:
float
=
0
,
ddim_discretize
:
str
=
None
,
s_min_uncond
:
float
=
0.0
,
s_churn
:
float
=
0.0
,
s_tmax
:
float
=
None
,
s_tmin
:
float
=
0.0
,
s_noise
:
float
=
1.0
,
override_settings
:
Dict
[
str
,
Any
]
=
None
,
override_settings_restore_afterwards
:
bool
=
True
,
sampler_index
:
int
=
None
,
script_args
:
list
=
None
,
enable_
custom_k_sched
:
bool
=
False
,
k_sched_type
:
str
=
"karras"
,
sigma_min
:
float
=
0.1
,
sigma_max
:
float
=
10.0
,
rho
:
float
=
7.0
):
if
sampler_index
is
not
None
:
print
(
"sampler_index argument for StableDiffusionProcessing does not do anything; use sampler_name"
,
file
=
sys
.
stderr
)
...
...
@@ -146,7 +146,7 @@ class StableDiffusionProcessing:
self
.
s_tmin
=
s_tmin
or
opts
.
s_tmin
self
.
s_tmax
=
s_tmax
or
float
(
'inf'
)
# not representable as a standard ui option
self
.
s_noise
=
s_noise
or
opts
.
s_noise
self
.
enable_
karras
=
enable_karras
self
.
enable_
custom_k_sched
=
enable_custom_k_sched
self
.
k_sched_type
=
k_sched_type
self
.
sigma_max
=
sigma_max
self
.
sigma_min
=
sigma_min
...
...
@@ -563,11 +563,11 @@ def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments=None, iter
generation_params
=
{
"Steps"
:
p
.
steps
,
"Sampler"
:
p
.
sampler_name
,
"Enable Custom Karras Schedule"
:
p
.
enable_
karras
,
"kdiffusion Scheduler Type"
:
p
.
k_sched_type
,
"kdiffusion Scheduler sigma_max"
:
p
.
sigma_max
,
"kdiffusion Scheduler sigma_min"
:
p
.
sigma_min
,
"kdiffusion Scheduler rho"
:
p
.
rho
,
"Enable Custom Karras Schedule"
:
p
.
enable_
custom_k_sched
or
None
,
"kdiffusion Scheduler Type"
:
p
.
k_sched_type
if
p
.
enable_custom_k_sched
else
None
,
"kdiffusion Scheduler sigma_max"
:
p
.
sigma_max
if
p
.
enable_custom_k_sched
else
None
,
"kdiffusion Scheduler sigma_min"
:
p
.
sigma_min
if
p
.
enable_custom_k_sched
else
None
,
"kdiffusion Scheduler rho"
:
p
.
rho
if
p
.
enable_custom_k_sched
else
None
,
"CFG scale"
:
p
.
cfg_scale
,
"Image CFG scale"
:
getattr
(
p
,
'image_cfg_scale'
,
None
),
"Seed"
:
all_seeds
[
index
],
...
...
modules/sd_hijack.py
View file @
7882f76d
...
...
@@ -41,6 +41,7 @@ def list_optimizers():
optimizers
.
clear
()
optimizers
.
extend
(
new_optimizers
)
print
(
optimizers
)
def
apply_optimizations
():
...
...
modules/sd_samplers_kdiffusion.py
View file @
7882f76d
...
...
@@ -44,6 +44,7 @@ sampler_extra_params = {
'sample_dpm_2'
:
[
's_churn'
,
's_tmin'
,
's_tmax'
,
's_noise'
],
}
k_diffusion_samplers_map
=
{
x
.
name
:
x
for
x
in
samplers_data_k_diffusion
}
k_diffusion_scheduler
=
{
'karras'
:
k_diffusion
.
sampling
.
get_sigmas_karras
,
'exponential'
:
k_diffusion
.
sampling
.
get_sigmas_exponential
,
...
...
@@ -310,7 +311,7 @@ class KDiffusionSampler:
if
p
.
sampler_noise_scheduler_override
:
sigmas
=
p
.
sampler_noise_scheduler_override
(
steps
)
elif
p
.
enable_
karras
:
elif
p
.
enable_
custom_k_sched
:
print
(
p
.
k_sched_type
,
p
.
sigma_min
,
p
.
sigma_max
,
p
.
rho
)
sigmas_func
=
k_diffusion_scheduler
[
p
.
k_sched_type
]
sigmas_kwargs
=
{
...
...
modules/txt2img.py
View file @
7882f76d
...
...
@@ -43,7 +43,7 @@ def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_styles, step
hr_prompt
=
hr_prompt
,
hr_negative_prompt
=
hr_negative_prompt
,
override_settings
=
override_settings
,
enable_
karras
=
enable_k_sched
,
enable_
custom_k_sched
=
enable_k_sched
,
k_sched_type
=
k_sched_type
,
sigma_min
=
sigma_min
,
sigma_max
=
sigma_max
,
...
...
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