Lucida
Lucida is a BiRefNet-based background-removal / image-matting model fine-tuned to excel where most open models fail: camouflaged objects, transparent materials (glass), text & logos, VFX glows, and illustrations —...
Fuente del modelo
- Tipo
- VAE
- Tamaño del archivo
- 844 MB
- Modelo base
- ZhengPeng7/BiRefNet_HR
- Versión
- vmodel
- Actualizado
- 9 oct 2026
- Fuente
- Hugging Face
Descripción de la fuente
Lucida — general-purpose background removal with soft-alpha mastery
Lucida is a BiRefNet-based background-removal / image-matting model fine-tuned to excel where most open models fail: camouflaged objects, transparent materials (glass), text & logos, VFX glows, and illustrations — while staying competitive everywhere else.
On our 203-image, 9-category benchmark (MAE, lower is better) Lucida leads every model we tested — including a commercial reference — in camouflage (0.0270) and illustration (0.0092), beats the commercial reference in text/logo preservation (0.0091 vs 0.0123) and in print-design/sticker art (0.0235 — 2x better than every model measured), and sets our best-ever transparency-in-mixed-objects handling and overall (0.0257) score — ahead of every model we measured, specialist or commercial, on the 203-image average. Full benchmark, gallery and training recipe: https://github.com/egeorcun/lucida — or try the live demo.
Changelog note (2026-07-24): an experimental v13 build was published for a day and then reverted — community testing showed it regressed on real-world layered artwork (poster/collage-style illustrations) that our synthetic design test set does not cover. The current weights are the proven v7. The v13 improvements (reduced background haze on real photos, a transparency milestone) will return in v14 together with the fix.
Usage
import torch
from PIL import Image
from torchvision import transforms
from transformers import AutoModelForImageSegmentation
model = AutoModelForImageSegmentation.from_pretrained(
"egeorcun/lucida", trust_remote_code=True, dtype=torch.float32)
model.eval()
t = transforms.Compose([
transforms.Resize((1024, 1024)),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]),
])
img = Image.open("input.jpg").convert("RGB")
with torch.no_grad():
preds = model(t(img).unsqueeze(0))[-1].sigmoid()
alpha = transforms.functional.resize(preds[0], img.size[::-1]).squeeze(0)
rgba = img.copy()
rgba.putalpha(Image.fromarray((alpha.numpy() * 255).astype("uint8")))
rgba.save("output.png")
For color decontamination (removing background color fringing) and the full pipeline (CLI, FastAPI service, Docker web UI), see the GitHub repository.
Base model & attribution
- Architecture and initial weights: ZhengPeng7/BiRefNet_HR (MIT). Lucida is a fine-tune; the original copyright notice is preserved.
- Illustration data includes ToonOut (CC-BY 4.0).
- Some training datasets (e.g. P3M-10k, COD10K, DIS5K) are distributed for research purposes; see the GitHub README for the full dataset/license table and evaluate suitability for your use case.
License
MIT (weights and code).
Fuentes
1 fuente
Fuentes
1 fuenteVerificado 12 sept
Artefactos del modelo
1 artefacto
Artefactos del modelo
1 artefactoExtractos de fuentes
3 extractos
Extractos de fuentes
3 extractos--- license: mit pipeline_tag: image-segmentation base_model: ZhengPeng7/BiRefNet_HR datasets: - joelseytre/toonout tags: - background-removal - image-matting - BiRefNet - transparency - camouflage - text-preservation - illustration - rgba library_name: transformers --- # Lucida — general-purpose background removal with soft-alpha mastery Lucida is a BiRefNet-based background-removal / image-matting model fine-tuned to excel where most open models fail: **camouflaged objects, transparent materials (glass), text & logos, VFX glows, and illustrations** — while staying competitive everywhere else. On our 203-image, 9-category benchmark (MAE, lower is better) Lucida leads every model we tested — including a commercial reference — in **camouflage (0.0270)** and **illustration (0.0092)**, beats the commercial reference in **text/logo preservation (0.0091 vs 0.0123)** and in **print-design/sticker art (0.0235 — 2x better than every model measured)**, and sets our best-ever **transparency-in-mixed-objects** handling and **overall (0.0257)** score — ahead of every model we measured, specialist or commercial, on the 203-image average. Full benchmark, gallery and training recipe: **https://github.com/egeorcun/lucida** — or try the [live demo](https://huggingface.co/spaces/egeorcun/lucida-demo). > **Changelog note (2026-07-24):** an experimental v13 build was published for a day and then > reverted — community testing showed it regressed on real-world layered artwork > (poster/collage-style illustrations) that our synthetic design test set does not cover. > The current weights are the proven v7. The v13 improvements (reduced background haze on > real photos, a transparency milestone) will return in v14 together with the fix. ## Files | File | What it is | Load with | |---|---|---| | `model.safetensors` | **lucida-v7** — the published general-purpose release; the snippet above and the benchmark table refer to this. | `transformers` (with `Normalize`) | | `lucida-m35-comfy.safetensors` | **lucida-m35 (experimental)** — the `design-expert` branch working model: a checkpoint blend of the v8–v13 background-purity soup with the v18 limb/atmosphere campaign (0.65/0.35), exported **folded** for ComfyUI: the `Normalize` preprocessing is baked into the first conv. | ComfyUI `RemoveBackground` node — **not** the `transformers` snippet (no `Normalize` at inference...
--- license: mit pipeline_tag: image-segmentation base_model: ZhengPeng7/BiRefNet_HR datasets: - joelseytre/toonout tags: - background-removal - image-matting - BiRefNet - transparency - camouflage - text-preservation - illustration - rgba library_name: transformers --- # Lucida — general-purpose background removal with soft-alpha mastery Lucida is a BiRefNet-based background-removal / image-matting model fine-tuned to excel where most open models fail: **camouflaged objects, transparent materials (glass), text & logos, VFX glows, and illustrations** — while staying competitive everywhere else. On our 203-image, 9-category benchmark (MAE, lower is better) Lucida leads every model we tested — including a commercial reference — in **camouflage (0.0270)** and **illustration (0.0092)**, beats the commercial reference in **text/logo preservation (0.0091 vs 0.0123)** and in **print-design/sticker art (0.0235 — 2x better than every model measured)**, and sets our best-ever **transparency-in-mixed-objects** handling and **overall (0.0257)** score — ahead of every model we measured, specialist or commercial, on the 203-image average. Full benchmark, gallery and training recipe: **https://github.com/egeorcun/lucida** — or try the [live demo](https://huggingface.co/spaces/egeorcun/lucida-demo). > **Changelog note (2026-07-24):** an experimental v13 build was published for a day and then > reverted — community testing showed it regressed on real-world layered artwork > (poster/collage-style illustrations) that our synthetic design test set does not cover. > The current weights are the proven v7. The v13 improvements (reduced background haze on > real photos, a transparency milestone) will return in v14 together with the fix. ## Usage ```python import torch from PIL import Image from torchvision import transforms from transformers import AutoModelForImageSegmentation model = AutoModelForImageSegmentation.from_pretrained( "egeorcun/lucida", trust_remote_code=True, dtype=torch.float32) model.eval() t = transforms.Compose([ transforms.Resize((1024, 1024)), transforms.ToTensor(), transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]), ]) img = Image.open("input.jpg").convert("RGB") with torch.no_grad(): preds = model(t(img).unsqueeze(0))[-1].sigmoid() alpha = transforms.functional.resize(preds[0], img.size[::-1]).squeeze(0) rgba = img.cop...
Source context: 6839 downloads · 52 likes · Pipeline image-segmentation · Library transformers · Repo egeorcun/lucida
