Instructions to use vyroAI/ImagineV4.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use vyroAI/ImagineV4.1 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("vyroAI/ImagineV4.1", torch_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 Settings
- Draw Things
- DiffusionBee
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
|