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
219e6448
Commit
219e6448
authored
Apr 08, 2024
by
w-e-w
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-work extra_generation_params for Hires prompt
parent
47ed9b2d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
modules/processing.py
modules/processing.py
+16
-10
No files found.
modules/processing.py
View file @
219e6448
...
...
@@ -703,7 +703,7 @@ def program_version():
return
res
def
create_infotext
(
p
,
all_prompts
,
all_seeds
,
all_subseeds
,
comments
=
None
,
iteration
=
0
,
position_in_batch
=
0
,
use_main_prompt
=
False
,
index
=
None
,
all_negative_prompts
=
None
,
all_hr_prompts
=
None
,
all_hr_negative_prompts
=
None
):
def
create_infotext
(
p
,
all_prompts
,
all_seeds
,
all_subseeds
,
comments
=
None
,
iteration
=
0
,
position_in_batch
=
0
,
use_main_prompt
=
False
,
index
=
None
,
all_negative_prompts
=
None
):
if
use_main_prompt
:
index
=
0
elif
index
is
None
:
...
...
@@ -717,6 +717,9 @@ def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments=None, iter
token_merging_ratio
=
p
.
get_token_merging_ratio
()
token_merging_ratio_hr
=
p
.
get_token_merging_ratio
(
for_hr
=
True
)
prompt_text
=
p
.
main_prompt
if
use_main_prompt
else
all_prompts
[
index
]
negative_prompt
=
p
.
main_negative_prompt
if
use_main_prompt
else
all_negative_prompts
[
index
]
uses_ensd
=
opts
.
eta_noise_seed_delta
!=
0
if
uses_ensd
:
uses_ensd
=
sd_samplers_common
.
is_sampler_using_eta_noise_seed_delta
(
p
)
...
...
@@ -749,8 +752,6 @@ def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments=None, iter
"RNG"
:
opts
.
randn_source
if
opts
.
randn_source
!=
"GPU"
else
None
,
"NGMS"
:
None
if
p
.
s_min_uncond
==
0
else
p
.
s_min_uncond
,
"Tiling"
:
"True"
if
p
.
tiling
else
None
,
"Hires prompt"
:
None
,
# This is set later, insert here to keep order
"Hires negative prompt"
:
None
,
# This is set later, insert here to keep order
**
p
.
extra_generation_params
,
"Version"
:
program_version
()
if
opts
.
add_version_to_infotext
else
None
,
"User"
:
p
.
user
if
opts
.
add_user_name_to_info
else
None
,
...
...
@@ -766,15 +767,9 @@ def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments=None, iter
errors
.
report
(
f
'Error creating infotext for key "{key}"'
,
exc_info
=
True
)
generation_params
[
key
]
=
None
if
all_hr_prompts
:
=
all_hr_prompts
or
getattr
(
p
,
'all_hr_prompts'
,
None
):
generation_params
[
'Hires prompt'
]
=
all_hr_prompts
[
index
]
if
all_hr_prompts
[
index
]
!=
all_prompts
[
index
]
else
None
if
all_hr_negative_prompts
:
=
all_hr_negative_prompts
or
getattr
(
p
,
'all_hr_negative_prompts'
,
None
):
generation_params
[
'Hires negative prompt'
]
=
all_hr_negative_prompts
[
index
]
if
all_hr_negative_prompts
[
index
]
!=
all_negative_prompts
[
index
]
else
None
generation_params_text
=
", "
.
join
([
k
if
k
==
v
else
f
'{k}: {infotext_utils.quote(v)}'
for
k
,
v
in
generation_params
.
items
()
if
v
is
not
None
])
prompt_text
=
p
.
main_prompt
if
use_main_prompt
else
all_prompts
[
index
]
negative_prompt_text
=
f
"
\n
Negative prompt: {p.main_negative_prompt if use_main_prompt else all_negative_prompts[index]}"
if
all_negative_prompts
[
index
]
else
""
negative_prompt_text
=
f
"
\n
Negative prompt: {negative_prompt}"
if
negative_prompt
else
""
return
f
"{prompt_text}{negative_prompt_text}
\n
{generation_params_text}"
.
strip
()
...
...
@@ -1216,6 +1211,17 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
if
self
.
hr_sampler_name
is
not
None
and
self
.
hr_sampler_name
!=
self
.
sampler_name
:
self
.
extra_generation_params
[
"Hires sampler"
]
=
self
.
hr_sampler_name
def
get_hr_prompt
(
p
,
index
,
prompt_text
,
**
kwargs
):
hr_prompt
=
p
.
all_hr_prompts
[
index
]
return
hr_prompt
if
hr_prompt
!=
prompt_text
else
None
def
get_hr_negative_prompt
(
p
,
index
,
negative_prompt
,
**
kwargs
):
hr_negative_prompt
=
p
.
all_hr_negative_prompts
[
index
]
return
hr_negative_prompt
if
hr_negative_prompt
!=
negative_prompt
else
None
self
.
extra_generation_params
[
"Hires prompt"
]
=
get_hr_prompt
self
.
extra_generation_params
[
"Hires negative prompt"
]
=
get_hr_negative_prompt
self
.
extra_generation_params
[
"Hires schedule type"
]
=
None
# to be set in sd_samplers_kdiffusion.py
if
self
.
hr_scheduler
is
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