2025-08-25 14:14:19 +08:00
|
|
|
|
## Quickstart
|
|
|
|
|
|
|
2025-08-26 18:13:06 +08:00
|
|
|
|
### 构建镜像
|
2025-08-25 14:14:19 +08:00
|
|
|
|
```bash
|
2025-08-26 18:13:06 +08:00
|
|
|
|
docker build -t diffusers:v0.1 .
|
2025-08-25 14:14:19 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
2025-08-26 18:13:06 +08:00
|
|
|
|
### 模型下载
|
|
|
|
|
|
模型地址:https://modelscope.cn/models/AI-ModelScope/stable-diffusion-v1-5
|
|
|
|
|
|
并放到目录:`/mnt/contest_ceph/zhanghao/models/stable-diffusion-v1-5`(如更改目录,请修改后面的执行脚本中的模型路径)
|
|
|
|
|
|
|
|
|
|
|
|
### 测试程序
|
|
|
|
|
|
1. 准备输入数据集,可以参考示例`dataset.json`
|
|
|
|
|
|
2. 在docker镜像里运行测试程序,会根据`dataset.json`内容,在`output`目录下生成图片文件。
|
2025-08-25 14:14:19 +08:00
|
|
|
|
```bash
|
2025-08-26 18:13:06 +08:00
|
|
|
|
./run_in_docker.sh
|
2025-08-25 14:14:19 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
2025-10-17 17:04:34 +08:00
|
|
|
|
## 测试结果对比(A100 vs 昇腾910B)
|
2025-09-04 09:53:55 +08:00
|
|
|
|
|
2025-10-17 17:04:34 +08:00
|
|
|
|
### 数据集
|
|
|
|
|
|
数据集如下:
|
|
|
|
|
|
```json
|
|
|
|
|
|
[
|
|
|
|
|
|
"A futuristic city skyline at sunset, with flying cars and neon lights, in cyberpunk style",
|
|
|
|
|
|
"A traditional Chinese courtyard covered in snow, with red lanterns glowing warmly",
|
|
|
|
|
|
"A portrait of a young woman in Renaissance style, oil painting with dramatic lighting",
|
|
|
|
|
|
"A cute baby panda playing with bamboo in a watercolor illustration style",
|
|
|
|
|
|
"A majestic dragon flying over mountains, depicted in traditional ink wash painting",
|
|
|
|
|
|
"A cozy reading corner with bookshelves, a cat on the sofa, and sunlight streaming through the window",
|
|
|
|
|
|
"A knight in silver armor riding a horse, fantasy concept art with epic background",
|
|
|
|
|
|
"A bowl of ramen with detailed toppings, hyper-realistic food photography style",
|
|
|
|
|
|
"An astronaut floating in space, reflected in the helmet visor is planet Earth",
|
|
|
|
|
|
"A serene lake surrounded by autumn trees, painted in impressionist style"
|
|
|
|
|
|
]
|
|
|
|
|
|
```
|
|
|
|
|
|
### 测试结果
|
|
|
|
|
|
|
|
|
|
|
|
| 模型 | A100 平均生成时间(秒) | 昇腾910B 平均生成时间(秒) |
|
2025-08-25 14:14:19 +08:00
|
|
|
|
|------|-------------------------|----------------------------|
|
2025-10-17 17:04:34 +08:00
|
|
|
|
| AI-ModelScope/stable-diffusion-v1-5 | 1.6208 | 7.2901 |
|
|
|
|
|
|
| zhanghaohit/karlo-v1-alpha | 3.1624 | 5.2920 |
|
|
|
|
|
|
| AI-ModelScope/stable-diffusion-3.5-medium | 5.0231 | 8.9607 |
|
|
|
|
|
|
| stabilityai/stable-diffusion-3-medium-diffusers | 3.7976 | 23.5929 |
|
2025-08-25 14:14:19 +08:00
|
|
|
|
|