Browse Source

Update 'source.md'

天问 1 year ago
parent
commit
590a69579c
1 changed files with 27 additions and 0 deletions
  1. 27 0
      source.md

+ 27 - 0
source.md

@@ -29,4 +29,31 @@ tree
 
 源码构建,
 
+```
+git clone https://github.com/alibaba/MNN.git
+cd MNN
+mkdir build
+cmake -DMNN_BUILD_OPENCV=ON -DMNN_IMGCODECS=ON ..
+make -j8
+# 编译生成 libMNN.so文件
+cp libMNN.so express/libMNN_Express.so tools/cv/libMNNOpenCV.so /path/to/stable-diffusion-mnn/libs
+
+```
+
 
+```
+# 下载权重
+cd resource
+wget https://github.com/wangzhaode/stable-diffusion-mnn/releases/download/v0.1/text_encoder.mnn
+wget https://github.com/wangzhaode/stable-diffusion-mnn/releases/download/v0.1/vae_decoder.mnn
+wget https://github.com/wangzhaode/stable-diffusion-mnn/releases/download/v0.1/unet.mnn
+
+# 执行
+mkdir build
+cd build
+cmake ..
+make -j4
+./main "飞流直下三千尺,疑是银河落九天,唐诗,水墨,国画。" demo.jpg
+[##################################################]  [100%] [iter time: 411.441000 ms]
+SUCCESS! write to demo.jpg
+```