Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
pipeline_tag: text-to-image
|
3 |
+
---
|
4 |
+
|
5 |
+
## Usage
|
6 |
+
|
7 |
+
Lumina-Image-2.0 is a 2 billion parameter flow-based diffusion transformer capable of generating images from text descriptions.
|
8 |
+
|
9 |
+
```python
|
10 |
+
import torch
|
11 |
+
from diffusers import FluxPipeline
|
12 |
+
|
13 |
+
pipe = Lumina2Text2ImgPipeline.from_pretrained("Alpha-VLLM/Lumina-Image-2.0", torch_dtype=torch.bfloat16)
|
14 |
+
pipe.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Remove this if you have enough GPU power
|
15 |
+
|
16 |
+
prompt = "A dog holding a sign that says hello world"
|
17 |
+
image = pipe(
|
18 |
+
prompt,
|
19 |
+
height=1024,
|
20 |
+
width=1024,
|
21 |
+
guidance_scale=4.0,
|
22 |
+
num_inference_steps=50,
|
23 |
+
generator=torch.Generator("cpu").manual_seed(0)
|
24 |
+
).images[0]
|
25 |
+
image.save("lumina_demo.png")
|
26 |
+
```
|