Views
No views yet
1import torch
2from diffusers import StableDiffusionPipeline, TCDScheduler
3device = "cuda"
4base_model_id = "runwayml/stable-diffusion-v1-5"
5tcd_lora_id = "h1t/TCD-SD15-LoRA"
6pipe = StableDiffusionPipeline.from_pretrained(base_model_id, torch_dtype=torch.float16, variant="fp16").to(device)
7pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
8pipe.load_lora_weights(tcd_lora_id)
9pipe.fuse_lora()
10prompt = "Beautiful woman, bubblegum pink, lemon yellow, minty blue, futuristic, high-detail, epic composition, watercolor."
11image = pipe(
12 prompt=prompt,
13 num_inference_steps=4,
14 guidance_scale=0,
15 # Eta (referred to as `gamma` in the paper) is used to control the stochasticity in every step.
16 # A value of 0.3 often yields good results.
17 # We recommend using a higher eta when increasing the number of inference steps.
18 eta=0.3,
19 generator=torch.Generator(device=device).manual_seed(42),
20).images[0]