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
bb24c13e
Commit
bb24c13e
authored
Mar 02, 2024
by
AUTOMATIC1111
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
infotext support for #14978
parent
aabedcbc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
modules/infotext_utils.py
modules/infotext_utils.py
+3
-0
modules/infotext_versions.py
modules/infotext_versions.py
+3
-0
modules/sd_samplers_common.py
modules/sd_samplers_common.py
+5
-3
No files found.
modules/infotext_utils.py
View file @
bb24c13e
...
...
@@ -359,6 +359,9 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
if
"Emphasis"
not
in
res
:
res
[
"Emphasis"
]
=
"Original"
if
"Refiner switch by sampling steps"
not
in
res
:
res
[
"Refiner switch by sampling steps"
]
=
False
infotext_versions
.
backcompat
(
res
)
for
key
in
skip_fields
:
...
...
modules/infotext_versions.py
View file @
bb24c13e
...
...
@@ -5,6 +5,7 @@ import re
v160
=
version
.
parse
(
"1.6.0"
)
v170_tsnr
=
version
.
parse
(
"v1.7.0-225"
)
v180
=
version
.
parse
(
"1.8.0"
)
def
parse_version
(
text
):
...
...
@@ -40,3 +41,5 @@ def backcompat(d):
if
ver
<
v170_tsnr
:
d
[
"Downcast alphas_cumprod"
]
=
True
if
ver
<
v180
and
d
.
get
(
'Refiner'
):
d
[
"Refiner switch by sampling steps"
]
=
True
modules/sd_samplers_common.py
View file @
bb24c13e
...
...
@@ -155,14 +155,16 @@ def replace_torchsde_browinan():
replace_torchsde_browinan
()
def
apply_refiner
(
cfg_denoiser
,
sigma
):
if
opts
.
refiner_switch_by_sample_steps
:
def
apply_refiner
(
cfg_denoiser
,
sigma
=
None
):
if
opts
.
refiner_switch_by_sample_steps
or
not
sigma
:
completed_ratio
=
cfg_denoiser
.
step
/
cfg_denoiser
.
total_steps
cfg_denoiser
.
p
.
extra_generation_params
[
"Refiner switch by sampling steps"
]
=
True
else
:
# torch.max(sigma) only to handle rare case where we might have different sigmas in the same batch
try
:
timestep
=
torch
.
argmin
(
torch
.
abs
(
cfg_denoiser
.
inner_model
.
sigmas
-
torch
.
max
(
sigma
)))
except
AttributeError
:
# for samplers that don
t use sigmas (DDIM) sigma is actually the timestep
except
AttributeError
:
# for samplers that don'
t use sigmas (DDIM) sigma is actually the timestep
timestep
=
torch
.
max
(
sigma
)
.
to
(
dtype
=
int
)
completed_ratio
=
(
999
-
timestep
)
/
1000
...
...
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