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
27e9e3f6
Commit
27e9e3f6
authored
Jun 19, 2023
by
stablegeniusdiffuser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add use_main_prompt parameter to use proper metadata for batch run grids or individual images
parent
59419bd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
modules/processing.py
modules/processing.py
+7
-6
No files found.
modules/processing.py
View file @
27e9e3f6
...
...
@@ -549,7 +549,7 @@ def program_version():
return
res
def
create_infotext
(
p
,
all_prompts
,
all_seeds
,
all_subseeds
,
comments
=
None
,
iteration
=
0
,
position_in_batch
=
0
):
def
create_infotext
(
p
,
all_prompts
,
all_seeds
,
all_subseeds
,
comments
=
None
,
iteration
=
0
,
position_in_batch
=
0
,
use_main_prompt
=
False
):
index
=
position_in_batch
+
iteration
*
p
.
batch_size
clip_skip
=
getattr
(
p
,
'clip_skip'
,
opts
.
CLIP_stop_at_last_layers
)
...
...
@@ -589,9 +589,10 @@ def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments=None, iter
generation_params_text
=
", "
.
join
([
k
if
k
==
v
else
f
'{k}: {generation_parameters_copypaste.quote(v)}'
for
k
,
v
in
generation_params
.
items
()
if
v
is
not
None
])
prompt_text
=
p
.
prompt
if
use_main_prompt
else
all_prompts
[
index
]
negative_prompt_text
=
f
"
\n
Negative prompt: {p.all_negative_prompts[index]}"
if
p
.
all_negative_prompts
[
index
]
else
""
return
f
"{
all_prompts[index]
}{negative_prompt_text}
\n
{generation_params_text}"
.
strip
()
return
f
"{
prompt_text
}{negative_prompt_text}
\n
{generation_params_text}"
.
strip
()
def
process_images
(
p
:
StableDiffusionProcessing
)
->
Processed
:
...
...
@@ -663,8 +664,8 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
else
:
p
.
all_subseeds
=
[
int
(
subseed
)
+
x
for
x
in
range
(
len
(
p
.
all_prompts
))]
def
infotext
(
iteration
=
0
,
position_in_batch
=
0
):
return
create_infotext
(
p
,
p
.
all_prompts
,
p
.
all_seeds
,
p
.
all_subseeds
,
comments
,
iteration
,
position_in_batch
)
def
infotext
(
iteration
=
0
,
position_in_batch
=
0
,
use_main_prompt
=
False
):
return
create_infotext
(
p
,
p
.
all_prompts
,
p
.
all_seeds
,
p
.
all_subseeds
,
comments
,
iteration
,
position_in_batch
,
use_main_prompt
)
if
os
.
path
.
exists
(
cmd_opts
.
embeddings_dir
)
and
not
p
.
do_not_reload_embeddings
:
model_hijack
.
embedding_db
.
load_textual_inversion_embeddings
()
...
...
@@ -824,7 +825,7 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
grid
=
images
.
image_grid
(
output_images
,
p
.
batch_size
)
if
opts
.
return_grid
:
text
=
infotext
()
text
=
infotext
(
use_main_prompt
=
True
)
infotexts
.
insert
(
0
,
text
)
if
opts
.
enable_pnginfo
:
grid
.
info
[
"parameters"
]
=
text
...
...
@@ -832,7 +833,7 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
index_of_first_image
=
1
if
opts
.
grid_save
:
images
.
save_image
(
grid
,
p
.
outpath_grids
,
"grid"
,
p
.
all_seeds
[
0
],
p
.
all_prompts
[
0
],
opts
.
grid_format
,
info
=
infotext
(),
short_filename
=
not
opts
.
grid_extended_filename
,
p
=
p
,
grid
=
True
)
images
.
save_image
(
grid
,
p
.
outpath_grids
,
"grid"
,
p
.
all_seeds
[
0
],
p
.
all_prompts
[
0
],
opts
.
grid_format
,
info
=
infotext
(
use_main_prompt
=
True
),
short_filename
=
not
opts
.
grid_extended_filename
,
p
=
p
,
grid
=
True
)
if
not
p
.
disable_extra_networks
and
p
.
extra_network_data
:
extra_networks
.
deactivate
(
p
,
p
.
extra_network_data
)
...
...
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