aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorw-e-w <40751091+w-e-w@users.noreply.github.com>2023-11-27 04:15:17 +0000
committerw-e-w <40751091+w-e-w@users.noreply.github.com>2023-11-27 04:15:17 +0000
commitb30cc87b786d32f2385cfecf40a2469ee3a96ab5 (patch)
tree28cb1484c8b5ab253f1387e51801de09595f37fb
parentf0f100e67b78f686dc73cf3c8cad422e45cc9b8a (diff)
downloadstable-diffusion-webui-gfx803-b30cc87b786d32f2385cfecf40a2469ee3a96ab5.tar.gz
stable-diffusion-webui-gfx803-b30cc87b786d32f2385cfecf40a2469ee3a96ab5.tar.bz2
stable-diffusion-webui-gfx803-b30cc87b786d32f2385cfecf40a2469ee3a96ab5.zip
add Block component creation callback
-rw-r--r--modules/gradio_extensons.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/gradio_extensons.py b/modules/gradio_extensons.py
index e6b6835a..7d88dc98 100644
--- a/modules/gradio_extensons.py
+++ b/modules/gradio_extensons.py
@@ -47,10 +47,20 @@ def Block_get_config(self):
def BlockContext_init(self, *args, **kwargs):
+ if scripts.scripts_current is not None:
+ scripts.scripts_current.before_component(self, **kwargs)
+
+ scripts.script_callbacks.before_component_callback(self, **kwargs)
+
res = original_BlockContext_init(self, *args, **kwargs)
add_classes_to_gradio_component(self)
+ scripts.script_callbacks.after_component_callback(self, **kwargs)
+
+ if scripts.scripts_current is not None:
+ scripts.scripts_current.after_component(self, **kwargs)
+
return res