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
c1e04c63
Commit
c1e04c63
authored
Jan 16, 2024
by
w-e-w
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
callback postprocess_image_after_composite
parent
cb5b335a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
modules/processing.py
modules/processing.py
+5
-0
modules/scripts.py
modules/scripts.py
+17
-0
No files found.
modules/processing.py
View file @
c1e04c63
...
@@ -1029,6 +1029,11 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
...
@@ -1029,6 +1029,11 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
image
=
apply_overlay
(
image
,
p
.
paste_to
,
overlay_image
)
image
=
apply_overlay
(
image
,
p
.
paste_to
,
overlay_image
)
if
p
.
scripts
is
not
None
:
pp
=
scripts
.
PostprocessImageArgs
(
image
)
p
.
scripts
.
postprocess_image_after_composite
(
p
,
pp
)
image
=
pp
.
image
if
save_samples
:
if
save_samples
:
images
.
save_image
(
image
,
p
.
outpath_samples
,
""
,
p
.
seeds
[
i
],
p
.
prompts
[
i
],
opts
.
samples_format
,
info
=
infotext
(
i
),
p
=
p
)
images
.
save_image
(
image
,
p
.
outpath_samples
,
""
,
p
.
seeds
[
i
],
p
.
prompts
[
i
],
opts
.
samples_format
,
info
=
infotext
(
i
),
p
=
p
)
...
...
modules/scripts.py
View file @
c1e04c63
...
@@ -262,6 +262,15 @@ class Script:
...
@@ -262,6 +262,15 @@ class Script:
pass
pass
def
postprocess_image_after_composite
(
self
,
p
,
pp
:
PostprocessImageArgs
,
*
args
):
"""
Called for every image after it has been generated.
Same as postprocess_image but after inpaint_full_res composite
So that it operates on the full image instead of the inpaint_full_res crop region.
"""
pass
def
postprocess
(
self
,
p
,
processed
,
*
args
):
def
postprocess
(
self
,
p
,
processed
,
*
args
):
"""
"""
This function is called after processing ends for AlwaysVisible scripts.
This function is called after processing ends for AlwaysVisible scripts.
...
@@ -856,6 +865,14 @@ class ScriptRunner:
...
@@ -856,6 +865,14 @@ class ScriptRunner:
except
Exception
:
except
Exception
:
errors
.
report
(
f
"Error running postprocess_image: {script.filename}"
,
exc_info
=
True
)
errors
.
report
(
f
"Error running postprocess_image: {script.filename}"
,
exc_info
=
True
)
def
postprocess_image_after_composite
(
self
,
p
,
pp
:
PostprocessImageArgs
):
for
script
in
self
.
alwayson_scripts
:
try
:
script_args
=
p
.
script_args
[
script
.
args_from
:
script
.
args_to
]
script
.
postprocess_image_after_composite
(
p
,
pp
,
*
script_args
)
except
Exception
:
errors
.
report
(
f
"Error running postprocess_image_after_composite: {script.filename}"
,
exc_info
=
True
)
def
before_component
(
self
,
component
,
**
kwargs
):
def
before_component
(
self
,
component
,
**
kwargs
):
for
callback
,
script
in
self
.
on_before_component_elem_id
.
get
(
kwargs
.
get
(
"elem_id"
),
[]):
for
callback
,
script
in
self
.
on_before_component_elem_id
.
get
(
kwargs
.
get
(
"elem_id"
),
[]):
try
:
try
:
...
...
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