Update README.md
Browse files
README.md
CHANGED
|
@@ -58,8 +58,30 @@ Here are some examples demonstrating the capabilities of Ovis-Image.
|
|
| 58 |
</figure>
|
| 59 |
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
Ovis-Image has been tested with Python 3.10, Torch 2.6.0, and Transformers 4.57.1. For a full list of package dependencies, please see `requirements.txt`.
|
| 65 |
|
|
@@ -72,9 +94,8 @@ pip install -r requirements.txt
|
|
| 72 |
pip install -e .
|
| 73 |
```
|
| 74 |
|
| 75 |
-
## ๐ ๏ธ Inference
|
| 76 |
-
|
| 77 |
For text-to-image, please run
|
|
|
|
| 78 |
```bash
|
| 79 |
python ovis_image/test.py \
|
| 80 |
--model_path AIDC-AI/Ovis-Image-7B/ovis_image.safetensors \
|
|
@@ -84,13 +105,12 @@ python ovis_image/test.py \
|
|
| 84 |
--denoising_steps 50 \
|
| 85 |
--cfg_scale 5.0 \
|
| 86 |
--prompt "A creative 3D artistic render where the text \"OVIS-IMAGE\" is written in a bold, expressive handwritten brush style using thick, wet oil paint. The paint is a mix of vibrant rainbow colors (red, blue, yellow) swirling together like toothpaste or impasto art. You can see the ridges of the brush bristles and the glossy, wet texture of the paint. The background is a clean artist's canvas. Dynamic lighting creates soft shadows behind the floating paint strokes. Colorful, expressive, tactile texture, 4k detail." \
|
| 87 |
-
|
| 88 |
```
|
| 89 |
|
| 90 |
-
|
| 91 |
Alternatively, you can try Ovis-Image directly in your browser on [](https://huggingface.co/spaces/AIDC-AI/Ovis-Image-7B)
|
| 92 |
|
| 93 |
|
|
|
|
| 94 |
## ๐ Performance
|
| 95 |
|
| 96 |
|
|
|
|
| 58 |
</figure>
|
| 59 |
|
| 60 |
|
| 61 |
+
## ๐ ๏ธ Inference
|
| 62 |
+
|
| 63 |
+
### Inference with Diffusers
|
| 64 |
+
|
| 65 |
+
First, install the `diffusers` library with support for Ovis-Image.
|
| 66 |
+
|
| 67 |
+
```bash
|
| 68 |
+
pip install git+https://github.com/DoctorKey/diffusers.git@ovis-image
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
Next, use the `OvisImagePipeline` to generate the image.
|
| 72 |
+
|
| 73 |
+
```python
|
| 74 |
+
import torch
|
| 75 |
+
from diffusers import OvisImagePipeline
|
| 76 |
|
| 77 |
+
pipe = OvisImagePipeline.from_pretrained("AIDC-AI/Ovis-Image-7B", torch_dtype=torch.bfloat16)
|
| 78 |
+
pipe.to("cuda")
|
| 79 |
+
prompt = "A creative 3D artistic render where the text \"OVIS-IMAGE\" is written in a bold, expressive handwritten brush style using thick, wet oil paint. The paint is a mix of vibrant rainbow colors (red, blue, yellow) swirling together like toothpaste or impasto art. You can see the ridges of the brush bristles and the glossy, wet texture of the paint. The background is a clean artist's canvas. Dynamic lighting creates soft shadows behind the floating paint strokes. Colorful, expressive, tactile texture, 4k detail."
|
| 80 |
+
image = pipe(prompt, negative_prompt="", num_inference_steps=50, true_cfg_scale=5.0).images[0]
|
| 81 |
+
image.save("ovis_image.png")
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
### Inference with Pytorch
|
| 85 |
|
| 86 |
Ovis-Image has been tested with Python 3.10, Torch 2.6.0, and Transformers 4.57.1. For a full list of package dependencies, please see `requirements.txt`.
|
| 87 |
|
|
|
|
| 94 |
pip install -e .
|
| 95 |
```
|
| 96 |
|
|
|
|
|
|
|
| 97 |
For text-to-image, please run
|
| 98 |
+
|
| 99 |
```bash
|
| 100 |
python ovis_image/test.py \
|
| 101 |
--model_path AIDC-AI/Ovis-Image-7B/ovis_image.safetensors \
|
|
|
|
| 105 |
--denoising_steps 50 \
|
| 106 |
--cfg_scale 5.0 \
|
| 107 |
--prompt "A creative 3D artistic render where the text \"OVIS-IMAGE\" is written in a bold, expressive handwritten brush style using thick, wet oil paint. The paint is a mix of vibrant rainbow colors (red, blue, yellow) swirling together like toothpaste or impasto art. You can see the ridges of the brush bristles and the glossy, wet texture of the paint. The background is a clean artist's canvas. Dynamic lighting creates soft shadows behind the floating paint strokes. Colorful, expressive, tactile texture, 4k detail." \
|
|
|
|
| 108 |
```
|
| 109 |
|
|
|
|
| 110 |
Alternatively, you can try Ovis-Image directly in your browser on [](https://huggingface.co/spaces/AIDC-AI/Ovis-Image-7B)
|
| 111 |
|
| 112 |
|
| 113 |
+
|
| 114 |
## ๐ Performance
|
| 115 |
|
| 116 |
|