Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,31 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- text-to-image
|
5 |
+
---
|
6 |
+
|
7 |
+
# Text2Earth Model Card
|
8 |
+
This model card focuses on the model associated with the Text2Earth model, available [here](https://github.com/Chen-Yang-Liu/Text2Earth).
|
9 |
+
|
10 |
+
## Examples
|
11 |
+
|
12 |
+
Using the [🤗's Diffusers library](https://github.com/huggingface/diffusers) to run Text2Earth in a simple and efficient manner.
|
13 |
+
|
14 |
+
```bash
|
15 |
+
pip install diffusers transformers accelerate scipy safetensors
|
16 |
+
```
|
17 |
+
|
18 |
+
Running the pipeline (if you don't swap the scheduler it will run with the default DDIM, in this example we are swapping it to EulerDiscreteScheduler):
|
19 |
+
|
20 |
+
```python
|
21 |
+
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
|
22 |
+
model_id = "lcybuaa/Text2Earth"
|
23 |
+
# Maybe you can use the Euler scheduler here instead
|
24 |
+
scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
|
25 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, torch_dtype=torch.float16, safety_checker=None)
|
26 |
+
pipe = pipe.to("cuda")
|
27 |
+
prompt = "Seven green circular farmlands are neatly arranged on the ground"
|
28 |
+
image = pipe(prompt).images[0]
|
29 |
+
|
30 |
+
image.save("circular.png")
|
31 |
+
```
|