HuggingFace镜像/Fibo-Edit-RMBG
模型介绍文件和版本分析
下载使用量0

GitHub 仓库   Hugging Face 演示   Bria 平台   Bria Discord

Fibo-Edit-RMBG:由 Fibo-Edit 驱动的专业背景移除工具
这是 Fibo-Edit 的一个微调版本,专门用于高质量的背景移除。基于 Fibo 的基础构建,Fibo-Edit-RMBG 在处理复杂前景、保留精细细节以及应对具有挑战性的图像类型方面表现出色。

🌍 什么是 Fibo-Edit-RMBG?

Fibo-Edit-RMBG 是 Fibo-Edit 模型的一个专门微调版本,专门针对背景移除任务进行了优化。Fibo-Edit-RMBG 利用强大的 Fibo-Edit 架构,提供了最先进的结果。

📄 技术报告即将发布。 有关架构详情,请参见 FIBO 和 Fibo-Edit。

🖼️ 视觉示例

🔑 主要特性

  • 精细结构 Alpha 抠图:生成清晰、精确的 alpha 蒙版,在高频边缘区域(包括发丝、网眼、金属丝结构以及类似的复杂边界)准确估计不透明度。
  • 一致的主体蒙版:在前景主体的整个范围内生成更完整、更明确的蒙版,减少区域被错误地分割为前景和背景的情况。
  • 低深度线索场景中的前景-背景分离:更好地处理前景边界没有通过深度很好定义的图像,例如平面插图、图形合成以及带有叠加文本的图像。

⚡ 快速开始

源代码与权重

  • 该模型开源供非商业使用,遵循 此许可证
  • 商业用途请 点击此处。

安装

安装所需的依赖项:

pip install diffusers transformers accelerate torch pillow

使用方法

基本背景移除

import torch
from diffusers import BriaFiboEditPipeline
from PIL import Image

# Load the Fibo-Edit-RMBG model
pipe = BriaFiboEditPipeline.from_pretrained(
    "briaai/Fibo-Edit-RMBG",
    torch_dtype=torch.bfloat16,
)
pipe.to("cuda")

# Load your image
image = Image.open("photo.jpg").convert("RGB")

# Generate foreground mask - no mask needed!
mask = pipe(
    image=image,
    prompt = {'edit_instruction':'Generate a detailed grayscale alpha matte. Map the opaque foreground to white and the background to black. Produce soft, anti-aliased grayscale gradients at the edges of the subject to represent fine details and transparency.'},
    num_inference_steps=10,
    guidance_scale=1.0
).images[0]

# Convert mask to grayscale and use as alpha channel
alpha = mask.convert("L").resize(image.size)
image.putalpha(alpha)

# Save the result as RGBA image with transparent background
image.save("output.png")

🎯 使用场景

  • 毛发及精细结构主体:非常适合需要沿发丝、皮毛或类似复杂边缘进行精确 alpha 抠图,且抠图质量对输出结果至关重要的图像。
  • 插画与图形合成:能够处理非写实内容,此类内容的前景与背景边界并非由深度清晰界定。
  • 平面设计与文字抠取:在以文字或排版元素为主体的场景中,可实现出色的前景分离效果。

⚙️ 模型参数

推荐的推理参数:

  • num_inference_steps:10(在质量和速度之间取得平衡)
  • guidance_scale:1(推荐用于快速获得结果)
  • torch_dtype:bfloat16(以实现最佳内存使用效率和速度)
  • seed:不同的种子值会产生不同的结果——建议尝试几个种子值,以找到针对特定输入的最佳输出。

🤝 贡献指南

如果您对本仓库有任何疑问、想分享反馈或直接参与贡献,欢迎在 GitHub 上提交 issue 和 pull request。您的贡献将帮助 Fibo-Edit-RMBG 不断完善,造福更多用户。

如果您热衷于基础研究,我们正在招聘全职员工(FTE)和研究实习生。请随时通过 hr@bria.ai 与我们联系。

Citation


@article{gutflaish2025generating,
  title={Generating an Image From 1,000 Words: Enhancing Text-to-Image With Structured Captions},
  author={Gutflaish, Eyal and Kachlon, Eliran and Zisman, Hezi and Hacham, Tal and Sarid, Nimrod and Visheratin, Alexander and Huberman, Saar and Davidi, Gal and Bukchin, Guy and Goldberg, Kfir and others},
  journal={arXiv preprint arXiv:2511.06876},
  year={2025}
}

❤️ 请在 Hugging Face 上为 Fibo-Edit-RMBG 点亮星标,并在 GitHub 上为 Bria AI 点亮星标,共同加入负责任的生成式 AI 行动!