mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-12-05 18:20:27 -08:00
add Block component creation callback
This commit is contained in:
parent
f0f100e67b
commit
b30cc87b78
1 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue