File size: 774 Bytes
fdd8122
c87d952
7ca6403
fdd8122
 
7ca6403
 
 
7dd29f6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
library_name: diffusers
pipeline_tag: text-to-image
---

This model has been pushed to the Hub using the Diffusers library:
- Repo: https://github.com/Huage001/LinFusion
- Paper: https://huggingface.co/papers/2409.02097

* **Basic Usage of LinFusion:**
```python
from diffusers import AutoPipelineForText2Image
import torch

from src.linfusion import LinFusion
from src.tools import seed_everything

sd_repo = "Lykon/dreamshaper-8"

pipeline = AutoPipelineForText2Image.from_pretrained(
    sd_repo, torch_dtype=torch.float16, variant="fp16"
).to(torch.device("cuda"))

linfusion = LinFusion.construct_for(pipeline)

seed_everything(123)
image = pipeline(
	"An astronaut floating in space. Beautiful view of the stars and the universe in the background."
).images[0]
```