diff --git a/html/reference.json b/html/reference.json index e67014603..98ae6f630 100644 --- a/html/reference.json +++ b/html/reference.json @@ -3,22 +3,26 @@ "path": "dreamshaper_8.safetensors@https://civitai.com/api/download/models/128713", "desc": "Showcase finetuned model based on Stable diffusion 1.5", "preview": "dreamshaper_8.jpg", + "resolution": 512, "original": true }, "DreamShaper SD XL Turbo": { "path": "dreamshaperXL_turboDpmppSDE.safetensors@https://civitai.com/api/download/models/251662", "desc": "Showcase finetuned model based on Stable diffusion XL", + "resolution": 1024, "preview": "dreamshaperXL_turboDpmppSDE.jpg" }, "Juggernaut Reborn": { "path": "juggernaut_reborn.safetensors@https://civitai.com/api/download/models/274039", "desc": "Showcase finetuned model based on Stable diffusion 1.5", "preview": "juggernaut_reborn.jpg", + "resolution": 512, "original": true }, "Juggernaut XL v7 RunDiffusion": { "path": "juggernautXL_v7Rundiffusion.safetensors@https://civitai.com/api/download/models/240840", "desc": "Showcase finetuned model based on Stable diffusion XL", + "resolution": 1024, "preview": "juggernautXL_v7Rundiffusion.jpg" }, "RunwayML SD 1.5": { @@ -26,6 +30,7 @@ "alt": "v1-5-pruned-emaonly.safetensors@https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors?download=true", "desc": "Stable Diffusion 1.5 is the base model all other 1.5 checkpoint were trained from. It's a latent text-to-image diffusion model capable of generating photo-realistic images given any text input. The Stable-Diffusion-v1-5 checkpoint was initialized with the weights of the Stable-Diffusion-v1-2 checkpoint and subsequently fine-tuned on 595k steps at resolution 512x512.", "preview": "runwayml--stable-diffusion-v1-5.jpg", + "resolution": 512, "original": true }, "StabilityAI SD 2.1 EMA": { @@ -33,6 +38,7 @@ "alt": "v2-1_512-ema-pruned.safetensors@https://huggingface.co/stabilityai/stable-diffusion-2-1-base/resolve/main/v2-1_512-ema-pruned.safetensors?download=true", "desc": "This stable-diffusion-2-1-base model fine-tunes stable-diffusion-2-base (512-base-ema.ckpt) with 220k extra steps taken", "preview": "stabilityai--stable-diffusion-2.1-base.jpg", + "resolution": 512, "original": true }, "StabilityAI SD 2.1 V": { @@ -40,12 +46,15 @@ "alt": "v2-1_768-ema-pruned.safetensors@https://huggingface.co/stabilityai/stable-diffusion-2-1/resolve/main/v2-1_768-ema-pruned.safetensors?download=true", "desc": "This stable-diffusion-2 model is resumed from stable-diffusion-2-base (512-base-ema.ckpt) and trained for 150k steps using a v-objective on the same dataset. Resumed for another 140k steps on 768x768 images", "preview": "stabilityai--stable-diffusion-2.1-base.jpg", + "resolution": 768, "original": true }, "StabilityAI SD-XL 1.0 Base": { - "path": "stabilityai/stable-diffusion-xl-base-1.0", + "path": "huggingface/stabilityai/stable-diffusion-xl-base-1.0", + "skip": true, "variant": "fp16", "desc": "Stable Diffusion XL (SDXL) is the latest AI image generation model that is tailored towards more photorealistic outputs with more detailed imagery and composition compared to previous SD models, including SD 2.1. It can make realistic faces, legible text within the images, and better image composition, all while using shorter and simpler prompts at a greatly increased base resolution of 1024x1024. Just like its predecessors, SDXL has the ability to generate image variations using image-to-image prompting, inpainting (reimagining of the selected parts of an image), and outpainting (creating new parts that lie outside the image borders).", + "resolution": 1024, "preview": "stabilityai--stable-diffusion-xl-base-1.0.jpg" }, "StabilityAI SD 2.1 Turbo": { @@ -54,6 +63,7 @@ "variant": "fp16", "desc": "SD-Turbo is a distilled version of Stable Diffusion 2.1, trained for real-time synthesis. SD-Turbo is based on a novel training method called Adversarial Diffusion Distillation (ADD) (see the technical report), which allows sampling large-scale foundational image diffusion models in 1 to 4 steps at high image quality. This approach uses score distillation to leverage large-scale off-the-shelf image diffusion models as a teacher signal and combines this with an adversarial loss to ensure high image fidelity even in the low-step regime of one or two sampling steps.", "preview": "stabilityai--sd-turbo.jpg", + "resolution": 512, "original": true }, "StabilityAI SD-XL Turbo": { @@ -61,6 +71,7 @@ "path": "sdxl_turbo.safetensors@https://huggingface.co/stabilityai/sdxl-turbo/resolve/main/sd_xl_turbo_1.0_fp16.safetensors?download=true", "variant": "fp16", "desc": "SDXL-Turbo is a distilled version of SDXL 1.0, trained for real-time synthesis. SDXL-Turbo is based on a novel training method called Adversarial Diffusion Distillation (ADD) (see the technical report), which allows sampling large-scale foundational image diffusion models in 1 to 4 steps at high image quality. This approach uses score distillation to leverage large-scale off-the-shelf image diffusion models as a teacher signal and combines this with an adversarial loss to ensure high image fidelity even in the low-step regime of one or two sampling steps.", + "resolution": 1024, "preview": "stabilityai--sdxl-turbo.jpg" }, "StabilityAI Stable Video Diffusion": { @@ -77,116 +88,139 @@ "path": "huggingface/stabilityai/stable-cascade", "skip": true, "desc": "Stable Cascade is a diffusion model built upon the Würstchen architecture and its main difference to other models like Stable Diffusion is that it is working at a much smaller latent space. Why is this important? The smaller the latent space, the faster you can run inference and the cheaper the training becomes. How small is the latent space? Stable Diffusion uses a compression factor of 8, resulting in a 1024x1024 image being encoded to 128x128. Stable Cascade achieves a compression factor of 42, meaning that it is possible to encode a 1024x1024 image to 24x24, while maintaining crisp reconstructions. The text-conditional model is then trained in the highly compressed latent space. Previous versions of this architecture, achieved a 16x cost reduction over Stable Diffusion 1.5", + "resolution": 1024, "preview": "stabilityai--stable-cascade.jpg" }, "Segmind Vega": { "path": "segmind/Segmind-Vega", "desc": "The Segmind-Vega Model is a distilled version of the Stable Diffusion XL (SDXL), offering a remarkable 70% reduction in size and an impressive 100% speedup while retaining high-quality text-to-image generation capabilities. Trained on diverse datasets, including Grit and Midjourney scrape data, it excels at creating a wide range of visual content based on textual prompts. Employing a knowledge distillation strategy, Segmind-Vega leverages the teachings of several expert models, including SDXL, ZavyChromaXL, and JuggernautXL, to combine their strengths and produce compelling visual outputs.", + "resolution": 1024, "preview": "segmind--Segmind-Vega.jpg" }, "Segmind SSD-1B": { "path": "segmind/SSD-1B", "desc": "The Segmind Stable Diffusion Model (SSD-1B) offers a compact, efficient, and distilled version of the SDXL model. At 50% smaller and 60% faster than Stable Diffusion XL (SDXL), it provides quick and seamless performance without sacrificing image quality.", + "resolution": 1024, "preview": "segmind--SSD-1B.jpg" }, "Segmind Tiny": { "path": "segmind/tiny-sd", "desc": "Segmind's Tiny-SD offers a compact, efficient, and distilled version of Realistic Vision 4.0 and is up to 80% faster than SD1.5", + "resolution": 512, "preview": "segmind--tiny-sd.jpg" }, "Segmind SegMoE SD 4x2": { "path": "segmind/SegMoE-SD-4x2-v0", "desc": "SegMoE-SD-4x2-v0 is an untrained Segmind Mixture of Diffusion Experts Model generated using segmoe from 4 Expert SD1.5 models. SegMoE is a powerful framework for dynamically combining Stable Diffusion Models into a Mixture of Experts within minutes without training", + "resolution": 512, "preview": "segmind--SegMoE-SD-4x2-v0.jpg" }, "Segmind SegMoE XL 2x1": { "path": "segmind/SegMoE-2x1-v0", "desc": "SegMoE-2x1-v0 is an untrained Segmind Mixture of Diffusion Experts Model generated using segmoe from 2 Expert SDXL models. SegMoE is a powerful framework for dynamically combining Stable Diffusion Models into a Mixture of Experts within minutes without training", + "resolution": 1024, "preview": "segmind--SegMoE-2x1-v0.jpg" }, "Segmind SegMoE XL 4x2": { "path": "segmind/SegMoE-4x2-v0", "desc": "SegMoE-4x2-v0 is an untrained Segmind Mixture of Diffusion Experts Model generated using segmoe from 4 Expert SDXL models. SegMoE is a powerful framework for dynamically combining Stable Diffusion Models into a Mixture of Experts within minutes without training", + "resolution": 1024, "preview": "segmind--SegMoE-4x2-v0.jpg" }, "LCM SD-1.5 Dreamshaper 7": { "path": "SimianLuo/LCM_Dreamshaper_v7", "desc": "Latent Consistencey Models enable swift inference with minimal steps on any pre-trained LDMs, including Stable Diffusion. By distilling classifier-free guidance into the model's input, LCM can generate high-quality images in very short inference time. LCM can generate quality images in as few as 3-4 steps, making it blazingly fast.", + "resolution": 512, "preview": "SimianLuo--LCM_Dreamshaper_v7.jpg" }, "Pixart-α XL 2 Medium 512": { "path": "PixArt-alpha/PixArt-XL-2-512x512", "desc": "PixArt-α is a Transformer-based T2I diffusion model whose image generation quality is competitive with state-of-the-art image generators (e.g., Imagen, SDXL, and even Midjourney), and the training speed markedly surpasses existing large-scale T2I models. Extensive experiments demonstrate that PIXART-α excels in image quality, artistry, and semantic control. It can directly generate 512px images from text prompts within a single sampling process.", + "resolution": 512, "preview": "PixArt-alpha--PixArt-XL-2-512x512.jpg" }, "Pixart-α XL 2 Large 1024": { "path": "PixArt-alpha/PixArt-XL-2-1024-MS", "desc": "PixArt-α is a Transformer-based T2I diffusion model whose image generation quality is competitive with state-of-the-art image generators (e.g., Imagen, SDXL, and even Midjourney), and the training speed markedly surpasses existing large-scale T2I models. Extensive experiments demonstrate that PIXART-α excels in image quality, artistry, and semantic control. It can directly generate 1024px images from text prompts within a single sampling process.", + "resolution": 1024, "preview": "PixArt-alpha--PixArt-XL-2-1024-MS.jpg" }, "Pixart-α XL 2 Large LCM": { "path": "PixArt-alpha/PixArt-LCM-XL-2-1024-MS", "desc": "Pixart-α consists of pure transformer blocks for latent diffusion: It can directly generate 1024px images from text prompts within a single sampling process. LCMs is a diffusion distillation method which predict PF-ODE's solution directly in latent space, achieving super fast inference with few steps. Following LCM LoRA, we illustrative of the generation speed we achieve on various computers. Let us stress again how liberating it is to explore image generation so easily with PixArt-LCM.", + "resolution": 1024, "preview": "PixArt-alpha--PixArt-XL-2-1024-MS.jpg" }, "Warp Wuerstchen": { "path": "warp-ai/wuerstchen", "desc": "Würstchen is a diffusion model whose text-conditional model works in a highly compressed latent space of images. Why is this important? Compressing data can reduce computational costs for both training and inference by magnitudes. Training on 1024x1024 images, is way more expensive than training at 32x32. Usually, other works make use of a relatively small compression, in the range of 4x - 8x spatial compression. Würstchen takes this to an extreme. Through its novel design, we achieve a 42x spatial compression. Würstchen employs a two-stage compression, what we call Stage A and Stage B. Stage A is a VQGAN, and Stage B is a Diffusion Autoencoder (more details can be found in the paper). A third model, Stage C, is learned in that highly compressed latent space. This training requires fractions of the compute used for current top-performing models, allowing also cheaper and faster inference.", + "resolution": 1024, "preview": "warp-ai--wuerstchen.jpg" }, "Kandinsky 2.1": { "path": "kandinsky-community/kandinsky-2-1", "desc": "Kandinsky 2.1 is a text-conditional diffusion model based on unCLIP and latent diffusion, composed of a transformer-based image prior model, a unet diffusion model, and a decoder. Kandinsky 2.1 inherits best practices from Dall-E 2 and Latent diffusion while introducing some new ideas. It uses the CLIP model as a text and image encoder, and diffusion image prior (mapping) between latent spaces of CLIP modalities. This approach increases the visual performance of the model and unveils new horizons in blending images and text-guided image manipulation.", + "resolution": 768, "preview": "kandinsky-community--kandinsky-2-1.jpg" }, "Kandinsky 2.2": { "path": "kandinsky-community/kandinsky-2-2-decoder", "desc": "Kandinsky 2.2 is a text-conditional diffusion model (+0.1!) based on unCLIP and latent diffusion, composed of a transformer-based image prior model, a unet diffusion model, and a decoder. Kandinsky 2.1 inherits best practices from Dall-E 2 and Latent diffusion while introducing some new ideas. It uses the CLIP model as a text and image encoder, and diffusion image prior (mapping) between latent spaces of CLIP modalities. This approach increases the visual performance of the model and unveils new horizons in blending images and text-guided image manipulation.", + "resolution": 768, "preview": "kandinsky-community--kandinsky-2-2-decoder.jpg" }, "Kandinsky 3": { "path": "kandinsky-community/kandinsky-3", "desc": "Kandinsky 3.0 is an open-source text-to-image diffusion model built upon the Kandinsky2-x model family. In comparison to its predecessors, Kandinsky 3.0 incorporates more data and specifically related to Russian culture, which allows to generate pictures related to Russin culture. Furthermore, enhancements have been made to the text understanding and visual quality of the model, achieved by increasing the size of the text encoder and Diffusion U-Net models, respectively.", + "resolution": 1024, "preview": "kandinsky-community--kandinsky-3.jpg" }, "Playground v1": { "path": "playgroundai/playground-v1", "desc": "Playground v1 is a latent diffusion model that improves the overall HDR quality to get more stunning images.", + "resolution": 512, "preview": "playgroundai--playground-v1.jpg" }, "Playground v2 256": { "path": "playgroundai/playground-v2-256px-base", "desc": "Playground v2 is a diffusion-based text-to-image generative model. The model was trained from scratch by the research team at Playground. Images generated by Playground v2 are favored 2.5 times more than those produced by Stable Diffusion XL, according to Playground’s user study.", + "resolution": 256, "preview": "playgroundai--playground-v2-256px-base.jpg" }, "Playground v2 512": { "path": "playgroundai/playground-v2-512px-base", "desc": "Playground v2 is a diffusion-based text-to-image generative model. The model was trained from scratch by the research team at Playground. Images generated by Playground v2 are favored 2.5 times more than those produced by Stable Diffusion XL, according to Playground’s user study.", + "resolution": 512, "preview": "playgroundai--playground-v2-512px-base.jpg" }, "Playground v2 1024": { "path": "playgroundai/playground-v2-1024px-aesthetic", "desc": "Playground v2 is a diffusion-based text-to-image generative model. The model was trained from scratch by the research team at Playground. Images generated by Playground v2 are favored 2.5 times more than those produced by Stable Diffusion XL, according to Playground’s user study.", + "resolution": 1024, "preview": "playgroundai--playground-v2-1024px-aesthetic.jpg" }, "Playground v2.5": { "path": "playground-v2.5-1024px-aesthetic.fp16.safetensors@https://huggingface.co/playgroundai/playground-v2.5-1024px-aesthetic/resolve/main/playground-v2.5-1024px-aesthetic.fp16.safetensors?download=true", "desc": "Playground v2.5 is a diffusion-based text-to-image generative model, and a successor to Playground v2. Playground v2.5 is the state-of-the-art open-source model in aesthetic quality. Our user studies demonstrate that our model outperforms SDXL, Playground v2, PixArt-α, DALL-E 3, and Midjourney 5.2.", + "resolution": 1024, "preview": "playgroundai--playground-v2-1024px-aesthetic.jpg" }, "DeepFloyd IF Medium": { "path": "DeepFloyd/IF-I-M-v1.0", "desc": "DeepFloyd-IF is a pixel-based text-to-image triple-cascaded diffusion model, that can generate pictures with new state-of-the-art for photorealism and language understanding. The result is a highly efficient model that outperforms current state-of-the-art models, achieving a zero-shot FID-30K score of 6.66 on the COCO dataset. It is modular and composed of frozen text mode and three pixel cascaded diffusion modules, each designed to generate images of increasing resolution: 64x64, 256x256, and 1024x1024.", + "resolution": 1024, "preview": "DeepFloyd--IF-I-M-v1.0.jpg" }, "aMUSEd 256": { "path": "amused/amused-256", "desc": "Amused is a lightweight text to image model based off of the muse architecture. Amused is particularly useful in applications that require a lightweight and fast model such as generating many images quickly at once.", + "resolution": 256, "preview": "amused--amused-256.jpg" }, "aMUSEd 512": { "path": "amused/amused-512", "desc": "Amused is a lightweight text to image model based off of the muse architecture. Amused is particularly useful in applications that require a lightweight and fast model such as generating many images quickly at once.", + "resolution": 512, "preview": "amused--amused-512.jpg" }, "KOALA 700M": { @@ -194,12 +228,13 @@ "variant": "fp16", "skip": true, "desc": "Fast text-to-image model, called KOALA, by compressing SDXL's U-Net and distilling knowledge from SDXL into our model. KOALA-700M can generate a 1024x1024 image in less than 1.5 seconds on an NVIDIA 4090 GPU, which is more than 2x faster than SDXL.", + "resolution": 1024, "preview": "etri-vilab--koala-700m-llava-cap.jpg" }, - "Tsinghua UniDiffuser": { "path": "thu-ml/unidiffuser-v1", "desc": "UniDiffuser is a unified diffusion framework to fit all distributions relevant to a set of multi-modal data in one transformer. UniDiffuser is able to perform image, text, text-to-image, image-to-text, and image-text pair generation by setting proper timesteps without additional overhead.\nSpecifically, UniDiffuser employs a variation of transformer, called U-ViT, which parameterizes the joint noise prediction network. Other components perform as encoders and decoders of different modalities, including a pretrained image autoencoder from Stable Diffusion, a pretrained image ViT-B/32 CLIP encoder, a pretrained text ViT-L CLIP encoder, and a GPT-2 text decoder finetuned by ourselves.", + "resolution": 512, "preview": "thu-ml--unidiffuser-v1.jpg" }, "SalesForce BLIP-Diffusion": { @@ -210,6 +245,7 @@ "InstaFlow 0.9B": { "path": "XCLiu/instaflow_0_9B_from_sd_1_5", "desc": "InstaFlow is an ultra-fast, one-step image generator that achieves image quality close to Stable Diffusion. This efficiency is made possible through a recent Rectified Flow technique, which trains probability flows with straight trajectories, hence inherently requiring only a single step for fast inference.", + "resolution": 512, "preview": "XCLiu--instaflow_0_9B_from_sd_1_5.jpg" } } \ No newline at end of file diff --git a/installer.py b/installer.py index 5a105db90..8f9b8edc6 100644 --- a/installer.py +++ b/installer.py @@ -637,7 +637,7 @@ def check_torch(): if 'xformers' in xformers_package: install(f'--no-deps {xformers_package}', ignore=True) import torch - import xformers + import xformers # pylint: disable=unused-import elif not args.experimental and not args.use_xformers: uninstall('xformers') except Exception as e: diff --git a/modules/modelloader.py b/modules/modelloader.py index 91cedbf83..99fb4a33b 100644 --- a/modules/modelloader.py +++ b/modules/modelloader.py @@ -87,7 +87,7 @@ def download_civit_model_thread(model_name, model_url, model_path, model_type, p model_file = os.path.join(shared.opts.ckpt_dir, model_path, model_name) temp_file = os.path.join(shared.opts.ckpt_dir, model_path, temp_file) - res = f'CivitAI download: name="{model_name}" url="{model_url}" path="{model_path}" temp="{temp_file}"' + res = f'Model download: name="{model_name}" url="{model_url}" path="{model_path}" temp="{temp_file}"' if os.path.isfile(model_file): res += ' already exists' shared.log.warning(res) @@ -144,7 +144,7 @@ def download_civit_model(model_url: str, model_name: str, model_path: str, model import threading thread = threading.Thread(target=download_civit_model_thread, args=(model_name, model_url, model_path, model_type, preview, token)) thread.start() - return f'CivitAI download: name={model_name} url={model_url} path={model_path}' + return f'Model download: name={model_name} url={model_url} path={model_path}' def download_diffusers_model(hub_id: str, cache_dir: str = None, download_config: Dict[str, str] = None, token = None, variant = None, revision = None, mirror = None, custom_pipeline = None): @@ -215,60 +215,47 @@ def download_diffusers_model(hub_id: str, cache_dir: str = None, download_config return pipeline_dir -def load_diffusers_models(model_path: str, command_path: str = None, clear=True): +def load_diffusers_models(clear=True): excluded_models = [ 'PhotoMaker', 'inswapper_128', 'IP-Adapter' ] t0 = time.time() - places = [] - places.append(model_path) - if command_path is not None and command_path != model_path: - places.append(command_path) + place = shared.opts.diffusers_dir + if place is None or len(place) == 0 or not os.path.isdir(place): + place = os.path.join(models_path, 'Diffusers') if clear: diffuser_repos.clear() output = [] - for place in places: - if not os.path.isdir(place): - continue - try: - """ - import huggingface_hub as hf - res = hf.scan_cache_dir(cache_dir=place) - for r in list(res.repos): - cache_path = os.path.join(r.repo_path, "snapshots", list(r.revisions)[-1].commit_hash) - diffuser_repos.append({ 'name': r.repo_id, 'filename': r.repo_id, 'path': cache_path, 'size': r.size_on_disk, 'mtime': r.last_modified, 'hash': list(r.revisions)[-1].commit_hash, 'model_info': str(os.path.join(cache_path, "model_info.json")) }) - if not os.path.isfile(os.path.join(cache_path, "hidden")): - output.append(str(r.repo_id)) - """ - for folder in os.listdir(place): - try: - if any([x in folder for x in excluded_models]): # noqa:C419 - continue - if "--" not in folder: - continue - if folder.endswith("-prior"): - continue - _, name = folder.split("--", maxsplit=1) - name = name.replace("--", "/") - folder = os.path.join(place, folder) - friendly = os.path.join(place, name) - snapshots = os.listdir(os.path.join(folder, "snapshots")) - if len(snapshots) == 0: - shared.log.warning(f"Diffusers folder has no snapshots: location={place} folder={folder} name={name}") - continue - commit = os.path.join(folder, 'snapshots', snapshots[-1]) - mtime = os.path.getmtime(commit) - info = os.path.join(commit, "model_info.json") - diffuser_repos.append({ 'name': name, 'filename': name, 'friendly': friendly, 'folder': folder, 'path': commit, 'hash': commit, 'mtime': mtime, 'model_info': info }) - if os.path.exists(os.path.join(folder, 'hidden')): - continue - output.append(name) - except Exception: - # shared.log.error(f"Error analyzing diffusers model: {folder} {e}") - pass - except Exception as e: - shared.log.error(f"Error listing diffusers: {place} {e}") - shared.log.debug(f'Scanning diffusers cache: {places} items={len(output)} time={time.time()-t0:.2f}') + try: + for folder in os.listdir(place): + try: + if any([x in folder for x in excluded_models]): # noqa:C419 + continue + if "--" not in folder: + continue + if folder.endswith("-prior"): + continue + _, name = folder.split("--", maxsplit=1) + name = name.replace("--", "/") + folder = os.path.join(place, folder) + friendly = os.path.join(place, name) + snapshots = os.listdir(os.path.join(folder, "snapshots")) + if len(snapshots) == 0: + shared.log.warning(f"Diffusers folder has no snapshots: location={place} folder={folder} name={name}") + continue + commit = os.path.join(folder, 'snapshots', snapshots[-1]) + mtime = os.path.getmtime(commit) + info = os.path.join(commit, "model_info.json") + diffuser_repos.append({ 'name': name, 'filename': name, 'friendly': friendly, 'folder': folder, 'path': commit, 'hash': commit, 'mtime': mtime, 'model_info': info }) + if os.path.exists(os.path.join(folder, 'hidden')): + continue + output.append(name) + except Exception: + # shared.log.error(f"Error analyzing diffusers model: {folder} {e}") + pass + except Exception as e: + shared.log.error(f"Error listing diffusers: {place} {e}") + shared.log.debug(f'Scanning diffusers cache: folder={place} items={len(output)} time={time.time()-t0:.2f}') return output diff --git a/modules/sd_models.py b/modules/sd_models.py index faa95d513..7a5696f6b 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -23,7 +23,6 @@ from ldm.util import instantiate_from_config from modules import paths, shared, shared_items, shared_state, modelloader, devices, script_callbacks, sd_vae, errors, hashes, sd_models_config, sd_models_compile, sd_hijack_accelerate from modules.timer import Timer from modules.memstats import memory_stats -from modules.paths import models_path, script_path from modules.modeldata import model_data @@ -48,7 +47,7 @@ class CheckpointInfo: self.filename = filename self.type = '' relname = filename - app_path = os.path.abspath(script_path) + app_path = os.path.abspath(paths.script_path) def rel(fn, path): try: @@ -64,8 +63,8 @@ class CheckpointInfo: relname = rel(filename, shared.opts.diffusers_dir) elif relname.startswith(model_path): relname = rel(filename, model_path) - elif relname.startswith(script_path): - relname = rel(filename, script_path) + elif relname.startswith(paths.script_path): + relname = rel(filename, paths.script_path) elif relname.startswith(app_path): relname = rel(filename, app_path) else: @@ -147,7 +146,7 @@ def list_models(): ext_filter = [".ckpt", ".safetensors"] model_list = list(modelloader.load_models(model_path=model_path, model_url=None, command_path=shared.opts.ckpt_dir, ext_filter=ext_filter, download_name=None, ext_blacklist=[".vae.ckpt", ".vae.safetensors"])) if shared.backend == shared.Backend.DIFFUSERS: - model_list += modelloader.load_diffusers_models(model_path=os.path.join(models_path, 'Diffusers'), command_path=shared.opts.diffusers_dir, clear=True) + model_list += modelloader.load_diffusers_models(clear=True) for filename in sorted(model_list, key=str.lower): checkpoint_info = CheckpointInfo(filename) if checkpoint_info.name is not None: diff --git a/modules/upscaler.py b/modules/upscaler.py index 70e61384e..2f66c5d34 100644 --- a/modules/upscaler.py +++ b/modules/upscaler.py @@ -218,7 +218,11 @@ def compile_upscaler(model): if "Upscaler" in shared.opts.cuda_compile and shared.opts.cuda_compile_backend != 'none': import torch._dynamo # pylint: disable=unused-import,redefined-outer-name torch._dynamo.reset() # pylint: disable=protected-access - shared.log.debug(f"Upscaler compile available backends: {torch._dynamo.list_backends()}") # pylint: disable=protected-access + if shared.opts.cuda_compile_backend not in torch._dynamo.list_backends(): # pylint: disable=protected-access + shared.log.warning(f"Upscaler compile not available: backend={shared.opts.cuda_compile_backend} available={torch._dynamo.list_backends()}") # pylint: disable=protected-access + return model + else: + shared.log.info(f"Upscaler compile: backend={shared.opts.cuda_compile_backend} available={torch._dynamo.list_backends()}") # pylint: disable=protected-access if shared.opts.cuda_compile_backend == "openvino_fx": from modules.intel.openvino import openvino_fx # pylint: disable=unused-import @@ -241,11 +245,8 @@ def compile_upscaler(model): shared.log.error(f"Torch inductor config error: {e}") t0 = time.time() - model = torch.compile(model, mode=shared.opts.cuda_compile_mode, backend=shared.opts.cuda_compile_backend, fullgraph=shared.opts.cuda_compile_fullgraph) # pylint: disable=attribute-defined-outside-init - setup_logging() # compile messes with logging so reset is needed - t1 = time.time() shared.log.info(f"Upscaler compile: time={t1-t0:.2f}") except Exception as e: diff --git a/scripts/stablevideodiffusion.py b/scripts/stablevideodiffusion.py index 80a20cf45..76ec4e9af 100644 --- a/scripts/stablevideodiffusion.py +++ b/scripts/stablevideodiffusion.py @@ -62,9 +62,7 @@ class Script(scripts.Script): p.do_not_save_grid = True if c == 'StableVideoDiffusionPipeline': p.sampler_name = 'Default' # svd does not support non-default sampler - p.task_args['output_type'] = 'np' - else: - p.task_args['output_type'] = 'pil' + p.task_args['output_type'] = 'pil' p.task_args['generator'] = torch.manual_seed(p.seed) # svd does not support gpu based generator p.task_args['width'] = p.width p.task_args['height'] = p.height