remove-background: ben2

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-02-03 09:08:36 -05:00
parent e40b33d237
commit 7831ee10db
4 changed files with 11 additions and 14 deletions
+5 -2
View File
@@ -1,6 +1,6 @@
# Change Log for SD.Next
## Update for 2025-02-02
## Update for 2025-02-03
- **GitHub**
- rename core repo from <https://github.com/vladmandic/automatic> to <https://github.com/vladmandic/sdnext>
@@ -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*
+3 -9
View File
@@ -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:
+2 -2
View File
@@ -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: