lambda/naruto-blip-captions
Updated โข 1.75k โข 56
How to use muhammadfsalman/data266-lab2-p2-run_a with Diffusers:
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("muhammadfsalman/data266-lab2-p2-run_a")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("muhammadfsalman/data266-lab2-p2-run_a")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]LoRA adapter for Stable Diffusion 1.5, trained for DATA 266 (Fall 2026) Lab 2, Part 2. A second adapter with a different rank was trained with identical data, steps, LR and seed for comparison.
lambdalabs/naruto-blip-captions; license on the dataset card: not declared (check terms before any reuse).| item | value |
|---|---|
| method | LoRA on UNet attention (to_q, to_k, to_v, to_out.0) |
| rank / alpha | 4 / 4 |
| trainable parameters | 797,184 (0.09% of UNet) |
| learning rate / schedule | 0.0001 / cosine, 50 warm-up steps |
| steps x batch | 1500 x 4 (7.0 epochs) |
| precision | fp16 autocast, LoRA weights fp32, gradient checkpointing True |
| hardware | Tesla T4 |
| peak GPU memory (allocated) | 4.60 GiB |
| train time | 30.4 min (0.507 GPU-hours) |
| seed | 266 |
| metric | base SD1.5 | this model |
|---|---|---|
| kid_all | 0.0623 | 0.0240 |
| kid_all_std | 0.0135 | 0.0096 |
| kid_in_domain | 0.0609 | 0.0119 |
| kid_in_domain_std | 0.0242 | 0.0090 |
| clip_all | 32.5165 | 31.8843 |
| clip_in_domain | 32.4205 | 31.3125 |
| clip_out_of_domain | 31.2865 | 31.5849 |
| clip_compositional | 33.9388 | 33.3274 |
| lpips_diversity | 0.7996 | 0.7892 |
| lpips_in_domain | 0.8070 | 0.7880 |
| lpips_out_of_domain | 0.7413 | 0.7430 |
| lpips_compositional | 0.8432 | 0.8379 |
| gen_sec_per_image | 4.3295 | 4.5364 |
| trainable_params_M | n/a | 0.7972 |
| train_gpu_hours | n/a | 0.5068 |
| peak_mem_gib | n/a | 4.5952 |
import torch
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained('stable-diffusion-v1-5/stable-diffusion-v1-5', torch_dtype=torch.float16).to('cuda')
pipe.load_lora_weights('muhammadfsalman/data266-lab2-p2-run_a')
image = pipe('a cartoon character with blue hair and a sword').images[0]
Base model
stable-diffusion-v1-5/stable-diffusion-v1-5