Upload folder using huggingface_hub
Browse files- README.md +63 -0
- config.json +16 -0
- diffusion_pytorch_model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Tongyi-MAI/Z-Image-Turbo
|
| 4 |
+
tags:
|
| 5 |
+
- diffusers
|
| 6 |
+
- text-to-image
|
| 7 |
+
- z-image
|
| 8 |
+
library_name: diffusers
|
| 9 |
+
pipeline_tag: text-to-image
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# beyond-reality-z-image-diffusers
|
| 13 |
+
|
| 14 |
+
This is a converted version of the Beyond Reality Z-Image transformer, converted to diffusers format for use with the `ZImagePipeline`.
|
| 15 |
+
|
| 16 |
+
## Model Description
|
| 17 |
+
|
| 18 |
+
This transformer is based on [Beyond Reality Z-Image](https://huggingface.co/Nurburgring/BEYOND_REALITY_Z_IMAGE), converted from ComfyUI format to diffusers format.
|
| 19 |
+
|
| 20 |
+
## Usage
|
| 21 |
+
|
| 22 |
+
```python
|
| 23 |
+
import torch
|
| 24 |
+
from diffusers import ZImagePipeline, ZImageTransformer2DModel
|
| 25 |
+
|
| 26 |
+
# Load the custom transformer
|
| 27 |
+
transformer = ZImageTransformer2DModel.from_pretrained(
|
| 28 |
+
"linoyts/beyond-reality-z-image-diffusers",
|
| 29 |
+
torch_dtype=torch.bfloat16
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
# Load the pipeline with custom transformer
|
| 33 |
+
pipe = ZImagePipeline.from_pretrained(
|
| 34 |
+
"Tongyi-MAI/Z-Image-Turbo",
|
| 35 |
+
transformer=transformer,
|
| 36 |
+
torch_dtype=torch.bfloat16,
|
| 37 |
+
)
|
| 38 |
+
pipe.to("cuda")
|
| 39 |
+
|
| 40 |
+
# Generate an image
|
| 41 |
+
prompt = "A beautiful landscape with mountains and a lake, photorealistic, 8k"
|
| 42 |
+
image = pipe(
|
| 43 |
+
prompt=prompt,
|
| 44 |
+
num_inference_steps=8,
|
| 45 |
+
guidance_scale=0.0, # Z-Image-Turbo uses guidance_scale=0
|
| 46 |
+
width=1024,
|
| 47 |
+
height=1024,
|
| 48 |
+
).images[0]
|
| 49 |
+
|
| 50 |
+
image.save("output.png")
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
## Original Model
|
| 54 |
+
|
| 55 |
+
- **Source**: [Nurburgring/BEYOND_REALITY_Z_IMAGE](https://huggingface.co/Nurburgring/BEYOND_REALITY_Z_IMAGE)
|
| 56 |
+
- **Base Architecture**: [Tongyi-MAI/Z-Image-Turbo](https://huggingface.co/Tongyi-MAI/Z-Image-Turbo)
|
| 57 |
+
|
| 58 |
+
## Conversion Details
|
| 59 |
+
|
| 60 |
+
The model was converted from ComfyUI format to diffusers format with the following key transformations:
|
| 61 |
+
- Split combined `attention.qkv` weights into separate `to_q`, `to_k`, `to_v`
|
| 62 |
+
- Renamed `attention.out` to `attention.to_out.0`
|
| 63 |
+
- Renamed normalization layers to match diffusers conventions
|
config.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "ZImageTransformer2DModel",
|
| 3 |
+
"_diffusers_version": "0.32.0",
|
| 4 |
+
"attention_head_dim": 128,
|
| 5 |
+
"cap_embed_dim": 4096,
|
| 6 |
+
"in_channels": 16,
|
| 7 |
+
"joint_attention_dim": 4096,
|
| 8 |
+
"mlp_ratio": 4.0,
|
| 9 |
+
"num_attention_heads": 32,
|
| 10 |
+
"num_layers": 30,
|
| 11 |
+
"out_channels": 16,
|
| 12 |
+
"patch_size": 2,
|
| 13 |
+
"pooled_projection_dim": 4096,
|
| 14 |
+
"qk_norm": "rms_norm",
|
| 15 |
+
"text_embed_dim": 4096
|
| 16 |
+
}
|
diffusion_pytorch_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7798f17b3a89b70ac59ad15ab7c855a43d1e77e48f28d14c2e77f8701951d586
|
| 3 |
+
size 12309893352
|