data-is-better-together/open-image-preferences-v1-binarized
Viewer • Updated • 7.46k • 506 • 59
How to use ariG23498/open-image-preferences-v1-sdxl-lora 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-xl-base-1.0", dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("ariG23498/open-image-preferences-v1-sdxl-lora")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]These are ariG23498/open-image-preferences-v1-sdxl-lora LoRA adaption weights for stabilityai/stable-diffusion-xl-base-1.0.
The weights were trained using DreamBooth using the open-image-preferences-v1-binarized dataset.
diffusers
from diffusers import AutoPipelineForText2Image
import torch
pipeline = AutoPipelineForText2Image.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
torch_dtype=torch.bfloat16
).to('cuda')
pipeline.load_lora_weights('ariG23498/open-image-preferences-v1-sdxl-lora', weight_name='pytorch_lora_weights.safetensors')
prompt = "ENTER PROMPT"
image = pipeline(prompt).images[0]
!accelerate launch examples/dreambooth/train_dreambooth_lora_sdxl.py \
--pretrained_model_name_or_path "stabilityai/stable-diffusion-xl-base-1.0" \
--dataset_name "data-is-better-together/open-image-preferences-v1-binarized" \
--hub_model_id "ariG23498/open-image-preferences-v1-sdxl-lora" \
--push_to_hub \
--output_dir "open-image-preferences-v1-sdxl-lora" \
--image_column "chosen" \
--caption_column "prompt" \
--mixed_precision="bf16" \
--resolution=1024 \
--train_batch_size=1 \
--repeats=1 \
--report_to="wandb"\
--gradient_accumulation_steps=1 \
--gradient_checkpointing \
--learning_rate=1.0 \
--text_encoder_lr=1.0 \
--optimizer="prodigy"\
--lr_scheduler="constant" \
--lr_warmup_steps=0 \
--rank=8 \
--checkpointing_steps=2000 \
--seed="0"
Base model
stabilityai/stable-diffusion-xl-base-1.0