Instructions to use elvis92/pets_rank_2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use elvis92/pets_rank_2 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("elvis92/pets_rank_2") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
File size: 1,523 Bytes
71ac1fa | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | import subprocess
subprocess.run(["accelerate", "launch", "--mixed_precision=fp16", "train_text_to_image_lora.py",
"--pretrained_model_name_or_path=runwayml/stable-diffusion-v1-5",
"--dataset_name=pcuenq/oxford-pets",
"--dataloader_num_workers=8",
"--resolution=512", "--center_crop", "--random_flip",
"--train_batch_size=1",
"--gradient_accumulation_steps=4",
"--max_train_steps=5000",
"--learning_rate=1e-04",
"--max_grad_norm=1",
"--lr_scheduler=cosine", "--lr_warmup_steps=0",
"--output_dir=/home/htelvis92/182/",
"--push_to_hub",
"--hub_model_id=pets",
"--checkpointing_steps=500",
"--validation_prompt=Totoro",
"--seed=1337",
"--caption_column=label"])
# run script
# python train_text_to_image_lora.py \
# --pretrained_model_name_or_path=runwayml/stable-diffusion-v1-5 \
# --dataset_name=pcuenq/oxford-pets \
# --dataloader_num_workers=8 \
# --resolution=512 --center_crop --random_flip \
# --train_batch_size=1 \
# --gradient_accumulation_steps=4 \
# --max_train_steps=15000 \
# --learning_rate=1e-04 \
# --max_grad_norm=1 \
# --lr_scheduler="cosine" --lr_warmup_steps=0 \
# --output_dir=/home/htelvis92/182 \
# --push_to_hub \
# --hub_model_id=pets \
# --checkpointing_steps=500 \
# --validation_prompt="Totoro" |