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
File size: 906 Bytes
371818e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | """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
|