Instructions to use ProCreations/Image-2.1-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-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-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
Add native transparent PNG workflow and exact repeated-prompt encoder reuse with paired RGBA quality and timing evidence
371818e verified Download transparency.py from ProCreations/Image-2.1-Calibrated-FP8: direct link, hf CLI and curl.
- Browser
- Download file 906 Bytes
-
https://huggingface.co/ProCreations/Image-2.1-Calibrated-FP8/resolve/main/transparency.py
- Command line
-
hf download hf://ProCreations/Image-2.1-Calibrated-FP8/transparency.py
-
curl -L -o transparency.py https://huggingface.co/ProCreations/Image-2.1-Calibrated-FP8/resolve/main/transparency.py
906 Bytes
| """Native RGBA prompting and lossless alpha reporting. Built with Qwen.""" | |
| def transparent_prompt(prompt): | |
| return (prompt.rstrip() + '\nIsolated subject on a transparent background. ' | |
| 'Preserve natural fine edges and any translucent details in the alpha channel. ' | |
| 'No opaque backdrop or checkerboard pattern.') | |
| def alpha_statistics(image): | |
| result = {'mode': image.mode, 'has_alpha': 'A' in image.getbands()} | |
| if result['has_alpha']: | |
| alpha = image.getchannel('A') | |
| histogram = alpha.histogram() | |
| total = image.width * image.height | |
| result.update(alpha_min=alpha.getextrema()[0], alpha_max=alpha.getextrema()[1], | |
| transparent_fraction=sum(histogram[:16])/total, | |
| translucent_fraction=sum(histogram[16:240])/total, | |
| opaque_fraction=sum(histogram[240:])/total) | |
| return result | |