Diffusers documentation

DreamBooth

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.42.1).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

DreamBooth

DreamBooth cá nhân hóa một mô hình được huấn luyện trước cho một chủ thể cụ thể từ một vài hình ảnh (ví dụ: con mèo của bạn) bằng cách tinh chỉnh toàn bộ trọng số và gắn chủ thể đó với một định danh duy nhất trong prompt (sks cat). Sau đó, bạn có thể tạo ra chủ thể trong các bối cảnh, ánh sáng, tư thế và phong cách mới.

DreamBooth checkpoints thường có dung lượng vài GB vì chúng chứa toàn bộ trọng số của mô hình. Hãy tải chúng bằng from_pretrained() và bao gồm định danh duy nhất trong prompt để kích hoạt quá trình tạo.

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]

Để huấn luyện checkpoint của riêng bạn, hãy xem Train DreamBooth.

Update on GitHub