🚀 BRIA 3.1文本到图像模型
BRIA 3.1是一款全新的文本到图像模型,它仅使用完全授权的数据进行训练,能够实现高质量的图像生成。该模型为开发者提供API访问和模型权重直接访问两种方式,方便集成。它拥有40亿参数,相对轻量级,同时具备高视觉保真度和强大的提示对齐能力。
🚀 快速开始
BRIA 3.1模型可通过API、ComfyUI节点或直接获取模型权重的方式使用。若需获取模型权重,需购买商业许可证。以下是使用Diffusers库调用模型的示例代码:
pip install diffusers, hf_hub_download
from huggingface_hub import hf_hub_download
import os
try:
local_dir = os.path.dirname(__file__)
except:
local_dir = '.'
hf_hub_download(repo_id="briaai/BRIA-3.1", filename='pipeline_bria.py', local_dir=local_dir)
hf_hub_download(repo_id="briaai/BRIA-3.1", filename='transformer_bria.py', local_dir=local_dir)
hf_hub_download(repo_id="briaai/BRIA-3.1", filename='bria_utils.py', local_dir=local_dir)
import torch
from pipeline_bria import BriaPipeline
pipe = BriaPipeline.from_pretrained("briaai/BRIA-3.1", torch_dtype=torch.bfloat16,trust_remote_code=True)
pipe.to(device="cuda")
prompt = "A portrait of a Beautiful and playful ethereal singer, golden designs, highly detailed, blurry background"
negative_prompt = "Logo,Watermark,Ugly,Morbid,Extra fingers,Poorly drawn hands,Mutation,Blurry,Extra limbs,Gross proportions,Missing arms,Mutated hands,Long neck,Duplicate,Mutilated,Mutilated hands,Poorly drawn face,Deformed,Bad anatomy,Cloned face,Malformed limbs,Missing legs,Too many fingers"
images = pipe(prompt=prompt, negative_prompt=negative_prompt, height=1024, width=1024).images[0]
✨ 主要特性
- 美学提升:能够生成各种风格(如逼真摄影、插画和图形)的极具吸引力的图像。
- 高提示对齐:确保生成的图像能精确遵循用户提供的文本描述,输出更准确、有意义。
- 合法合规:由于使用了来自领先数据合作伙伴的100%授权数据进行训练,该模型为版权和隐私侵权提供全面的法律责任保障,确保内容的道德使用。
- 归因引擎:拥有专利的归因引擎,可根据生成的图像对数据合作伙伴进行公平补偿。
- 可定制技术:提供源代码和权重,方便进行广泛的定制。
📦 安装指南
使用Diffusers库调用模型,需先安装相关依赖:
pip install diffusers, hf_hub_download
💻 使用示例
基础用法
pip install diffusers, hf_hub_download
from huggingface_hub import hf_hub_download
import os
try:
local_dir = os.path.dirname(__file__)
except:
local_dir = '.'
hf_hub_download(repo_id="briaai/BRIA-3.1", filename='pipeline_bria.py', local_dir=local_dir)
hf_hub_download(repo_id="briaai/BRIA-3.1", filename='transformer_bria.py', local_dir=local_dir)
hf_hub_download(repo_id="briaai/BRIA-3.1", filename='bria_utils.py', local_dir=local_dir)
import torch
from pipeline_bria import BriaPipeline
pipe = BriaPipeline.from_pretrained("briaai/BRIA-3.1", torch_dtype=torch.bfloat16,trust_remote_code=True)
pipe.to(device="cuda")
prompt = "A portrait of a Beautiful and playful ethereal singer, golden designs, highly detailed, blurry background"
negative_prompt = "Logo,Watermark,Ugly,Morbid,Extra fingers,Poorly drawn hands,Mutation,Blurry,Extra limbs,Gross proportions,Missing arms,Mutated hands,Long neck,Duplicate,Mutilated,Mutilated hands,Poorly drawn face,Deformed,Bad anatomy,Cloned face,Malformed limbs,Missing legs,Too many fingers"
images = pipe(prompt=prompt, negative_prompt=negative_prompt, height=1024, width=1024).images[0]
高级用法
暂无高级用法示例。
📚 详细文档
获取访问权限
- API端点:Bria.ai
- ComfyUI:在工作流中使用
- 获取BRIA 3.1权重:需要购买许可证才能访问BRIA 3.1,以确保与数据合作伙伴的版税管理和商业使用的全面责任覆盖。
- 如果你是初创企业或学生,可申请初创企业计划来请求访问。该计划旨在用前沿技术支持新兴企业和学术研究。
- 立即联系我们,释放BRIA 3.1的潜力!提交上述表单即表示你同意BRIA的隐私政策和条款与条件。
- 许可证:商业许可条款和条件
使用提示
- 建议使用负提示。
- 微调时,使用零值而非空文本嵌入。
- 支持多种宽高比,但分辨率总体应约为
1024*1024 = 100万
像素,例如:((1024,1024), (1280, 768), (1344, 768), (832, 1216), (1152, 832), (1216, 832), (960,1088)
- 使用30 - 50步(步数越高越好)
- 使用
guidance_scale
为5.0
🔧 技术细节
这些改进通过以下几个关键技术升级实现:
首先,使用先进的视觉语言模型生成的合成字幕扩充了大型数据集。然后,通过集成最先进的变压器(特别是使用MMDIT和DIT层)改进架构,并使用整流流目标进行训练。这种方法与其他开放模型(如AuraFlow、Flux和SD3)类似。BRIA 3.1还采用2D RoPE进行位置嵌入、KQ归一化以提高训练稳定性,并使用噪声偏移进行高分辨率训练。
为确保推理和微调成本可控,BRIA 3.1设计得较为紧凑,由28个MMDIT层和8个DIT层组成,总共40亿参数。仅使用T5文本编码器,避免使用CLIP以减少不必要的偏差。在空间压缩方面,使用开源的VAE f8,并确认该VAE不会给模型引入偏差。
基础模型未进行蒸馏,原生支持无分类器引导,为微调提供了充分的灵活性。
此外,BRIA 3.1在多种宽高比和分辨率上进行训练,能够原生生成水平和垂直方向的100万像素图像。
最后,还为Diffusers代码库和ComfyUI提供全面支持,便于快速实验和部署。微调代码将很快提供。
📄 许可证
属性 |
详情 |
模型类型 |
文本到图像模型 |
训练数据 |
使用来自领先数据合作伙伴的100%授权数据进行训练,不包含受版权保护的材料,如虚构角色、标志、商标、公众人物、有害内容或侵犯隐私的内容 |
⚠️ 重要提示
模型权重需购买商业许可证才能获取。提交表单即表示同意BRIA的隐私政策和条款与条件。
💡 使用建议
- 建议使用负提示。
- 微调时,使用零值而非空文本嵌入。
- 支持多种宽高比,但分辨率总体应约为
1024*1024 = 100万
像素。
- 使用30 - 50步(步数越高越好)。
- 使用
guidance_scale
为5.0。