Stable-Diffusion-ONNX-FP16 项目教程

Stable-Diffusion-ONNX-FP16 项目教程

Stable-Diffusion-ONNX-FP16Example code and documentation on how to get Stable Diffusion running with ONNX FP16 models on DirectML. Can run accelerated on all DirectML supported cards including AMD and Intel.项目地址:https://gitcode.com/gh_mirrors/st/Stable-Diffusion-ONNX-FP16

1. 项目的目录结构及介绍

Stable-Diffusion-ONNX-FP16/
├── conv_sd_to_onnx.py
├── model/
├── README.md
├── requirements.txt
├── run-batch.md
├── run-batch.py
├── test-controlnet-canny.py
├── test-controlnet-openpose.py
├── test-txt2img.py
├── v1-inference.yaml
└── v1-inpainting-inference.yaml
  • conv_sd_to_onnx.py: 用于将Stable Diffusion模型转换为ONNX格式的脚本。
  • model/: 存储转换后的ONNX模型文件。
  • README.md: 项目说明文档。
  • requirements.txt: 项目依赖文件。
  • run-batch.md: 批处理运行说明文档。
  • run-batch.py: 批处理运行脚本。
  • test-controlnet-canny.py: 测试ControlNet Canny模型的脚本。
  • test-controlnet-openpose.py: 测试ControlNet OpenPose模型的脚本。
  • test-txt2img.py: 测试文本到图像生成功能的脚本。
  • v1-inference.yaml: 推理配置文件。
  • v1-inpainting-inference.yaml: 修复推理配置文件。

2. 项目的启动文件介绍

conv_sd_to_onnx.py

该脚本用于将Stable Diffusion模型转换为ONNX格式。使用方法如下:

python conv_sd_to_onnx.py --model_path "stabilityai/stable-diffusion-2-1-base" --output_path "model/sd2_1base-fp32"
python conv_sd_to_onnx.py --model_path "stabilityai/stable-diffusion-2-1-base" --output_path "model/sd2_1base-fp16" --fp16

test-txt2img.py

该脚本用于测试文本到图像生成功能。使用方法如下:

python test-txt2img.py --model "model/sd2_1base-fp32" --size 512 --seed 0
python test-txt2img.py --model "model/sd2_1base-fp16" --size 512 --seed 0

3. 项目的配置文件介绍

v1-inference.yaml

该配置文件用于推理过程的设置,包括模型路径、输入输出配置等。

v1-inpainting-inference.yaml

该配置文件用于修复推理过程的设置,包括模型路径、输入输出配置等。

以上是Stable-Diffusion-ONNX-FP16项目的基本教程,涵盖了项目的目录结构、启动文件和配置文件的介绍。希望对您有所帮助!

Stable-Diffusion-ONNX-FP16Example code and documentation on how to get Stable Diffusion running with ONNX FP16 models on DirectML. Can run accelerated on all DirectML supported cards including AMD and Intel.项目地址:https://gitcode.com/gh_mirrors/st/Stable-Diffusion-ONNX-FP16

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

伏葵飚Anastasia

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值