lambda/naruto-blip-captions
Updated โข 1.75k โข 56
How to use muhammadfsalman/data266-lab2-p2-run_b 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_b")
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_b")
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 | 32 / 32 |
| trainable parameters | 6,377,472 (0.74% 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) | 2.88 GiB |
| train time | 29.2 min (0.487 GPU-hours) |
| seed | 266 |
| metric | base SD1.5 | this model |
|---|---|---|
| kid_all | 0.0623 | 0.0171 |
| kid_all_std | 0.0135 | 0.0079 |
| kid_in_domain | 0.0609 | 0.0062 |
| kid_in_domain_std | 0.0242 | 0.0082 |
| clip_all | 32.5165 | 32.1147 |
| clip_in_domain | 32.4205 | 31.2576 |
| clip_out_of_domain | 31.2865 | 31.5613 |
| clip_compositional | 33.9388 | 34.3822 |
| lpips_diversity | 0.7996 | 0.7800 |
| lpips_in_domain | 0.8070 | 0.7667 |
| lpips_out_of_domain | 0.7413 | 0.7663 |
| lpips_compositional | 0.8432 | 0.8202 |
| gen_sec_per_image | 4.3295 | 4.5333 |
| trainable_params_M | n/a | 6.3775 |
| train_gpu_hours | n/a | 0.4868 |
| peak_mem_gib | n/a | 2.8755 |
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_b')
image = pipe('a cartoon character with blue hair and a sword').images[0]
Base model
stable-diffusion-v1-5/stable-diffusion-v1-5