说明文档
I detect translation intent — user wants the README content translated to Chinese (Simplified) while preserving code blocks, links, and markdown formatting. This is a writing/translation task.
SDXL-Turbo 模型卡片
<!-- 简要介绍模型的功能。 -->

SDXL-Turbo 是一个快速的生成式文本到图像模型,可以在单次网络评估中从文本提示合成逼真的图像。实时演示可在此处获取:http://clipdrop.co/stable-diffusion-turbo
请注意:如需商业使用,请参阅 https://stability.ai/license。
模型详情
模型描述
SDXL-Turbo 是 SDXL 1.0 的蒸馏版本,专为实时合成而训练。SDXL-Turbo 基于一种名为对抗扩散蒸馏(Adversarial Diffusion Distillation, ADD)的新型训练方法(参见技术报告),该方法允许在 1 到 4 个步骤内以高图像质量采样大规模基础图像扩散模型。这种方法使用分数蒸馏来利用大规模现成的图像扩散模型作为教师信号,并结合对抗损失以确保即使在一步或两步采样的低步骤情况下也能保持高图像保真度。
- 开发者: Stability AI
- 资助方: Stability AI
- 模型类型: 生成式文本到图像模型
- 微调自模型: SDXL 1.0 Base
模型来源
出于研究目的,我们推荐使用我们的 generative-models Github 仓库(https://github.com/Stability-AI/generative-models),该仓库实现了最流行的扩散框架(包括训练和推理)。
- 仓库: https://github.com/Stability-AI/generative-models
- 论文: https://stability.ai/research/adversarial-diffusion-distillation
- 演示: http://clipdrop.co/stable-diffusion-turbo
评估

上图评估了用户对 SDXL-Turbo 与其他单步和多步模型的偏好。在单步评估时,SDXL-Turbo 在图像质量和提示遵循方面被人类投票者认为优于在 4 步(或更少)评估的 LCM-XL。此外,我们看到对 SDXL-Turbo 使用 4 步可以进一步提升性能。有关用户研究的详细信息,请参阅研究论文。
用途
直接使用
该模型可用于非商业和商业用途。您可以根据此许可证将本模型用于非商业或研究目的。可能的研究领域和任务包括:
- 生成模型研究。
- 生成模型实时应用研究。
- 实时生成模型影响研究。
- 安全部署可能生成有害内容的模型。
- 探索和了解生成模型的局限性和偏见。
- 生成艺术作品并用于设计和其他艺术创作过程。
- 应用于教育或创意工具。
如需商业使用,请参阅 https://stability.ai/membership。
排除的用途如下所述。
Diffusers
pip install diffusers transformers accelerate --upgrade
- 文本到图像:
SDXL-Turbo 不使用 guidance_scale 或 negative_prompt,我们通过 guidance_scale=0.0 禁用它。该模型最好生成 512x512 大小的图像,但更高的图像尺寸也可以。单步就足以生成高质量图像。
from diffusers import AutoPipelineForText2Image
import torch
pipe = AutoPipelineForText2Image.from_pretrained("stabilityai/sdxl-turbo", torch_dtype=torch.float16, variant="fp16")
pipe.to("cuda")
prompt = "A cinematic shot of a baby racoon wearing an intricate italian priest robe."
image = pipe(prompt=prompt, num_inference_steps=1, guidance_scale=0.0).images[0]
- 图像到图像:
当使用 SDXL-Turbo 进行图像到图像生成时,请确保 num_inference_steps * strength 大于或等于 1。图像到图像管道将运行 int(num_inference_steps * strength) 步,例如下面示例中的 0.5 * 2.0 = 1 步。
from diffusers import AutoPipelineForImage2Image
from diffusers.utils import load_image
import torch
pipe = AutoPipelineForImage2Image.from_pretrained("stabilityai/sdxl-turbo", torch_dtype=torch.float16, variant="fp16")
pipe.to("cuda")
init_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png").resize((512, 512))
prompt = "cat wizard, gandalf, lord of the rings, detailed, fantasy, cute, adorable, Pixar, Disney, 8k"
image = pipe(prompt, image=init_image, num_inference_steps=2, strength=0.5, guidance_scale=0.0).images[0]
超出范围的使用
该模型并非用于生成真实或准确的人物或事件描述,因此使用模型生成此类内容超出了该模型的能力范围。该模型不得以任何违反 Stability AI 可接受使用政策 的方式使用。
局限性和偏见
局限性
- 生成的图像具有固定分辨率(512x512 像素),且模型无法实现完美的照片级真实感。
- 该模型无法渲染可读的文本。
- 人脸和人物可能无法正确生成。
- 模型的自动编码部分是有损的。
建议
该模型可用于非商业和商业用途。
如何开始使用模型
请查看 https://github.com/Stability-AI/generative-models
stabilityai/sdxl-turbo
作者 stabilityai
创建时间: 2023-11-27 15:19:11+00:00
更新时间: 2024-07-10 11:33:43+00:00
在 Hugging Face 上查看