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
835a7dbf
Commit
835a7dbf
authored
Jul 26, 2023
by
AUTOMATIC1111
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify PostprocessBatchListArgs
parent
7c22bbd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
22 deletions
+9
-22
modules/processing.py
modules/processing.py
+3
-12
modules/scripts.py
modules/scripts.py
+6
-10
No files found.
modules/processing.py
View file @
835a7dbf
...
@@ -807,21 +807,12 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
...
@@ -807,21 +807,12 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
if p.scripts is not None:
if p.scripts is not None:
p.scripts.postprocess_batch(p, x_samples_ddim, batch_number=n)
p.scripts.postprocess_batch(p, x_samples_ddim, batch_number=n)
batch_params
=
scripts
.
PostprocessBatchListArgs
(
p.prompts = p.all_prompts[n * p.batch_size:(n + 1) * p.batch_size]
list
(
x_samples_ddim
),
p.negative_prompts = p.all_negative_prompts[n * p.batch_size:(n + 1) * p.batch_size]
p
.
all_prompts
[
n
*
p
.
batch_size
:(
n
+
1
)
*
p
.
batch_size
],
p
.
all_negative_prompts
[
n
*
p
.
batch_size
:(
n
+
1
)
*
p
.
batch_size
],
p
.
seeds
,
p
.
subseeds
,
)
batch_params = scripts.PostprocessBatchListArgs(list(x_samples_ddim))
p.scripts.postprocess_batch_list(p, batch_params, batch_number=n)
p.scripts.postprocess_batch_list(p, batch_params, batch_number=n)
x_samples_ddim = batch_params.images
x_samples_ddim = batch_params.images
p
.
prompts
=
batch_params
.
prompts
p
.
negative_prompts
=
batch_params
.
negative_prompts
p
.
seeds
=
batch_params
.
seeds
p
.
subseeds
=
batch_params
.
subseeds
def infotext(index=0, use_main_prompt=False):
def infotext(index=0, use_main_prompt=False):
return create_infotext(p, p.prompts, p.seeds, p.subseeds, use_main_prompt=use_main_prompt, index=index, all_negative_prompts=p.negative_prompts)
return create_infotext(p, p.prompts, p.seeds, p.subseeds, use_main_prompt=use_main_prompt, index=index, all_negative_prompts=p.negative_prompts)
...
...
modules/scripts.py
View file @
835a7dbf
...
@@ -17,12 +17,8 @@ class PostprocessImageArgs:
...
@@ -17,12 +17,8 @@ class PostprocessImageArgs:
class
PostprocessBatchListArgs
:
class
PostprocessBatchListArgs
:
def
__init__
(
self
,
images
,
prompts
,
negative_prompts
,
seeds
,
subseeds
):
def
__init__
(
self
,
images
):
self
.
images
=
images
self
.
images
=
images
self
.
prompts
=
prompts
self
.
negative_prompts
=
negative_prompts
self
.
seeds
=
seeds
self
.
subseeds
=
subseeds
class
Script
:
class
Script
:
...
@@ -172,11 +168,11 @@ class Script:
...
@@ -172,11 +168,11 @@ class Script:
You can modify the postprocessing object (pp) to update the images in the batch, remove images, add images, etc.
You can modify the postprocessing object (pp) to update the images in the batch, remove images, add images, etc.
If the number of images is different from the batch size when returning,
If the number of images is different from the batch size when returning,
then the script has the responsibility to also update the following attributes in the processing object (p
p
):
then the script has the responsibility to also update the following attributes in the processing object (p):
- p
p
.prompts
- p.prompts
- p
p
.negative_prompts
- p.negative_prompts
- p
p
.seeds
- p.seeds
- p
p
.subseeds
- p.subseeds
**kwargs will have same items as process_batch, and also:
**kwargs will have same items as process_batch, and also:
- batch_number - index of current batch, from 0 to number of batches-1
- batch_number - index of current batch, from 0 to number of batches-1
...
...
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