aboutsummaryrefslogtreecommitdiffstats
path: root/modules/scripts.py
diff options
context:
space:
mode:
authorw-e-w <40751091+w-e-w@users.noreply.github.com>2024-01-16 05:18:20 +0000
committerw-e-w <40751091+w-e-w@users.noreply.github.com>2024-01-16 05:18:20 +0000
commitc1e04c63b3d2a5102b4cf6deddea337c8a964c53 (patch)
tree977b719ea36079472b7a32450ac49de35ba3b775 /modules/scripts.py
parentcb5b335acddd126d4f6c990982816c06beb0d6ae (diff)
downloadstable-diffusion-webui-gfx803-c1e04c63b3d2a5102b4cf6deddea337c8a964c53.tar.gz
stable-diffusion-webui-gfx803-c1e04c63b3d2a5102b4cf6deddea337c8a964c53.tar.bz2
stable-diffusion-webui-gfx803-c1e04c63b3d2a5102b4cf6deddea337c8a964c53.zip
callback postprocess_image_after_composite
Diffstat (limited to 'modules/scripts.py')
-rw-r--r--modules/scripts.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/scripts.py b/modules/scripts.py
index cf938ebb..060069cf 100644
--- a/modules/scripts.py
+++ b/modules/scripts.py
@@ -262,6 +262,15 @@ class Script:
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):
"""
This function is called after processing ends for AlwaysVisible scripts.
@@ -856,6 +865,14 @@ class ScriptRunner:
except Exception:
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):
for callback, script in self.on_before_component_elem_id.get(kwargs.get("elem_id"), []):
try: