Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
stablediffusion_migraphx
Commits
cfb6b1cd
Commit
cfb6b1cd
authored
Jun 20, 2024
by
yaoht
Browse files
修改readme
parent
8eeafb19
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
4 deletions
+11
-4
README.md
README.md
+11
-4
text_encoder.png
text_encoder.png
+0
-0
unet.png
unet.png
+0
-0
vae.png
vae.png
+0
-0
No files found.
README.md
View file @
cfb6b1cd
...
...
@@ -15,6 +15,11 @@ https://arxiv.org/pdf/2010.02502
输入文本信息,再用random函数生成一个高斯噪声矩阵 作为Latent Feature(隐空间特征)的“替代” 输入到SD模型的 “图像优化模块” 中;
首先图像优化模块是由U-Net网络和Schedule算法 组成,将图像优化模块进行优化迭代后的Latent Feature输入到 图像解码器 (VAE Decoder) 中,将Latent Feature重建成像素级图。
<img
src=
./text_encoder.png
style=
"zoom:100%;"
align=
middle
>
<img
src=
./unet.png
style=
"zoom:100%;"
align=
middle
>
<img
src=
./vae.png
style=
"zoom:100%;"
align=
middle
>
## 环境配置
...
...
@@ -53,13 +58,13 @@ source /opt/dtk/env.sh
## 环境配置
###
#
设置环境变量
### 设置环境变量
```
shell
export
PYTHONPATH
=
/opt/dtk/lib:
$PYTHONPATH
```
###
#
安装依赖
### 安装依赖
```
shell
# 进入python示例目录
...
...
@@ -68,19 +73,21 @@ cd <path_to_sd2.1_migraphx>
# 安装依赖
pip
install
-r
requirements.txt
-i
https://pypi.tuna.tsinghua.edu.cn/simple
```
###
#
模型下载
### 模型下载
百度云下载 链接:https://pan.baidu.com/s/1JgJ0WUlhpey-ALsA48iyWw?pwd=mpp1 提取码:mpp1 下载后模型的目录为sd21-onnx,下面运行示例命令中的onnx-model-path参数就设置为该onnx模型目录。
## 推理
### 运行示例
stablediffusion_v2.1模型的推理示例程序是Diffusion_test_offload_false.py,使用如下命令运行该推理示例:
```
shell
python Diffusion_test_offload_false.py
--prompt
"a photograph of an astronaut riding a horse"
--seed
13
--output
astro_horse.jpg
--steps
50
--fp16
all
--onnx-model-path
sd21-onnx
```
## result
##
#
result
推理结果:
...
...
text_encoder.png
0 → 100644
View file @
cfb6b1cd
70.3 KB
unet.png
0 → 100644
View file @
cfb6b1cd
51.2 KB
vae.png
0 → 100644
View file @
cfb6b1cd
57.9 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment