File size: 1,573 Bytes
179eb90
 
 
 
 
 
 
 
bc9726e
179eb90
 
bc9726e
179eb90
 
 
 
 
 
 
bc9726e
179eb90
 
 
ca10f59
 
 
179eb90
ca10f59
 
179eb90
 
 
 
ca10f59
179eb90
ca10f59
 
 
 
 
179eb90
 
ca10f59
 
179eb90
bc9726e
179eb90
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
---
tags:
- text-to-image
- stable-diffusion
- lora
- diffusers
base_model: stabilityai/stable-diffusion-2-1-base
license: mit
library_name: diffusers
---

# Model description 

Official SD21(base) Model of the paper [Trajectory Consistency Distillation](https://arxiv.org/abs/2402.19159). 

For more usage please found at [Project Page](https://huggingface.co/h1t/TCD-SDXL-LoRA/)

Here is a simple example:

```python
import torch
from diffusers import  StableDiffusionPipeline, TCDScheduler

device = "cuda"
base_model_id = "stabilityai/stable-diffusion-2-1-base"
tcd_lora_id = "h1t/TCD-SD21-base-LoRA"

pipe = StableDiffusionPipeline.from_pretrained(base_model_id, torch_dtype=torch.float16, variant="fp16").to(device)
pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)

pipe.load_lora_weights(tcd_lora_id)
pipe.fuse_lora()

prompt = "Beautiful woman, bubblegum pink, lemon yellow, minty blue, futuristic, high-detail, epic composition, watercolor."

image = pipe(
    prompt=prompt,
    num_inference_steps=4,
    guidance_scale=0,
    # Eta (referred to as `gamma` in the paper) is used to control the stochasticity in every step.
    # A value of 0.3 often yields good results.
    # We recommend using a higher eta when increasing the number of inference steps.
    eta=0.3, 
    generator=torch.Generator(device=device).manual_seed(0),
).images[0]
```

![sd21_base.png](https://cdn-uploads.huggingface.co/production/uploads/630b77f68b327c7b8b98c409/ifzBOlPA7E4IKkysMpelC.png)