Instructions to use OPPOer/Qwen-Image-10B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use OPPOer/Qwen-Image-10B with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("OPPOer/Qwen-Image-10B", 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
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model:
|
| 4 |
+
- Qwen/Qwen-Image
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
- zh
|
| 8 |
+
library_name: diffusers
|
| 9 |
+
pipeline_tag: text-to-image
|
| 10 |
+
datasets:
|
| 11 |
+
- OPPOer/X2Edit-Dataset
|
| 12 |
+
---
|
| 13 |
+
<div align="center">
|
| 14 |
+
<h1>Qwen-Image-10B </h1>
|
| 15 |
+
<a href='https://github.com/OPPO-Mente-Lab/Qwen-Image-Pruning'><img src="https://img.shields.io/badge/GitHub-OPPOer-blue.svg?logo=github" alt="GitHub"></a>
|
| 16 |
+
</div>
|
| 17 |
+
|
| 18 |
+
<!-- <div align="center">
|
| 19 |
+
<img src="bench.png">
|
| 20 |
+
</div> -->
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
## Quick Start
|
| 24 |
+
|
| 25 |
+
Install the latest version of diffusers and transformers
|
| 26 |
+
```
|
| 27 |
+
pip install git+https://github.com/huggingface/diffusers
|
| 28 |
+
pip install -U transformers
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
## Inference
|
| 32 |
+
```python
|
| 33 |
+
from diffusers import DiffusionPipeline
|
| 34 |
+
import torch
|
| 35 |
+
|
| 36 |
+
device = 'cuda'
|
| 37 |
+
model_name = "OPPOer/Qwen-Image-10B"
|
| 38 |
+
pipe = DiffusionPipeline.from_pretrained(model_name, torch_dtype=torch.bfloat16)
|
| 39 |
+
pipe = pipe.to(device)
|
| 40 |
+
|
| 41 |
+
positive_magic = {"en": ", Ultra HD, 4K, cinematic composition.", # for english prompt,
|
| 42 |
+
"zh": ",超清,4K,电影级构图。" # for chinese prompt,
|
| 43 |
+
}
|
| 44 |
+
negative_prompt = " "
|
| 45 |
+
|
| 46 |
+
prompts = [
|
| 47 |
+
'''阳光明媚的一天,繁忙的游乐园入口处挂满了五彩缤纷的横幅。入口上方悬挂着一条醒目的横幅,用清晰粗体的字母写着:“欢迎来到冒险王国,乐趣永无止境!”在问候语下方,稍小一些的文字写着:
|
| 48 |
+
“体验惊险刺激的游乐设施、美味可口的美食和难忘的家庭时光”。售票处附近的小型横幅用易读的文字标明:“工作日折扣:12岁以下儿童五折!”以及“年卡持有者专属通道”。其他附近标识牌显示着“园区每日上午10点至晚上9点开放”等信息。游客们稍作停
|
| 49 |
+
留,阅读这些引人注目且充满吸引力的文字信息后,兴奋地朝公园入口走去。''',
|
| 50 |
+
'一个穿着"QWEN"标志的T恤的中国美女正拿着黑色的马克笔面相镜头微笑。她身后的玻璃板上手写体写着 "一、Qwen-Image的技术路线: 探索视觉生成基础模型的极限,开创理解与生成一体化的未来。二、Qwen-Image的模型特色:1、复杂文字渲染。支持中英渲染、自动布局; 2、精准图像编辑。支持文字编辑、物体增减、风格变换。三、Qwen-Image的未来愿景:赋能专业内容创作、助力生成式AI发展。"',
|
| 51 |
+
'海报,温馨家庭场景,柔和阳光洒在野餐布上,色彩温暖明亮,主色调为浅黄、米白与淡绿,点缀着鲜艳的水果和野花,营造轻松愉快的氛围,画面简洁而富有层次,充满生活气息,传达家庭团聚与自然和谐的主题。文字内容:“共享阳光,共享爱。全家一起野餐,享受美好时光。让每一刻都充满欢笑与温暖。”',
|
| 52 |
+
'一个穿着校服的年轻女孩站在教室里,在黑板上写字。黑板中央用整洁的白粉笔写着“Introducing Qwen-Image, a foundational image generation model that excels in complex text rendering and precise image editing”。柔和的自然光线透过窗户,投下温柔的阴影。场景以写实的摄影风格呈现,细节精细,景深浅,色调温暖。女孩专注的表情和空气中的粉笔灰增添了动感。背景元素包括课桌和教育海报,略微模糊以突出中心动作。超精细32K分辨率,单反质量,柔和的散景效果,纪录片式的构图。',
|
| 53 |
+
'一个台球桌上放着两排台球,每排5个,第一行的台球上面分别写着"Qwen""Image" "将 "于" "8" ,第二排台球上面分别写着"月" "正" "式" "发" "布" 。',
|
| 54 |
+
'海报,未来科技感背景,深蓝色与银灰色为主色调,点缀荧光绿与橙色线条,营造出高科技与未来感,渐变层次丰富,立体感强,现代感十足,简洁而富有张力,极简主义风格。海报上写着 "一、智能交通指挥系统:打造未来城市交通的智慧大脑,实现高效、安全、绿色的出行体验。二、系统功能:1、实时交通监控与分析;2、智能信号调控与优化;3、多模态数据整合与预测。三、未来愿景:构建智慧交通网络,推动城市可持续发展。"',
|
| 55 |
+
]
|
| 56 |
+
|
| 57 |
+
for prompt in prompts:
|
| 58 |
+
image = pipe(
|
| 59 |
+
prompt=prompt + positive_magic['zh'],
|
| 60 |
+
negative_prompt=negative_prompt,
|
| 61 |
+
width=1328,
|
| 62 |
+
height=1328,
|
| 63 |
+
num_inference_steps=40,
|
| 64 |
+
true_cfg_scale=4.0,
|
| 65 |
+
generator=torch.Generator(device=device).manual_seed(42)
|
| 66 |
+
).images[0]
|
| 67 |
+
image.save(f'{prompt[:80]}.png')
|
| 68 |
+
```
|