2025-10-17 17:04:34 +08:00
2025-08-20 17:53:15 +08:00
2025-09-04 10:26:21 +08:00
2025-09-03 10:16:24 +08:00
2025-10-17 17:04:34 +08:00
2025-09-16 14:20:59 +08:00
2025-09-03 10:16:24 +08:00

Quickstart

构建镜像

docker build -t diffusers:v0.1 .

模型下载

模型地址: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目录下生成图片文件。
./run_in_docker.sh

测试结果对比A100 vs 昇腾910B

数据集

数据集如下:

[
    "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 平均生成时间(秒)
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
Description
运行于【昇腾-910B4】系列算力卡的【文本生成图片】引擎,基于 diffusion 架构,支持 Stable Diffusion 等最新流行模型
Readme 50 KiB
Languages
Python 90.1%
Shell 8.1%
Dockerfile 1.8%