patrickvonplaten commited on
Commit
3699054
1 Parent(s): 719a3a4

Add diffusers example

Browse files
Files changed (1) hide show
  1. README.md +22 -0
README.md CHANGED
@@ -8,6 +8,28 @@ Use the tokens **_elden ring style_** in your prompts for the effect.
8
 
9
  If you enjoy this model, please check out my other models on [Huggingface](https://huggingface.co/nitrosocke)
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  **Portraits rendered with the model:**
12
  ![Portrait Samples](https://huggingface.co/nitrosocke/elden-ring-diffusion/resolve/main/eldenring-portraits-small.jpg)
13
  **Landscape Shots rendered with the model:**
 
8
 
9
  If you enjoy this model, please check out my other models on [Huggingface](https://huggingface.co/nitrosocke)
10
 
11
+ ### 🧨 Diffusers
12
+
13
+ This model can be used just like any other Stable Diffusion model. For more information,
14
+ please have a look at the [Stable Diffusion](https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion).
15
+
16
+ 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]().
17
+
18
+ ```python
19
+ #!pip install diffusers transformers scipy torch
20
+ from diffusers import StableDiffusionPipeline
21
+ import torch
22
+
23
+ model_id = "nitrosocke/elden-ring-diffusion"
24
+ pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
25
+ pipe = pipe.to("cuda")
26
+
27
+ prompt = "a magical princess with golden hair, elden ring style"
28
+ image = pipe(prompt).images[0]
29
+
30
+ image.save("./magical_princess.png")
31
+ ```
32
+
33
  **Portraits rendered with the model:**
34
  ![Portrait Samples](https://huggingface.co/nitrosocke/elden-ring-diffusion/resolve/main/eldenring-portraits-small.jpg)
35
  **Landscape Shots rendered with the model:**