mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-03 07:00:47 +08:00
df02498d03
split some code from ui.py into ui_settings.py ui_gradio_edxtensions.py add before_process callback for scripts add ability for alwayson scripts to specify section and let user reorder those sections
70 lines
1.4 KiB
Python
70 lines
1.4 KiB
Python
|
|
|
|
def realesrgan_models_names():
|
|
import modules.realesrgan_model
|
|
return [x.name for x in modules.realesrgan_model.get_realesrgan_models(None)]
|
|
|
|
|
|
def postprocessing_scripts():
|
|
import modules.scripts
|
|
|
|
return modules.scripts.scripts_postproc.scripts
|
|
|
|
|
|
def sd_vae_items():
|
|
import modules.sd_vae
|
|
|
|
return ["Automatic", "None"] + list(modules.sd_vae.vae_dict)
|
|
|
|
|
|
def refresh_vae_list():
|
|
import modules.sd_vae
|
|
|
|
modules.sd_vae.refresh_vae_list()
|
|
|
|
|
|
def cross_attention_optimizations():
|
|
import modules.sd_hijack
|
|
|
|
return ["Automatic"] + [x.title() for x in modules.sd_hijack.optimizers] + ["None"]
|
|
|
|
|
|
def sd_unet_items():
|
|
import modules.sd_unet
|
|
|
|
return ["Automatic"] + [x.label for x in modules.sd_unet.unet_options] + ["None"]
|
|
|
|
|
|
def refresh_unet_list():
|
|
import modules.sd_unet
|
|
|
|
modules.sd_unet.list_unets()
|
|
|
|
|
|
ui_reorder_categories_builtin_items = [
|
|
"inpaint",
|
|
"sampler",
|
|
"checkboxes",
|
|
"hires_fix",
|
|
"dimensions",
|
|
"cfg",
|
|
"seed",
|
|
"batch",
|
|
"override_settings",
|
|
]
|
|
|
|
|
|
def ui_reorder_categories():
|
|
from modules import scripts
|
|
|
|
yield from ui_reorder_categories_builtin_items
|
|
|
|
sections = {}
|
|
for script in scripts.scripts_txt2img.scripts + scripts.scripts_img2img.scripts:
|
|
if isinstance(script.section, str):
|
|
sections[script.section] = 1
|
|
|
|
yield from sections
|
|
|
|
yield "scripts"
|