Text-to-Image
Diffusers
Safetensors
English
Chinese
QwenImage21Pipeline
bitsandbytes
int8
image-generation
image-editing
rgba
8-bit precision
Instructions to use ixim/Image21-INT8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ixim/Image21-INT8 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ixim/Image21-INT8", 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
Download scripts/download.py from ixim/Image21-INT8: direct link, hf CLI and curl.
- Browser
- Download file 2.46 kB
-
https://huggingface.co/ixim/Image21-INT8/resolve/main/scripts/download.py
- Command line
-
hf download hf://ixim/Image21-INT8/scripts/download.py
-
curl -L -o download.py https://huggingface.co/ixim/Image21-INT8/resolve/main/scripts/download.py
2.46 kB
| """Download pinned configs and checksum-equivalent official weights.""" | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| from urllib.request import urlopen | |
| from scripts.integrity import verify_files | |
| REPO = 'Qwen/Qwen-Image-2.1' | |
| REVISION = 'b3179ad355be050328e483a9dfdd9e60cd62adfa' | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument('--source', choices=['modelscope', 'huggingface'], default='modelscope') | |
| ap.add_argument('--output', default='models/bf16') | |
| args = ap.parse_args() | |
| root = Path(args.output) | |
| root.mkdir(parents=True, exist_ok=True) | |
| with urlopen(f'https://huggingface.co/api/models/{REPO}/revision/{REVISION}?blobs=true', timeout=60) as r: | |
| info = json.load(r) | |
| if info['sha'] != REVISION: | |
| raise ValueError('Unexpected upstream revision') | |
| artifacts = Path('artifacts/upstream') | |
| artifacts.mkdir(parents=True, exist_ok=True) | |
| (artifacts / 'huggingface-model-info.json').write_text(json.dumps(info, indent=2), encoding='utf-8') | |
| if args.source == 'huggingface': | |
| from huggingface_hub import snapshot_download | |
| snapshot_download(REPO, revision=REVISION, local_dir=str(root), max_workers=4) | |
| else: | |
| # ModelScope 1.33 accepts branch/tag revisions, not arbitrary Git commits. | |
| # We accept files from master only when their SHA256 matches the pinned HF snapshot. | |
| from modelscope import snapshot_download | |
| snapshot_download(REPO, revision='master', local_dir=str(root), | |
| allow_patterns=['*.safetensors'], max_workers=4) | |
| for entry in info['siblings']: | |
| name = entry['rfilename'] | |
| if name.endswith('.safetensors'): | |
| continue | |
| with urlopen(f'https://huggingface.co/{REPO}/resolve/{REVISION}/{name}', timeout=60) as r: | |
| data = r.read() | |
| path = root / name | |
| path.parent.mkdir(parents=True, exist_ok=True) | |
| path.write_bytes(data) | |
| rows = [{'path': e['rfilename'], 'size': e['size'], 'sha256': e['lfs']['sha256']} | |
| for e in info['siblings'] if e['rfilename'].endswith('.safetensors')] | |
| verified = verify_files(root, rows) | |
| Path('artifacts/download-verification.json').write_text( | |
| json.dumps({'revision': REVISION, 'files': verified}, indent=2), encoding='utf-8') | |
| print('All official weights match the pinned upstream SHA256 manifest.') | |
| if __name__ == '__main__': | |
| main() | |