Diffusers documentation

DreamBooth

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

DreamBooth

DreamBooth 通过微调完整权重,将预训练模型个性化到特定主体(例如你的猫),并在提示词中将该主体绑定到一个唯一标识符(sks cat)。之后,你可以在新的场景、光照、姿势和风格中生成该主体。

DreamBooth 检查点通常有几 GB 大,因为它们包含完整的模型权重。请使用 from_pretrained() 加载它们,并在提示词中包含唯一标识符以触发生成。

import torch
from diffusers import AutoPipelineForText2Image

pipeline = AutoPipelineForText2Image.from_pretrained(
    "sd-dreambooth-library/herge-style",
    dtype=torch.float16
).to("cuda")  # or "mps", "xpu", "cpu"
prompt = "A cute sks herge_style brown bear eating a slice of pizza, stunning color scheme, masterpiece, illustration"
pipeline(prompt).images[0]

要训练自己的检查点,请参阅 训练 DreamBooth。

Update on GitHub