Update model card: Remove emojis, fix usage example, remove zoo-gym tag, add diffusers/zenlm tags, remove fake benchmarks
Browse files
README.md
CHANGED
|
@@ -3,81 +3,83 @@ license: apache-2.0
|
|
| 3 |
base_model: zenlm/zen-image-edit
|
| 4 |
tags:
|
| 5 |
- image-editing
|
|
|
|
|
|
|
| 6 |
- vision
|
| 7 |
- multimodal
|
|
|
|
| 8 |
- zen
|
| 9 |
-
-
|
| 10 |
-
- hanzo
|
| 11 |
-
- text-to-image
|
| 12 |
-
- image-to-image
|
| 13 |
language:
|
| 14 |
- en
|
| 15 |
- zh
|
| 16 |
pipeline_tag: image-to-image
|
| 17 |
-
library_name:
|
| 18 |
---
|
| 19 |
|
| 20 |
-
# Zen
|
| 21 |
-
|
| 22 |
-
Part of the [Zen AI Model Family](https://huggingface.co/zenlm/zen-family) | Based on Zen Image Edit
|
| 23 |
|
| 24 |
-
|
| 25 |
|
| 26 |
-
|
| 27 |
-
- **Object Manipulation**: Add, remove, move objects seamlessly
|
| 28 |
-
- **Style Transfer**: Apply artistic styles and filters
|
| 29 |
-
- **Background Editing**: Replace or modify backgrounds
|
| 30 |
-
- **Face Editing**: Adjust expressions and features
|
| 31 |
-
- **Resolution**: Up to 1024x1024
|
| 32 |
-
- **Speed**: 3-5 images/second on A100
|
| 33 |
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|-----------|-------|
|
| 38 |
-
| EditBench | 87.3% |
|
| 39 |
-
| MagicBrush | 82.1% |
|
| 40 |
-
| InstructPix2Pix | 89.5% |
|
| 41 |
-
| ImageNet-E | 91.2% |
|
| 42 |
-
|
| 43 |
-
## 💻 Quick Start
|
| 44 |
|
| 45 |
```python
|
| 46 |
-
from
|
| 47 |
from PIL import Image
|
|
|
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
image = Image.open("input.jpg")
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
|
|
|
|
|
|
| 58 |
```
|
| 59 |
|
| 60 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
-
|
| 63 |
-
- **Object Addition**: Natural placement with proper lighting
|
| 64 |
-
- **Style Transfer**: Artistic transformations
|
| 65 |
-
- **Color Grading**: Professional color adjustments
|
| 66 |
-
- **Background Swap**: Seamless background replacement
|
| 67 |
-
- **Face Editing**: Expression and feature modification
|
| 68 |
-
- **Weather Effects**: Add rain, snow, fog
|
| 69 |
-
- **Time of Day**: Convert day to night scenes
|
| 70 |
|
| 71 |
-
##
|
| 72 |
|
| 73 |
-
|
| 74 |
-
|--------|------|----------|
|
| 75 |
-
| SafeTensors | 14GB | Full precision |
|
| 76 |
-
| GGUF Q8 | 7GB | High quality |
|
| 77 |
-
| GGUF Q4 | 3.5GB | Mobile/edge |
|
| 78 |
-
| MLX 8-bit | 7GB | Apple Silicon |
|
| 79 |
-
| MLX 4-bit | 3.5GB | iOS devices |
|
| 80 |
|
| 81 |
---
|
| 82 |
|
| 83 |
-
|
|
|
|
| 3 |
base_model: zenlm/zen-image-edit
|
| 4 |
tags:
|
| 5 |
- image-editing
|
| 6 |
+
- image-to-image
|
| 7 |
+
- text-to-image
|
| 8 |
- vision
|
| 9 |
- multimodal
|
| 10 |
+
- diffusers
|
| 11 |
- zen
|
| 12 |
+
- zenlm
|
| 13 |
+
- hanzo
|
|
|
|
|
|
|
| 14 |
language:
|
| 15 |
- en
|
| 16 |
- zh
|
| 17 |
pipeline_tag: image-to-image
|
| 18 |
+
library_name: diffusers
|
| 19 |
---
|
| 20 |
|
| 21 |
+
# Zen Image Edit
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
**Zen LM by Hanzo AI** — Advanced image editing model with natural language instructions. Edit images by describing changes in plain text.
|
| 24 |
|
| 25 |
+
## Overview
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
Zen Image Edit enables precise image editing through natural language instructions:
|
| 28 |
+
- Object manipulation: Add, remove, or move objects seamlessly
|
| 29 |
+
- Style transfer: Apply artistic styles and filters
|
| 30 |
+
- Background editing: Replace or modify backgrounds
|
| 31 |
+
- Facial editing: Adjust expressions and features
|
| 32 |
+
- Resolution: Up to 1024x1024
|
| 33 |
|
| 34 |
+
## Usage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
```python
|
| 37 |
+
from diffusers import AutoPipelineForInpainting
|
| 38 |
from PIL import Image
|
| 39 |
+
import torch
|
| 40 |
|
| 41 |
+
pipe = AutoPipelineForInpainting.from_pretrained(
|
| 42 |
+
"zenlm/zen-image-edit",
|
| 43 |
+
torch_dtype=torch.bfloat16,
|
| 44 |
+
trust_remote_code=True,
|
| 45 |
+
)
|
| 46 |
+
pipe = pipe.to("cuda")
|
| 47 |
|
| 48 |
image = Image.open("input.jpg")
|
| 49 |
+
edited = pipe(
|
| 50 |
+
image=image,
|
| 51 |
+
prompt="Remove the car and replace with trees",
|
| 52 |
+
height=1024,
|
| 53 |
+
width=1024,
|
| 54 |
+
).images[0]
|
| 55 |
+
edited.save("output.jpg")
|
| 56 |
```
|
| 57 |
|
| 58 |
+
## API Access
|
| 59 |
+
|
| 60 |
+
```python
|
| 61 |
+
from openai import OpenAI
|
| 62 |
+
|
| 63 |
+
client = OpenAI(
|
| 64 |
+
base_url='https://api.hanzo.ai/v1',
|
| 65 |
+
api_key='your-api-key',
|
| 66 |
+
)
|
| 67 |
+
|
| 68 |
+
response = client.images.edit(
|
| 69 |
+
model='zen-image-edit',
|
| 70 |
+
image=open('input.jpg', 'rb'),
|
| 71 |
+
prompt='Remove the car and replace with trees',
|
| 72 |
+
size='1024x1024',
|
| 73 |
+
)
|
| 74 |
+
print(response.data[0].url)
|
| 75 |
+
```
|
| 76 |
|
| 77 |
+
Get your API key at [console.hanzo.ai](https://console.hanzo.ai) — $5 free credit on signup.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
+
## License
|
| 80 |
|
| 81 |
+
Apache 2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
---
|
| 84 |
|
| 85 |
+
*Zen LM is developed by [Hanzo AI](https://hanzo.ai) — Frontier AI infrastructure.*
|