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/micro_vae.py from ProCreations/Image-2.1-Turbo-Calibrated-FP8: direct link, hf CLI and curl.
- Browser
- Download file 899 Bytes
-
https://huggingface.co/ProCreations/Image-2.1-Turbo-Calibrated-FP8/resolve/main/source/micro_vae.py
- Command line
-
hf download hf://ProCreations/Image-2.1-Turbo-Calibrated-FP8/source/micro_vae.py
-
curl -L -o micro_vae.py https://huggingface.co/ProCreations/Image-2.1-Turbo-Calibrated-FP8/resolve/main/source/micro_vae.py
899 Bytes
| import json, time, sys, torch | |
| from diffusers import AutoencoderKLQwenImage21 | |
| from common import BASE | |
| from vae_fast import enable_fast_decode | |
| mode = sys.argv[1] | |
| if "bench" in mode: torch.backends.cudnn.benchmark = True | |
| vae = AutoencoderKLQwenImage21.from_pretrained(BASE, subfolder="vae", torch_dtype=torch.bfloat16).cuda().eval() | |
| if "cl" in mode: vae = vae.to(memory_format=torch.channels_last) | |
| if mode != "eager": enable_fast_decode(vae, compile="compile" in mode) | |
| with torch.inference_mode(): | |
| for s in (64, 128): | |
| z = torch.randn(1, 64, 1, s, s, device="cuda", dtype=torch.bfloat16) | |
| for _ in range(3): vae.decode(z, return_dict=False) | |
| torch.cuda.synchronize(); t = time.perf_counter() | |
| for _ in range(5): vae.decode(z, return_dict=False) | |
| torch.cuda.synchronize(); print(json.dumps({"mode": mode, "px": s * 16, "ms": (time.perf_counter() - t) / 5 * 1e3})) | |