Diffusers 文件
DreamBooth
加入 Hugging Face 社群
並獲得增強的文件體驗
開始使用
DreamBooth
DreamBooth 是一種生成特定例項個性化影像的方法。它的工作原理是對主體的 3-5 張影像(例如,一隻貓)進行模型微調,這些影像與一個唯一的識別符號(`sks cat`)相關聯。這允許您在提示中使用 `sks cat` 來觸發模型生成您的貓在不同設定、光照、姿勢和風格下的影像。
DreamBooth 檢查點通常有幾 GB 大小,因為它包含完整的模型權重。
使用 from_pretrained() 載入 DreamBooth 檢查點,並在提示中包含唯一的識別符號以啟用其生成。
import torch
from diffusers import AutoPipelineForText2Image
pipeline = AutoPipelineForText2Image.from_pretrained(
"sd-dreambooth-library/herge-style",
torch_dtype=torch.float16
).to("cuda")
prompt = "A cute sks herge_style brown bear eating a slice of pizza, stunning color scheme, masterpiece, illustration"
pipeline(prompt).images[0]
