Commit ·
f0e4577
1
Parent(s): d8e2f70
Update README.md
Browse files
README.md
CHANGED
|
@@ -55,33 +55,28 @@ Advanced Version: Upgraded from the base version of Imagine AI Art Generator
|
|
| 55 |
### Diffusers
|
| 56 |
|
| 57 |
```
|
| 58 |
-
pip install
|
| 59 |
```
|
| 60 |
|
| 61 |
- **Text-to-image**:
|
| 62 |
|
| 63 |
-
|
| 64 |
-
1. Install the library:
|
| 65 |
-
```
|
| 66 |
-
pip install --upgrade diffusers
|
| 67 |
-
```
|
| 68 |
-
|
| 69 |
-
2. Run the model:
|
| 70 |
```py
|
| 71 |
-
from
|
| 72 |
import torch
|
| 73 |
|
| 74 |
-
pipe =
|
|
|
|
| 75 |
|
| 76 |
# To save GPU memory, torch.float16 can be used, but it may compromise image quality.
|
| 77 |
-
pipe.to(torch_device=
|
| 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 =
|
| 83 |
|
| 84 |
-
|
| 85 |
```
|
| 86 |
|
| 87 |
### Out-of-Scope Use
|
|
|
|
| 55 |
### Diffusers
|
| 56 |
|
| 57 |
```
|
| 58 |
+
pip install -r requirements.txt --no-cache
|
| 59 |
```
|
| 60 |
|
| 61 |
- **Text-to-image**:
|
| 62 |
|
| 63 |
+
1. Run the model:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
```py
|
| 65 |
+
from stable_diffusion_custom_v4_1 import CustomStableDiffusionPipeline4_1
|
| 66 |
import torch
|
| 67 |
|
| 68 |
+
pipe = CustomStableDiffusionPipeline4_1.from_pretrained("vyroAI/ImagineV4.1")
|
| 69 |
+
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 70 |
|
| 71 |
# To save GPU memory, torch.float16 can be used, but it may compromise image quality.
|
| 72 |
+
pipe.to(torch_device=DEVICE, torch_dtype=torch.float32)
|
| 73 |
|
| 74 |
prompt = "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k"
|
| 75 |
|
| 76 |
# Can be set to 1~50 steps.
|
| 77 |
+
num_inference_steps = 20
|
| 78 |
|
| 79 |
+
res = pipe.inferPipe(prompt=prompt, num_inference_steps=num_inference_steps).images
|
| 80 |
```
|
| 81 |
|
| 82 |
### Out-of-Scope Use
|