Text-to-Image
Diffusers
Chinese
AltDiffusionPipeline
stable-diffusion
stable-diffusion-diffusers
bilingual
Chinese
en
English
Instructions to use BAAI/AltDiffusion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use BAAI/AltDiffusion with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("BAAI/AltDiffusion", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
Simplify diffusers example
#3
by patrickvonplaten - opened
README.md
CHANGED
|
@@ -72,12 +72,18 @@ You can see the documentation page [here](https://huggingface.co/docs/diffusers/
|
|
| 72 |
|
| 73 |
The following example will use the fast DPM scheduler to generate an image in ca. 2 seconds on a V100.
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
```python
|
| 76 |
-
!pip install git+https://github.com/huggingface/diffusers.git torch transformers
|
| 77 |
from diffusers import AltDiffusionPipeline, DPMSolverMultistepScheduler
|
| 78 |
import torch
|
| 79 |
|
| 80 |
-
pipe = AltDiffusionPipeline.from_pretrained("
|
| 81 |
pipe = pipe.to("cuda")
|
| 82 |
|
| 83 |
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
|
|
|
| 72 |
|
| 73 |
The following example will use the fast DPM scheduler to generate an image in ca. 2 seconds on a V100.
|
| 74 |
|
| 75 |
+
First you should install diffusers main branch and some dependencies:
|
| 76 |
+
```
|
| 77 |
+
pip install git+https://github.com/huggingface/diffusers.git torch transformers sentencepiece
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
then you can run the following example:
|
| 81 |
+
|
| 82 |
```python
|
|
|
|
| 83 |
from diffusers import AltDiffusionPipeline, DPMSolverMultistepScheduler
|
| 84 |
import torch
|
| 85 |
|
| 86 |
+
pipe = AltDiffusionPipeline.from_pretrained("BAAI/AltDiffusion", torch_dtype=torch.float16)
|
| 87 |
pipe = pipe.to("cuda")
|
| 88 |
|
| 89 |
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|