Commit
·
20542a8
1
Parent(s):
dee524f
Update README.md
Browse files
README.md
CHANGED
@@ -60,16 +60,28 @@ pip install diffusers transformers accelerate --upgrade
|
|
60 |
|
61 |
- **Text-to-image**:
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
```py
|
64 |
-
from
|
65 |
import torch
|
66 |
|
67 |
-
pipe =
|
68 |
-
|
|
|
|
|
|
|
|
|
69 |
|
70 |
-
|
|
|
71 |
|
72 |
-
|
73 |
```
|
74 |
|
75 |
### Out-of-Scope Use
|
|
|
60 |
|
61 |
- **Text-to-image**:
|
62 |
|
63 |
+
To run the model yourself, you can leverage the 🧨 Diffusers library:
|
64 |
+
1. Install the library:
|
65 |
+
```
|
66 |
+
pip install --upgrade diffusers
|
67 |
+
```
|
68 |
+
|
69 |
+
2. Run the model:
|
70 |
```py
|
71 |
+
from TBA import CustomStableDiffusionPipeline4_1
|
72 |
import torch
|
73 |
|
74 |
+
pipe = DiffusionPipeline.from_pretrained("vyroAI/ImagineV4.1")
|
75 |
+
|
76 |
+
# To save GPU memory, torch.float16 can be used, but it may compromise image quality.
|
77 |
+
pipe.to(torch_device="cuda", torch_dtype=torch.float16)
|
78 |
+
|
79 |
+
prompt = "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k"
|
80 |
|
81 |
+
# Can be set to 1~50 steps.
|
82 |
+
num_inference_steps = 30
|
83 |
|
84 |
+
images = pipe(prompt=prompt, num_inference_steps=num_inference_steps).images
|
85 |
```
|
86 |
|
87 |
### Out-of-Scope Use
|