Commit
·
03b34e3
1
Parent(s):
74001fb
Add diffusers code example (#4)
Browse files- Add diffusers code example (57118d173659ae229beb09c749e79c5316335b6c)
Co-authored-by: Patrick von Platen <patrickvonplaten@users.noreply.huggingface.co>
README.md
CHANGED
|
@@ -15,6 +15,27 @@ If you enjoy this model, please check out my other models on [Huggingface](https
|
|
| 15 |
**Cars and Landscapes rendered with the model:**
|
| 16 |

|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
#### Prompt and settings for Lara Croft:
|
| 19 |
**modern disney lara croft**
|
| 20 |
_Steps: 50, Sampler: Euler a, CFG scale: 7, Seed: 3940025417, Size: 512x768_
|
|
|
|
| 15 |
**Cars and Landscapes rendered with the model:**
|
| 16 |

|
| 17 |
|
| 18 |
+
### 🧨 Diffusers
|
| 19 |
+
|
| 20 |
+
This model can be used just like any other Stable Diffusion model. For more information,
|
| 21 |
+
please have a look at the [Stable Diffusion](https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion).
|
| 22 |
+
|
| 23 |
+
You can also export the model to [ONNX](https://huggingface.co/docs/diffusers/optimization/onnx), [MPS](https://huggingface.co/docs/diffusers/optimization/mps) and/or [FLAX/JAX]().
|
| 24 |
+
|
| 25 |
+
```python
|
| 26 |
+
from diffusers import StableDiffusionPipeline
|
| 27 |
+
import torch
|
| 28 |
+
|
| 29 |
+
model_id = "nitrosocke/mo-di-diffusion"
|
| 30 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 31 |
+
pipe = pipe.to("cuda")
|
| 32 |
+
|
| 33 |
+
prompt = "a magical princess with golden hair, modern disney style"
|
| 34 |
+
image = pipe(prompt).images[0]
|
| 35 |
+
|
| 36 |
+
image.save("./magical_princess.png")
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
#### Prompt and settings for Lara Croft:
|
| 40 |
**modern disney lara croft**
|
| 41 |
_Steps: 50, Sampler: Euler a, CFG scale: 7, Seed: 3940025417, Size: 512x768_
|