api endpoint refresh vaes

This commit is contained in:
Vladimir Mandic
2023-07-26 15:51:19 -04:00
parent 15d5873f22
commit ff9b8bc062
5 changed files with 25 additions and 3 deletions
+15 -2
View File
@@ -2,6 +2,20 @@
## Update for 07/22/2023
This is a big one, new models, new diffusers, new features and updated UI...
First, **SD-XL 1.0** is released and yes, SD.Next supports it out of the box!
- [SD-XL Base](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0.safetensors)
- [SD-XL Refiner](https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0/blob/main/sd_xl_refiner_1.0.safetensors)
Also fresh is new **Kandinsky 2.2** model that does look quite nice:
- [Kandinsky Decoder](https://huggingface.co/kandinsky-community/kandinsky-2-2-decoder)
- [Kandinsky Prior](kandinsky-community/kandinsky-2-2-prior)
Actual changelog is:
- general:
- new loading screens and artwork
- major ui simplification for both txt2img and img2img
@@ -17,6 +31,7 @@
- fix hires secondary sampler
this now fully obsoletes `fallback_sampler` and `force_latent_sampler`
- diffusers:
- we're out of experimental phase and diffusers backend is considered stable
- implement img2img and inpainting (experimental)
actual support and qualiy depends on model
it works as expected for sd 1.5, but not so much for sd-xl for now
@@ -30,8 +45,6 @@
- sd-xl: loading vae now applies to both base and refiner and saves a bit of vram
- vae: enable loading of pure-safetensors vae files without config
also enable *automatic* selection to work with diffusers
- diffusers: future-proof
requires `diffusers==0.19.dev`, not yet released, but can be installed manually
- sd-xl: denoising_start/denoising_end
- sd-xl: enable dual prompts
dual prompt is used if set regardless if refiner is enabled/loaded
+5 -1
View File
@@ -132,6 +132,7 @@ class Api:
self.add_api_route("/sdapi/v1/prompt-styles", self.get_prompt_styles, methods=["GET"], response_model=List[models.PromptStyleItem])
self.add_api_route("/sdapi/v1/embeddings", self.get_embeddings, methods=["GET"], response_model=models.EmbeddingsResponse)
self.add_api_route("/sdapi/v1/refresh-checkpoints", self.refresh_checkpoints, methods=["POST"])
self.add_api_route("/sdapi/v1/refresh-vaes", self.refresh_vaes, methods=["POST"])
self.add_api_route("/sdapi/v1/create/embedding", self.create_embedding, methods=["POST"], response_model=models.CreateResponse)
self.add_api_route("/sdapi/v1/create/hypernetwork", self.create_hypernetwork, methods=["POST"], response_model=models.CreateResponse)
self.add_api_route("/sdapi/v1/preprocess", self.preprocess, methods=["POST"], response_model=models.PreprocessResponse)
@@ -498,7 +499,10 @@ class Api:
}
def refresh_checkpoints(self):
shared.refresh_checkpoints()
return shared.refresh_checkpoints()
def refresh_vaes(self):
return shared.refresh_vaes()
def create_embedding(self, args: dict):
try:
+1
View File
@@ -573,6 +573,7 @@ def change_backend():
checkpoints_loaded.clear()
from modules.sd_samplers import list_samplers
list_samplers(shared.backend)
list_models()
from modules.sd_vae import refresh_vae_list
refresh_vae_list()
+1
View File
@@ -99,6 +99,7 @@ def refresh_vae_list():
else:
vae_dict[name] = filepath
shared.log.info(f"Available VAEs: {vae_path} {len(vae_dict)}")
return vae_dict
def find_vae_near_checkpoint(checkpoint_file):
+3
View File
@@ -240,6 +240,9 @@ def refresh_checkpoints():
import modules.sd_models # pylint: disable=W0621
return modules.sd_models.list_models()
def refresh_vaes():
import modules.sd_vae # pylint: disable=W0621
modules.sd_vae.refresh_vae_list()
def list_samplers():
import modules.sd_samplers # pylint: disable=W0621