Instructions to use ProCreations/Image-2.1-Turbo-Calibrated-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ProCreations/Image-2.1-Turbo-Calibrated-FP8 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ProCreations/Image-2.1-Turbo-Calibrated-FP8", 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
Release calibrated Image 2.1 Turbo FP8 transformer, accelerated SM120 runtime, quality evidence and real-time demo
ffc54ec verified Download source/test_vae.py from ProCreations/Image-2.1-Turbo-Calibrated-FP8: direct link, hf CLI and curl.
- Browser
- Download file 579 Bytes
-
https://huggingface.co/ProCreations/Image-2.1-Turbo-Calibrated-FP8/resolve/main/source/test_vae.py
- Command line
-
hf download hf://ProCreations/Image-2.1-Turbo-Calibrated-FP8/source/test_vae.py
-
curl -L -o test_vae.py https://huggingface.co/ProCreations/Image-2.1-Turbo-Calibrated-FP8/resolve/main/source/test_vae.py
579 Bytes
| import time, torch | |
| from diffusers import AutoencoderKLQwenImage21 | |
| from common import BASE | |
| from vae_fast import enable_fast_decode | |
| vae = AutoencoderKLQwenImage21.from_pretrained(BASE, subfolder='vae', torch_dtype=torch.bfloat16).cuda().eval() | |
| torch.manual_seed(0) | |
| z = torch.randn(1, 64, 1, 64, 64, device='cuda', dtype=torch.bfloat16) | |
| with torch.inference_mode(): | |
| ref = vae.decode(z, return_dict=False)[0] | |
| enable_fast_decode(vae) | |
| out = vae.decode(z, return_dict=False)[0] | |
| print('exact equal', torch.equal(ref, out), (ref.float() - out.float()).abs().max().item()) | |