Skip to main content

Py-Dreambooth


Samples Py-Dreambooth is a Python package that makes it easy to create AI avatar images from photos of you, your family, friends, or pets!

  1. Tasks are pre-configured with the most efficient defaults, which greatly streamlines the workload. A number of helper functions are also provided.
  2. This is designed to be modular and extensible to many different models. Currently supported models are the Stable Diffusion Dreambooth, Stable Diffusion Dreambooth LoRA, and Stable Diffusion XL Dreambooth LoRA.
  3. This is designed to give you the flexibility to choose local or cloud resources to train your model and generate images.

⚙️ How to Install


pip install py-dreambooth

🚀 Quick Start


  • Prepare about 10-20 high-quality solo selfie photos (jpg or png) and put them in a specific directory.
  • Please run on a machine with a GPU of 16GB or more. (If you're fine-tuning SDXL, you'll need 24GB of VRAM.)
from py_dreambooth.dataset import LocalDataset
from py_dreambooth.model import SdDreamboothModel
from py_dreambooth.trainer import LocalTrainer
from py_dreambooth.utils.image_helpers import display_images
from py_dreambooth.utils.prompt_helpers import make_prompt

DATA_DIR = "data"  # The directory where you put your prepared photos
OUTPUT_DIR = "models"  

dataset = LocalDataset(DATA_DIR)
dataset = dataset.preprocess_images(detect_face=True)

SUBJECT_NAME = "<YOUR-NAME>"  
CLASS_NAME = "person"

model = SdDreamboothModel(subject_name=SUBJECT_NAME, class_name=CLASS_NAME)
trainer = LocalTrainer(output_dir=OUTPUT_DIR)

predictor = trainer.fit(model, dataset)

# Use the prompt helper to create an awesome AI avatar!
prompt = next(make_prompt(SUBJECT_NAME, CLASS_NAME))

images = predictor.predict(
    prompt, height=768, width=512, num_images_per_prompt=2,
)

display_images(images, fig_size=10)

🏃‍♀️ Tutorials


📚 Documentation


References


Metadata

Release files for py-dreambooth 0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-dreambooth 0.2.8
File Size Uploaded
py-dreambooth-0.2.8.tar.gz 74.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-dreambooth 0.2.8
File Interpreter ABI Platform
py_dreambooth-0.2.8-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 155.9 kB

Release files / py-dreambooth-0.2.8.tar.gz

Download URL py-dreambooth-0.2.8.tar.gz
Size 74.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7d22f7714272d5bbb293077a9bcc2baf6a570f668e50e8f81ad2cbb62e58a85e
BLAKE2b-256 checksum
How to use checksums
9ddef720a6cd5c0091777ffdb736ec93be4613727931369809f0302e0a191b66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / py_dreambooth-0.2.8-py2.py3-none-any.whl

Download URL py_dreambooth-0.2.8-py2.py3-none-any.whl
Size 81.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
63dfdde2be0b78ed49387aa45fe84a8b6f6c4f796347cecfda0601ee72c051a9
BLAKE2b-256 checksum
How to use checksums
36fe80808be89548a23ce1abceb0561491b9ad6158ef891b714aa0e96bcd6a10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.2.8 This release

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page