mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
cache script/extension info
This commit is contained in:
+13
-12
@@ -53,20 +53,20 @@ Upgrades are still possible and supported, but above is recommended for best exp
|
||||
- **Diffusers**:
|
||||
- better pipeline **auto-detect** when loading from safetensors
|
||||
- **SDXL Inpaint**
|
||||
- Although any model can be used for inpainiting, there is a case to be made for
|
||||
- although any model can be used for inpainiting, there is a case to be made for
|
||||
dedicated inpainting models as they are tuned to inpaint and not generate
|
||||
- Model can be used as base model for **img2img** or refiner model for **txt2img**
|
||||
- model can be used as base model for **img2img** or refiner model for **txt2img**
|
||||
To download go to *Models -> Huggingface*:
|
||||
- `diffusers/stable-diffusion-xl-1.0-inpainting-0.1` *(6.7GB)*
|
||||
- **SDXL Instruct-Pix2Pix**
|
||||
- Model can be used as base model for **img2img** or refiner model for **txt2img**
|
||||
This model is massive and requires a lot of resources!
|
||||
To download go to *Models -> Huggingface*:
|
||||
- model can be used as base model for **img2img** or refiner model for **txt2img**
|
||||
this model is massive and requires a lot of resources!
|
||||
to download go to *Models -> Huggingface*:
|
||||
- `diffusers/sdxl-instructpix2pix-768` *(11.9GB)*
|
||||
- **SD Latent Upscale**
|
||||
- You can use *SD Latent Upscale* models as **refiner models**
|
||||
This is a bit experimental, but it works quite well!
|
||||
To download go to *Models -> Huggingface*:
|
||||
- you can use *SD Latent Upscale* models as **refiner models**
|
||||
this is a bit experimental, but it works quite well!
|
||||
to download go to *Models -> Huggingface*:
|
||||
- `stabilityai/sd-x2-latent-upscaler` *(2.2GB)*
|
||||
- `stabilityai/stable-diffusion-x4-upscaler` *(1.7GB)*
|
||||
- better **Hires** support for SD and SDXL
|
||||
@@ -85,7 +85,7 @@ Upgrades are still possible and supported, but above is recommended for best exp
|
||||
**SwinIR** (2), **ESRGAN** (12), **RealESRGAN** (6), **SCUNet** (2)
|
||||
- two additional latent upscalers based on SD upscale models when using Diffusers backend
|
||||
**SD Upscale 2x**, **SD Upscale 4x***
|
||||
Note: Recommended usage for *SD Upscale* is by using second pass instead of upscaler
|
||||
note: Recommended usage for *SD Upscale* is by using second pass instead of upscaler
|
||||
as it allows for tuning of prompt, seed, sampler settings which are used to guide upscaler
|
||||
- upscalers are available in **xyz grid**
|
||||
- simplified *settings->postprocessing->upscalers*
|
||||
@@ -109,11 +109,11 @@ Upgrades are still possible and supported, but above is recommended for best exp
|
||||
combinations results in 50+ samplers which is not practical
|
||||
items such as algorithm (e.g. karras) is actually a sampler option, not a sampler itself
|
||||
- **CivitAI**:
|
||||
- CivitAI integration in *Models -> CivitAI* can now find most
|
||||
- civitai integration in *models -> civitai* can now find most
|
||||
previews AND metadata for most models (checkpoints, loras, embeddings)
|
||||
metadata is now parsed and saved in *[model].json*
|
||||
typical hit rate is >95% for models, loras and embeddings
|
||||
- Description from parsed model metadata is used as model description if there is no manual
|
||||
- description from parsed model metadata is used as model description if there is no manual
|
||||
description file present in format of *[model].txt*
|
||||
- to enable search, make sure all models have set hash values
|
||||
*Models -> Valida -> Calculate hashes*
|
||||
@@ -131,8 +131,9 @@ Upgrades are still possible and supported, but above is recommended for best exp
|
||||
see *settings -> compute -> gc*
|
||||
- **General**
|
||||
- **Startup**
|
||||
- All main CLI parameters can now be set as environment variable as well
|
||||
- all main CLI parameters can now be set as environment variable as well
|
||||
for example `--data-dir <path>` can be specified as `SD_DATADIR=<path>` before starting SD.Next
|
||||
- faster extensions loading
|
||||
- **Logging**
|
||||
- get browser session info in server log
|
||||
- allow custom log file destination
|
||||
|
||||
@@ -37,6 +37,7 @@ class Extension:
|
||||
self.have_info_from_repo = False
|
||||
self.mtime = 0
|
||||
self.ctime = 0
|
||||
self.script_files = []
|
||||
|
||||
def read_info_from_repo(self):
|
||||
if self.have_info_from_repo:
|
||||
@@ -74,18 +75,26 @@ class Extension:
|
||||
self.remote = None
|
||||
|
||||
def list_files(self, subdir, extension):
|
||||
if len(self.script_files) > 0:
|
||||
return self.script_files
|
||||
|
||||
from modules import scripts
|
||||
dirpath = os.path.join(self.path, subdir)
|
||||
if not os.path.isdir(dirpath):
|
||||
return []
|
||||
res = []
|
||||
for filename in sorted(os.listdir(dirpath)):
|
||||
if not filename.endswith(".py"):
|
||||
continue
|
||||
priority = '50'
|
||||
if os.path.isfile(os.path.join(dirpath, "..", ".priority")):
|
||||
with open(os.path.join(dirpath, "..", ".priority"), "r", encoding="utf-8") as f:
|
||||
priority = str(f.read().strip())
|
||||
res.append(scripts.ScriptFile(self.path, filename, os.path.join(dirpath, filename), priority))
|
||||
if priority != '50':
|
||||
shared.log.debug(f'Extension priority override: {os.path.dirname(dirpath)}:{priority}')
|
||||
res = [x for x in res if os.path.splitext(x.path)[1].lower() == extension and os.path.isfile(x.path)]
|
||||
self.script_files = res
|
||||
return res
|
||||
|
||||
def check_updates(self):
|
||||
|
||||
+5
-1
@@ -193,9 +193,11 @@ ScriptFile = namedtuple("ScriptFile", ["basedir", "filename", "path", "priority"
|
||||
scripts_data = []
|
||||
postprocessing_scripts_data = []
|
||||
ScriptClassData = namedtuple("ScriptClassData", ["script_class", "path", "basedir", "module"])
|
||||
|
||||
scripts_list_per_dir = {}
|
||||
|
||||
def list_scripts(scriptdirname, extension):
|
||||
if scriptdirname in scripts_list_per_dir:
|
||||
return scripts_list_per_dir[scriptdirname]
|
||||
tmp_list = []
|
||||
base = os.path.join(paths.script_path, scriptdirname)
|
||||
if os.path.exists(base):
|
||||
@@ -219,11 +221,13 @@ def list_scripts(scriptdirname, extension):
|
||||
if os.path.isfile(os.path.join(base, "..", ".priority")):
|
||||
with open(os.path.join(base, "..", ".priority"), "r", encoding="utf-8") as f:
|
||||
priority = priority + str(f.read().strip())
|
||||
log.debug(f'Script priority override: ${script.name}:{priority}')
|
||||
else:
|
||||
priority = priority + script.priority
|
||||
priority_list.append(ScriptFile(script.basedir, script.filename, script.path, priority))
|
||||
# log.debug(f'Adding script: {script.basedir} {script.filename} {script.path} {priority}')
|
||||
priority_sort = sorted(priority_list, key=lambda item: item.priority + item.path.lower(), reverse=False)
|
||||
scripts_list_per_dir[scriptdirname] = priority_sort
|
||||
return priority_sort
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user