From 7831ee10db6de27cd2c883c6a6f1fd07c2a1d3bc Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Mon, 3 Feb 2025 09:08:36 -0500 Subject: [PATCH] remove-background: ben2 Signed-off-by: Vladimir Mandic --- CHANGELOG.md | 7 +++++-- extensions-builtin/stable-diffusion-webui-rembg | 2 +- modules/interrogate/vqa.py | 12 +++--------- modules/scripts_postprocessing.py | 4 ++-- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee8977538..6a0a200bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log for SD.Next -## Update for 2025-02-02 +## Update for 2025-02-03 - **GitHub** - rename core repo from to @@ -29,7 +29,10 @@ with detailed defaults for each model type also configurable - select between 150+ *OpenCLiP* supported models, 20+ built-in *VLMs*, *DeepDanbooru* - **VLM**: now that we can use VLMs freely, we've also added support for few more out-of-the-box - *Alibaba Qwen VL2*, *Huggingface Smol VL2*, *ToriiGate 0.4* + [Alibaba Qwen VL2](https://huggingface.co/Qwen/Qwen2-VL-2B), [Huggingface Smol VL2](HuggingFaceTB/SmolVLM-Instruct), [ToriiGate 0.4](Minthy/ToriiGate-v0.4-2B) +- **Postprocess** + - new sota remove background model: [BEN2](https://huggingface.co/PramaLLC/BEN2) + select in *process -> remove background* or enable postprocessing for txt2img/img2img operations - **Other**: - **networks**: imporove search/filter and add visual indicators for types - **balanced offload** new defaults: *lowvram/4gb min threshold: 0, medvram/8gb min threshold: 0, default min threshold 0.25* diff --git a/extensions-builtin/stable-diffusion-webui-rembg b/extensions-builtin/stable-diffusion-webui-rembg index 50bc931ce..067b227de 160000 --- a/extensions-builtin/stable-diffusion-webui-rembg +++ b/extensions-builtin/stable-diffusion-webui-rembg @@ -1 +1 @@ -Subproject commit 50bc931ce6715e30bb86da52033e01e98add4e6c +Subproject commit 067b227de15b69ff3fc12f9d1a2b1af2afe7ecdc diff --git a/modules/interrogate/vqa.py b/modules/interrogate/vqa.py index fe0dccbb8..c9ab34513 100644 --- a/modules/interrogate/vqa.py +++ b/modules/interrogate/vqa.py @@ -9,8 +9,8 @@ from PIL import Image from modules import shared, devices, errors # TODO add additional vlmn -# https://huggingface.co/nvidia/Eagle2-1B -# https://huggingface.co/deepseek-ai/deepseek-vl2-tiny +# https://huggingface.co/nvidia/Eagle2-1B not compatible with latest transformers +# https://huggingface.co/deepseek-ai/deepseek-vl2-tiny requires custom code processor = None @@ -35,7 +35,7 @@ vlm_models = { "Microsoft GIT TextCaps Base": "microsoft/git-base-textcaps", # 0.7GB "Microsoft GIT VQA Base": "microsoft/git-base-vqav2", # 0.7GB "Microsoft GIT VQA Large": "microsoft/git-large-vqav2", # 1.6GB - "ToriiGate 0.4 2B": "Minthy/ToriiGate-v0.4-2B", # TODO + "ToriiGate 0.4 2B": "Minthy/ToriiGate-v0.4-2B", "ViLT Base": "dandelin/vilt-b32-finetuned-vqa", # 0.5GB } vlm_prompts = [ @@ -122,10 +122,6 @@ def qwen(question: str, image: Image.Image, repo: str = None): return response -def deepseek(question: str, image: Image.Image, repo: str = None): - return '' - - def smol(question: str, image: Image.Image, repo: str = None): global processor, model, loaded # pylint: disable=global-statement if model is None or loaded != repo: @@ -347,8 +343,6 @@ def interrogate(question, image, model_name): answer = qwen(question, image, vqa_model) elif 'smol' in vqa_model.lower(): answer = smol(question, image, vqa_model) - elif 'deepseek' in vqa_model.lower(): - answer = deepseek(question, image, vqa_model) else: answer = 'unknown model' except Exception as e: diff --git a/modules/scripts_postprocessing.py b/modules/scripts_postprocessing.py index 3bb92b4b5..3afaf68d3 100644 --- a/modules/scripts_postprocessing.py +++ b/modules/scripts_postprocessing.py @@ -4,9 +4,9 @@ from modules import errors, shared class PostprocessedImage: - def __init__(self, image): + def __init__(self, image, info = {}): self.image = image - self.info = {} + self.info = info class ScriptPostprocessing: