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/rerun_evaluation.py from ixim/Image21-INT8: direct link, hf CLI and curl.
- Browser
- Download file 1.83 kB
-
https://huggingface.co/ixim/Image21-INT8/resolve/main/scripts/rerun_evaluation.py
- Command line
-
hf download hf://ixim/Image21-INT8/scripts/rerun_evaluation.py
-
curl -L -o rerun_evaluation.py https://huggingface.co/ixim/Image21-INT8/resolve/main/scripts/rerun_evaluation.py
1.83 kB
| """Serialize fresh subprocesses and record GPU state across process boundaries.""" | |
| import json | |
| import subprocess | |
| import sys | |
| import time | |
| from pathlib import Path | |
| def main(): | |
| root = Path('artifacts/eval-corrected') | |
| root.mkdir(exist_ok=False) | |
| jobs = [] | |
| for precision in ('bf16', 'int8'): | |
| jobs.append((precision, ['-m', 'scripts.benchmark', '--model', 'models/'+precision, | |
| '--output', str(root/precision)])) | |
| for precision in ('bf16', 'int8'): | |
| jobs.append(('young_'+precision, ['-m', 'scripts.benchmark', '--model', 'models/'+precision, | |
| '--output', str(root/'young_woman'/precision), '--cases', 'benchmarks/young_woman.json'])) | |
| for name, command in jobs: | |
| before = subprocess.check_output(['nvidia-smi'], text=True) | |
| with (root/(name+'.log')).open('w', encoding='utf-8') as log: | |
| proc = subprocess.Popen([sys.executable, *command], stdout=log, stderr=subprocess.STDOUT) | |
| print('Started', name, 'PID', proc.pid, flush=True) | |
| code = proc.wait() | |
| after = subprocess.check_output(['nvidia-smi'], text=True) | |
| output = Path(command[command.index('--output')+1]) | |
| env_path = output/'environment.json' | |
| inference_pid = json.loads(env_path.read_text())['pid'] if env_path.exists() else None | |
| row = dict(name=name, pid=proc.pid, returncode=code, command=command, | |
| inference_pid=inference_pid, gpu_before=before, gpu_after=after, completed=time.time()) | |
| with (root/'process-isolation.jsonl').open('a', encoding='utf-8') as f: | |
| f.write(json.dumps(row)+'\n') | |
| print('Completed', name, 'exit', code, flush=True) | |
| if code: | |
| raise RuntimeError('Benchmark failed: '+name) | |
| if __name__ == '__main__': | |
| main() | |