From d6885a59ebd31f4e26b48bc00802b9716b45a66a Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Wed, 31 Jan 2024 16:02:29 -0500 Subject: [PATCH] post merge cleanup --- CHANGELOG.md | 13 +++++++++---- extensions-builtin/sd-extension-system-info | 2 +- modules/sd_models.py | 9 ++++++++- modules/shared_items.py | 5 +---- wiki | 2 +- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16d047321..3d3243cb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ Another big release, highlights being: - Brand new **Intelligent masking**, manual or automatic Using ML models (*LAMA* object removal, *REMBG* background removal, *SAM* segmentation, etc.) and with live previews Granular blur, erode and dilate controls +- Massive work integrating latest advances with **OpenVINO**, **IPEX** and **Olive** +- New models and pipelines: *Mixture Tiling, SAG, InstaFlow, BlipDiffusion* Plus welcome additions to **UI performance, usability and accessibility** and flexibility of deployment And it also includes fixes for all reported issues so far @@ -126,15 +128,15 @@ As of this release, default backend is set to **diffusers** as its more feature - [FreeInit](https://tianxingwu.github.io/pages/FreeInit/) for **AnimateDiff** - greatly improves temporal consistency of generated outputs - all options are available in animateddiff script -- [SalesForce BlipDiffusion](https://huggingface.co/docs/diffusers/api/pipelines/blip_diffusion) +- [SalesForce BlipDiffusion](https://huggingface.co/docs/diffusers/api/pipelines/blip_diffusion) - model can be used to place subject in a different context - requires input image - - last word in prompt and negative prompt will be used as source and target subjects + - last word in prompt and negative prompt will be used as source and target subjects - sampler must be set to default before loading the model - [InstaFlow](https://github.com/gnobitab/InstaFlow) - another take on super-fast image generation in a single step - - set sampler:default steps:1 - - load from networks -> models -> reference + - set *sampler:default, steps:1, cfg-scale:0* + - load from networks -> models -> reference - **Improvements** - **ui** - check version and **update** SD.Next via UI @@ -244,6 +246,9 @@ As of this release, default backend is set to **diffusers** as its more feature - remove `OPENVINO_TORCH_BACKEND_DEVICE` env variable - reduce system memory usage after compile - fix cache loading with multiple models +- **Olive** support, thanks @lshqqytiger + - fully merged in in [wiki](https://github.com/vladmandic/automatic/wiki/ONNX-Olive) , see wiki for details, thanks @lshqqytiger + - as a highlight, 4-5 it/s using DirectML on AMD GPU translates to 23-25 it/s using ONNX/Olive! - **fixes** - civitai model download: enable downloads of embeddings - ipadapter: allow changing of model/image on-the-fly diff --git a/extensions-builtin/sd-extension-system-info b/extensions-builtin/sd-extension-system-info index 8046b1544..72d871b45 160000 --- a/extensions-builtin/sd-extension-system-info +++ b/extensions-builtin/sd-extension-system-info @@ -1 +1 @@ -Subproject commit 8046b1544513cea06d1c41748c22727c930323ab +Subproject commit 72d871b4567c228c30c8eb2cd26db653065f6fc7 diff --git a/modules/sd_models.py b/modules/sd_models.py index ba3aebd7b..9e4937690 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -790,7 +790,14 @@ def load_diffuser(checkpoint_info=None, already_loaded_state_dict=None, timer=No shared.log.debug(f'Diffusers loading: path="{checkpoint_info.path}"') pipeline, model_type = detect_pipeline(checkpoint_info.path, op) if os.path.isdir(checkpoint_info.path): - if model_type in ['InstaFlow'] or 'ONNX' in model_type: # forced pipeline + if model_type in ['InstaFlow']: # forced pipeline + try: + pipeline = diffusers.utils.get_class_from_dynamic_module('instaflow_one_step', module_file='pipeline.py') + sd_model = pipeline.from_pretrained(checkpoint_info.path, cache_dir=shared.opts.diffusers_dir, **diffusers_load_config) + except Exception as e: + shared.log.error(f'Diffusers Failed loading {op}: {checkpoint_info.path} {e}') + return + elif 'ONNX' in model_type: # forced pipeline sd_model = pipeline.from_pretrained(checkpoint_info.path, cache_dir=shared.opts.diffusers_dir, **diffusers_load_config) else: err1, err2, err3 = None, None, None diff --git a/modules/shared_items.py b/modules/shared_items.py index e5122fedc..71487bfe0 100644 --- a/modules/shared_items.py +++ b/modules/shared_items.py @@ -56,12 +56,9 @@ def get_pipelines(): 'ONNX Stable Diffusion XL': getattr(diffusers, 'OnnxStableDiffusionXLPipeline', None), 'ONNX Stable Diffusion XL Img2Img': getattr(diffusers, 'OnnxStableDiffusionXLImg2ImgPipeline', None), 'Custom Diffusers Pipeline': getattr(diffusers, 'DiffusionPipeline', None), + 'InstaFlow': getattr(diffusers, 'StableDiffusionPipeline', None) # dynamically redefined and loaded in sd_models.load_diffuser # Segmind SSD-1B, Segmind Tiny } - try: - pipelines['InstaFlow'] = diffusers.utils.get_class_from_dynamic_module('instaflow_one_step', module_file='pipeline.py') - except Exception: - pipelines['InstaFlow'] = getattr(diffusers, 'StableDiffusionPipeline', None) for k, v in pipelines.items(): if k != 'Autodetect' and v is None: diff --git a/wiki b/wiki index 9b4632d98..ef4c3bd5c 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 9b4632d9841571b1ed12b0af3f68e7987cbf594b +Subproject commit ef4c3bd5c78eeba58e24b4ba2184e413064c6b13