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 vae_fast.py from ProCreations/Image-2.1-Turbo-Calibrated-FP8: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/ProCreations/Image-2.1-Turbo-Calibrated-FP8/resolve/main/vae_fast.py
- Command line
-
hf download hf://ProCreations/Image-2.1-Turbo-Calibrated-FP8/vae_fast.py
-
curl -L -o vae_fast.py https://huggingface.co/ProCreations/Image-2.1-Turbo-Calibrated-FP8/resolve/main/vae_fast.py
1.34 kB
| """Single-image VAE decode without the video frame cache. Built with Qwen. | |
| The upstream image VAE is Wan's causal video decoder specialised to one frame. Its decode loop still | |
| maintains a per-convolution frame cache, cloning the input of every causal convolution for a next | |
| frame that never arrives. For one frame the cache only ever holds its initial values, so calling the | |
| decoder without a cache takes the identical arithmetic path minus those copies. Optionally the | |
| cache-free decoder is compiled (kernel fusion of norm/activation/pad around cuDNN convolutions). | |
| """ | |
| import torch | |
| from diffusers.models.autoencoders.vae import DecoderOutput | |
| def enable_fast_decode(vae, compile=False): | |
| if getattr(vae, '_image21_fast_decode', False): | |
| return vae | |
| original = vae._decode | |
| decoder = vae.decoder | |
| run = torch.compile(decoder, dynamic=False) if compile else decoder | |
| def _decode(z, return_dict=True): | |
| if z.shape[2] != 1 or vae.use_tiling or vae.config.patch_size is not None: | |
| return original(z, return_dict=return_dict) | |
| out = run(vae.post_quant_conv(z), feat_cache=None, first_chunk=True) | |
| out = torch.clamp(out, min=-1.0, max=1.0) | |
| return (out,) if not return_dict else DecoderOutput(sample=out) | |
| vae._decode = _decode | |
| vae._image21_fast_decode = True | |
| return vae | |