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
Model ID typo
Browse filesSmall model typo doesn't match the model ID
README.md
CHANGED
|
@@ -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 |
-
"PrunaAI/flux2-klein-4b-
|
| 32 |
)
|
| 33 |
# we can then run inference using the methods supported by the base model
|
| 34 |
```
|
|
|
|
| 28 |
from pruna import PrunaModel
|
| 29 |
|
| 30 |
loaded_model = PrunaModel.from_pretrained(
|
| 31 |
+
"PrunaAI/flux2-klein-4b-smashed"
|
| 32 |
)
|
| 33 |
# we can then run inference using the methods supported by the base model
|
| 34 |
```
|