🚀 无访问限制的Stable Diffusion 3.5 Large!
本项目与原版完全相同,只是重新上传时去除了访问限制机制。

✨ 主要特性
- 基于文本生成图像,可用于艺术创作、设计等多个领域。
- 采用多模态扩散Transformer(MMDiT)架构,在图像质量、排版、复杂提示理解和资源效率方面表现出色。
- 去除了访问限制,方便用户使用。
📦 安装指南
pip install -U diffusers
量化模型以减少VRAM使用
pip install bitsandbytes
💻 使用示例
基础用法
import torch
from diffusers import StableDiffusion3Pipeline
pipe = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3.5-large", torch_dtype=torch.bfloat16)
pipe = pipe.to("cuda")
image = pipe(
"A capybara holding a sign that reads Hello World",
num_inference_steps=28,
guidance_scale=3.5,
).images[0]
image.save("capybara.png")
高级用法
from diffusers import BitsAndBytesConfig, SD3Transformer2DModel
from diffusers import StableDiffusion3Pipeline
import torch
model_id = "stabilityai/stable-diffusion-3.5-large"
nf4_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16
)
model_nf4 = SD3Transformer2DModel.from_pretrained(
model_id,
subfolder="transformer",
quantization_config=nf4_config,
torch_dtype=torch.bfloat16
)
pipeline = StableDiffusion3Pipeline.from_pretrained(
model_id,
transformer=model_nf4,
torch_dtype=torch.bfloat16
)
pipeline.enable_model_cpu_offload()
prompt = "A whimsical and creative image depicting a hybrid creature that is a mix of a waffle and a hippopotamus, basking in a river of melted butter amidst a breakfast-themed landscape. It features the distinctive, bulky body shape of a hippo. However, instead of the usual grey skin, the creature's body resembles a golden-brown, crispy waffle fresh off the griddle. The skin is textured with the familiar grid pattern of a waffle, each square filled with a glistening sheen of syrup. The environment combines the natural habitat of a hippo with elements of a breakfast table setting, a river of warm, melted butter, with oversized utensils or plates peeking out from the lush, pancake-like foliage in the background, a towering pepper mill standing in for a tree. As the sun rises in this fantastical world, it casts a warm, buttery glow over the scene. The creature, content in its butter river, lets out a yawn. Nearby, a flock of birds take flight"
image = pipeline(
prompt=prompt,
num_inference_steps=28,
guidance_scale=4.5,
max_sequence_length=512,
).images[0]
image.save("whimsical.png")
📚 详细文档
模型信息
属性 |
详情 |
模型类型 |
MMDiT文本到图像生成模型 |
开发者 |
Stability AI |
模型描述 |
该模型基于文本提示生成图像。它是一个 多模态扩散Transformer,使用三个固定的预训练文本编码器,并采用QK归一化来提高训练稳定性。 |
社区许可证 |
适用于研究、非商业用途,以及年收入低于100万美元的组织或个人的商业用途。更多详情请见 社区许可协议。请访问https://stability.ai/license 了解更多信息。 |
企业许可证 |
对于年收入超过100万美元的个人和组织,请 联系我们 获取企业许可证。 |
模型来源
文件结构
点击此处访问 文件和版本标签
│
├── text_encoders/
│ ├── README.md
│ ├── clip_g.safetensors
│ ├── clip_l.safetensors
│ ├── t5xxl_fp16.safetensors
│ └── t5xxl_fp8_e4m3fn.safetensors
│
├── README.md
├── LICENSE
├── sd3_large.safetensors
├── SD3.5L_example_workflow.json
└── sd3_large_demo.png
** 以下文件结构用于diffusers集成 **
├── scheduler/
├── text_encoder/
├── text_encoder_2/
├── text_encoder_3/
├── tokenizer/
├── tokenizer_2/
├── tokenizer_3/
├── transformer/
├── vae/
└── model_index.json
微调
请参阅 此处 的微调指南。
预期用途
- 生成艺术品并用于设计和其他艺术创作过程。
- 用于教育或创意工具。
- 对生成模型进行研究,包括了解生成模型的局限性。
所有对模型的使用都必须符合我们的 可接受使用政策。
非预期用途
该模型并非用于生成真实的人物或事件的准确表示。因此,使用该模型生成此类内容超出了该模型的能力范围。
安全说明
作为我们以安全为设计理念和负责任的AI部署方法的一部分,我们采取了慎重的措施,确保在开发的早期阶段就注重完整性。我们在模型开发的整个过程中实施了安全措施。我们已经实施了旨在降低某些危害风险的安全缓解措施,但我们建议开发者根据其特定用例进行自己的测试并应用额外的缓解措施。
有关我们的安全方法的更多信息,请访问我们的 安全页面。
完整性评估
我们的完整性评估方法包括结构化评估和针对某些危害的红队测试。测试主要以英语进行,可能无法涵盖所有可能的危害。
已识别的风险和缓解措施
- 有害内容:我们在训练模型时使用了过滤后的数据集,并实施了保障措施,试图在实用性和防止危害之间取得平衡。然而,这并不能保证所有可能的有害内容都已被去除。所有开发者和部署者都应谨慎行事,并根据其特定的产品政策和应用用例实施内容安全防护措施。
- 滥用:技术限制以及对开发者和最终用户的教育有助于减轻模型的恶意应用。所有用户都必须遵守我们的 可接受使用政策,包括在应用微调提示工程机制时。请参考Stability AI可接受使用政策,了解我们产品的违规使用信息。
- 隐私侵犯:鼓励开发者和部署者遵守隐私法规,采用尊重数据隐私的技术。
联系我们
请报告模型的任何问题或与我们联系:
- 安全问题:safety@stability.ai
- 安全漏洞:security@stability.ai
- 隐私问题:privacy@stability.ai
- 许可证和一般问题:https://stability.ai/license
- 企业许可证:https://stability.ai/enterprise
🔧 技术细节
实现细节
- QK归一化:实现了QK归一化技术,以提高训练稳定性。
- 文本编码器:
- 训练数据和策略:该模型在多种数据上进行训练,包括合成数据和经过过滤的公开可用数据。
有关原始MMDiT架构的更多技术细节,请参考 研究论文。
模型性能
有关我们在提示遵循度和美学质量方面的比较性能研究,请参阅 博客。
📄 许可证
本模型发布遵循 Stability社区许可证。请访问 Stability AI 了解更多信息,或 联系我们 获取商业许可详情。