Instructions to use leewheel/Z-Image-Special-Edtion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use leewheel/Z-Image-Special-Edtion with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("leewheel/Z-Image-Special-Edtion", 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
| import numpy as np | |
| import pytest | |
| import pandas as pd | |
| from pandas.core.interchange.utils import dtype_to_arrow_c_fmt | |
| # TODO: use ArrowSchema to get reference C-string. | |
| # At the time, there is no way to access ArrowSchema holding a type format string | |
| # from python. The only way to access it is to export the structure to a C-pointer, | |
| # see DataType._export_to_c() method defined in | |
| # https://github.com/apache/arrow/blob/master/python/pyarrow/types.pxi | |
| def test_dtype_to_arrow_c_fmt(pandas_dtype, c_string): # PR01 | |
| """Test ``dtype_to_arrow_c_fmt`` utility function.""" | |
| assert dtype_to_arrow_c_fmt(pandas_dtype) == c_string | |
| def test_dtype_to_arrow_c_fmt_arrowdtype(pa_dtype, args_kwargs, c_string): | |
| # GH 52323 | |
| pa = pytest.importorskip("pyarrow") | |
| if not args_kwargs: | |
| pa_type = getattr(pa, pa_dtype)() | |
| elif isinstance(args_kwargs, tuple): | |
| pa_type = getattr(pa, pa_dtype)(*args_kwargs) | |
| else: | |
| pa_type = getattr(pa, pa_dtype)(**args_kwargs) | |
| arrow_type = pd.ArrowDtype(pa_type) | |
| assert dtype_to_arrow_c_fmt(arrow_type) == c_string | |