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
5fef67f6
Commit
5fef67f6
authored
Mar 10, 2023
by
space-nuko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Requested changes
parent
ac38ad7e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
modules/models/diffusion/uni_pc/sampler.py
modules/models/diffusion/uni_pc/sampler.py
+1
-1
modules/sd_samplers_compvis.py
modules/sd_samplers_compvis.py
+3
-1
modules/shared.py
modules/shared.py
+1
-2
No files found.
modules/models/diffusion/uni_pc/sampler.py
View file @
5fef67f6
...
...
@@ -93,7 +93,7 @@ class UniPCSampler(object):
guidance_scale
=
unconditional_guidance_scale
,
)
uni_pc
=
UniPC
(
model_fn
,
ns
,
predict_x0
=
True
,
thresholding
=
shared
.
opts
.
uni_pc_thresholding
,
variant
=
shared
.
opts
.
uni_pc_variant
,
condition
=
conditioning
,
unconditional_condition
=
unconditional_conditioning
,
before_sample
=
self
.
before_sample
,
after_sample
=
self
.
after_sample
,
after_update
=
self
.
after_update
)
uni_pc
=
UniPC
(
model_fn
,
ns
,
predict_x0
=
True
,
thresholding
=
False
,
variant
=
shared
.
opts
.
uni_pc_variant
,
condition
=
conditioning
,
unconditional_condition
=
unconditional_conditioning
,
before_sample
=
self
.
before_sample
,
after_sample
=
self
.
after_sample
,
after_update
=
self
.
after_update
)
x
=
uni_pc
.
sample
(
img
,
steps
=
S
,
skip_type
=
shared
.
opts
.
uni_pc_skip_type
,
method
=
"multistep"
,
order
=
shared
.
opts
.
uni_pc_order
,
lower_order_final
=
shared
.
opts
.
uni_pc_lower_order_final
)
return
x
.
to
(
device
),
None
modules/sd_samplers_compvis.py
View file @
5fef67f6
...
...
@@ -140,10 +140,12 @@ class VanillaStableDiffusionSampler:
def
adjust_steps_if_invalid
(
self
,
p
,
num_steps
):
if
((
self
.
config
.
name
==
'DDIM'
)
and
p
.
ddim_discretize
==
'uniform'
)
or
(
self
.
config
.
name
==
'PLMS'
)
or
(
self
.
config
.
name
==
'UniPC'
):
if
self
.
config
.
name
==
'UniPC'
and
num_steps
<
shared
.
opts
.
uni_pc_order
:
num_steps
=
shared
.
opts
.
uni_pc_order
valid_step
=
999
/
(
1000
//
num_steps
)
if
valid_step
==
math
.
floor
(
valid_step
):
return
int
(
valid_step
)
+
1
return
num_steps
def
sample_img2img
(
self
,
p
,
x
,
noise
,
conditioning
,
unconditional_conditioning
,
steps
=
None
,
image_conditioning
=
None
):
...
...
modules/shared.py
View file @
5fef67f6
...
...
@@ -485,10 +485,9 @@ options_templates.update(options_section(('sampler-params', "Sampler parameters"
's_noise'
:
OptionInfo
(
1.0
,
"sigma noise"
,
gr
.
Slider
,
{
"minimum"
:
0.0
,
"maximum"
:
1.0
,
"step"
:
0.01
}),
'eta_noise_seed_delta'
:
OptionInfo
(
0
,
"Eta noise seed delta"
,
gr
.
Number
,
{
"precision"
:
0
}),
'always_discard_next_to_last_sigma'
:
OptionInfo
(
False
,
"Always discard next-to-last sigma"
),
'uni_pc_variant'
:
OptionInfo
(
"bh1"
,
"UniPC variant"
,
gr
.
Radio
,
{
"choices"
:
[
"bh1"
,
"vary_coeff"
]}),
'uni_pc_variant'
:
OptionInfo
(
"bh1"
,
"UniPC variant"
,
gr
.
Radio
,
{
"choices"
:
[
"bh1"
,
"
bh2"
,
"
vary_coeff"
]}),
'uni_pc_skip_type'
:
OptionInfo
(
"time_uniform"
,
"UniPC skip type"
,
gr
.
Radio
,
{
"choices"
:
[
"time_uniform"
,
"time_quadratic"
,
"logSNR"
]}),
'uni_pc_order'
:
OptionInfo
(
3
,
"UniPC order (must be < sampling steps)"
,
gr
.
Slider
,
{
"minimum"
:
1
,
"maximum"
:
50
,
"step"
:
1
}),
'uni_pc_thresholding'
:
OptionInfo
(
False
,
"UniPC thresholding"
),
'uni_pc_lower_order_final'
:
OptionInfo
(
True
,
"UniPC lower order final"
),
}))
...
...
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