Instructions to use PrunaAI/flux2-klein-4b-smashed with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use PrunaAI/flux2-klein-4b-smashed with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("PrunaAI/flux2-klein-4b-smashed", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Pruna AI
How to use PrunaAI/flux2-klein-4b-smashed with Pruna AI:
from pruna import PrunaModel pip install -U diffusers transformers accelerate
from pruna import PrunaModel import torch from diffusers.utils import load_image # switch to "mps" for apple devices pipe = PrunaModel.from_pretrained("PrunaAI/flux2-klein-4b-smashed", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,7 +8,7 @@ tags:
|
|
| 8 |
- safetensors
|
| 9 |
---
|
| 10 |
|
| 11 |
-
# Model Card for
|
| 12 |
|
| 13 |
This model was created using the [pruna](https://github.com/PrunaAI/pruna) library. Pruna is a model optimization framework built for developers, enabling you to deliver more efficient models with minimal implementation overhead.
|
| 14 |
|
|
@@ -20,7 +20,7 @@ First things first, you need to install the pruna library:
|
|
| 20 |
pip install pruna
|
| 21 |
```
|
| 22 |
|
| 23 |
-
You can [use the library_name library to load the model](https://huggingface.co/
|
| 24 |
|
| 25 |
To ensure that all optimizations are applied, use the pruna library to load the model using the following code:
|
| 26 |
|
|
@@ -28,7 +28,7 @@ To ensure that all optimizations are applied, use the pruna library to load the
|
|
| 28 |
from pruna import PrunaModel
|
| 29 |
|
| 30 |
loaded_model = PrunaModel.from_pretrained(
|
| 31 |
-
"
|
| 32 |
)
|
| 33 |
# we can then run inference using the methods supported by the base model
|
| 34 |
```
|
|
|
|
| 8 |
- safetensors
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# Model Card for PrunaAI/flux2-klein-4b-optimized-smashed
|
| 12 |
|
| 13 |
This model was created using the [pruna](https://github.com/PrunaAI/pruna) library. Pruna is a model optimization framework built for developers, enabling you to deliver more efficient models with minimal implementation overhead.
|
| 14 |
|
|
|
|
| 20 |
pip install pruna
|
| 21 |
```
|
| 22 |
|
| 23 |
+
You can [use the library_name library to load the model](https://huggingface.co/PrunaAI/flux2-klein-4b-optimized-smashed?library=library_name) but this might not include all optimizations by default.
|
| 24 |
|
| 25 |
To ensure that all optimizations are applied, use the pruna library to load the model using the following code:
|
| 26 |
|
|
|
|
| 28 |
from pruna import PrunaModel
|
| 29 |
|
| 30 |
loaded_model = PrunaModel.from_pretrained(
|
| 31 |
+
"PrunaAI/flux2-klein-4b-optimized-smashed"
|
| 32 |
)
|
| 33 |
# we can then run inference using the methods supported by the base model
|
| 34 |
```
|