mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-08 13:19:54 +00:00
Lora support!
update readme to reflect some recent changes
This commit is contained in:
@@ -17,5 +17,5 @@ class ExtraNetworkHypernet(extra_networks.ExtraNetwork):
|
||||
|
||||
hypernetwork.load_hypernetworks(names, multipliers)
|
||||
|
||||
def deactivate(p, self):
|
||||
def deactivate(self, p):
|
||||
pass
|
||||
|
@@ -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)
|
||||
|
@@ -10,7 +10,7 @@ extra_pages = []
|
||||
|
||||
|
||||
def register_page(page):
|
||||
"""registers extra networks page for the UI; recommend doing it in on_app_started() callback for extensions"""
|
||||
"""registers extra networks page for the UI; recommend doing it in on_before_ui() callback for extensions"""
|
||||
|
||||
extra_pages.append(page)
|
||||
|
||||
|
Reference in New Issue
Block a user