AdamLucek/cube-pics-dreambooth
Viewer • Updated • 5 • 143
How to use AdamLucek/sd3-dreambooth-lora-cube with Diffusers:
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("AdamLucek/sd3-dreambooth-lora-cube")
prompt = "A photo of T0K cube on a shelf"
image = pipe(prompt).images[0]import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("AdamLucek/sd3-dreambooth-lora-cube")
prompt = "A photo of T0K cube on a shelf"
image = pipe(prompt).images[0]Reference Image
Generated Images
These are DreamBooth LoRA weights for stabilityai/stable-diffusion-3-medium-diffusers.
You should use A photo of T0K cube to trigger the image generation.
Download the pytorch_lora_weights.safetensors LoRA in the Files & versions tab.
from diffusers import AutoPipelineForText2Image
import torch
pipeline = AutoPipelineForText2Image.from_pretrained('stabilityai/stable-diffusion-3-medium-diffusers', torch_dtype=torch.float16).to('cuda')
pipeline.load_lora_weights('AdamLucek/sd3-cube-dreambooth-lora-2', weight_name='pytorch_lora_weights.safetensors')
image = pipeline('A photo of T0K cube on a shelf').images[0]
diffusers_lora_weights.safetensors here 💾.models/Lora folder.<lora:your_new_name:1> to your prompt. On ComfyUI just load it as a regular LoRA.For more details, including weighting, merging and fusing LoRAs, check the documentation on loading LoRAs in diffusers
Please adhere to the licensing terms as described here.
The weights were trained using DreamBooth with the SD3 diffusers trainer.
Script
accelerate launch train_dreambooth_lora_sd3.py \
--pretrained_model_name_or_path="stabilityai/stable-diffusion-3-medium-diffusers" \
--output_dir="lora-trained-sd3-t3" \
--dataset_name="AdamLucek/cube-pics-dreambooth" \
--mixed_precision="fp16" \
--instance_prompt="A photo of T0K cube" \
--resolution=1024 \
--train_batch_size=16 \
--learning_rate=1e-4 \
--report_to="wandb" \
--lr_scheduler="constant" \
--lr_warmup_steps=0 \
--max_train_steps=1000 \
--validation_prompt="A photo of T0K cube on a shelf" \
--validation_epochs=500 \
--seed="420" \
--rank=16 \
--hub_model_id="sd3-cube-dreambooth-lora-2" \
--train_text_encoder \
--push_to_hub
Trained on a single H100