Instructions to use Ray0821/ivgeng-2026-lab2-style-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Ray0821/ivgeng-2026-lab2-style-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("CompVis/stable-diffusion-v1-4", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("Ray0821/ivgeng-2026-lab2-style-lora") 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
Lab 2 Style LoRA
A geometric illustration style adapter trained on the four artistic-custom example images supplied by the course starter repository. The course README identifies these images as GPT-4 generated. Captions: a bear, a car, a cat, a dog. This adapter is a course experiment, not a claim to reproduce any named artist.
Training
Base: Stable Diffusion 1.4. UNet attention LoRA rank 4; 797,184 trainable adapter parameters. The text encoder and base parameters remain frozen. Resolution 512, batch size 1, learning rate 1e-4, constant schedule, training seed 42, fp16. Completed 400 optimizer steps. The supplied course algorithm implementation was used without modification.
Dataset and training code source: course starter repository.
Inference
import torch
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained(
"CompVis/stable-diffusion-v1-4", torch_dtype=torch.float16
).to("cuda")
pipe.load_lora_weights("Ray0821/ivgeng-2026-lab2-style-lora")
image = pipe(
"a bear", num_inference_steps=30, guidance_scale=7.5,
generator=torch.Generator(device="cuda").manual_seed(42),
).images[0]
image.save("sample.png")
Final comparisons use the base model's PNDM scheduler, 30 inference steps and seeds 42 and 123, with matched base/adapter settings. Only adapter weights are provided, not the base model.
Limitations
Style transfer is strongest for the training object classes. Some unseen subjects, especially a cottage beside a river, retain a landscape-painting or photographic appearance. Colors and transfer strength vary with the seed.
Integrity
File: pytorch_lora_weights.safetensors (3,226,184 bytes).
SHA-256: 0616ec65bba635e6f0b44067c560b8a1f9114f13ed0868e2eb2a9dd378e19394.
The adapter is distributed under the base model's CreativeML Open RAIL-M license and use restrictions.
- Downloads last month
- 17
Model tree for Ray0821/ivgeng-2026-lab2-style-lora
Base model
CompVis/stable-diffusion-v1-4