mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-12-06 10:31:17 -08:00
Lora support!
update readme to reflect some recent changes
This commit is contained in:
parent
cbfb463258
commit
855b9e3d1c
9 changed files with 314 additions and 4 deletions
|
|
@ -73,6 +73,7 @@ callback_map = dict(
|
|||
callbacks_image_grid=[],
|
||||
callbacks_infotext_pasted=[],
|
||||
callbacks_script_unloaded=[],
|
||||
callbacks_before_ui=[],
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -189,6 +190,14 @@ def script_unloaded_callback():
|
|||
report_exception(c, 'script_unloaded')
|
||||
|
||||
|
||||
def before_ui_callback():
|
||||
for c in reversed(callback_map['callbacks_before_ui']):
|
||||
try:
|
||||
c.callback()
|
||||
except Exception:
|
||||
report_exception(c, 'before_ui')
|
||||
|
||||
|
||||
def add_callback(callbacks, fun):
|
||||
stack = [x for x in inspect.stack() if x.filename != __file__]
|
||||
filename = stack[0].filename if len(stack) > 0 else 'unknown file'
|
||||
|
|
@ -313,3 +322,9 @@ def on_script_unloaded(callback):
|
|||
the script did should be reverted here"""
|
||||
|
||||
add_callback(callback_map['callbacks_script_unloaded'], callback)
|
||||
|
||||
|
||||
def on_before_ui(callback):
|
||||
"""register a function to be called before the UI is created."""
|
||||
|
||||
add_callback(callback_map['callbacks_before_ui'], callback)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue