File tree 3 files changed +42
-1
lines changed 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change
1
+ build * /
2
+ test /
3
+
4
+ .cache /
5
+ * .swp
6
+ models /
Original file line number Diff line number Diff line change
1
+ ARG UBUNTU_VERSION=22.04
2
+
3
+ FROM ubuntu:$UBUNTU_VERSION as build
4
+
5
+ RUN apt-get update && apt-get install -y build-essential git cmake
6
+
7
+ WORKDIR /sd.cpp
8
+
9
+ COPY . .
10
+
11
+ RUN mkdir build && cd build && cmake .. && cmake --build . --config Release
12
+
13
+ FROM ubuntu:$UBUNTU_VERSION as runtime
14
+
15
+ COPY --from=build /sd.cpp/build/bin/sd /sd
16
+
17
+ ENTRYPOINT [ "/sd" ]
Original file line number Diff line number Diff line change @@ -86,14 +86,16 @@ You can specify the output model format using the --out_type parameter
86
86
87
87
# ## Build
88
88
89
+ # ### Build from scratch
90
+
89
91
` ` ` shell
90
92
mkdir build
91
93
cd build
92
94
cmake ..
93
95
cmake --build . --config Release
94
96
` ` `
95
97
96
- # ### Using OpenBLAS
98
+ # #### Using OpenBLAS
97
99
98
100
```
99
101
cmake .. -DGGML_OPENBLAS=ON
@@ -151,6 +153,22 @@ Using formats of different precisions will yield results of varying quality.
151
153
<img src="./assets/img2img_output.png" width="256x">
152
154
</p>
153
155
156
+ ### Docker
157
+
158
+ #### Building using Docker
159
+
160
+ ```shell
161
+ docker build -t sd .
162
+ ```
163
+
164
+ #### Run
165
+
166
+ ``` shell
167
+ docker run -v /path/to/models:/models -v /path/to/output/:/output sd [args...]
168
+ # For example
169
+ # docker run -v ./models:/models -v ./build:/output sd -m /models/sd-v1-4-ggml-model-f16.bin -p "a lovely cat" -v -o /output/output.png
170
+ ```
171
+
154
172
## Memory/Disk Requirements
155
173
156
174
| precision | f32 | f16 | q8_0 | q5_0 | q5_1 | q4_0 | q4_1 |
You can’t perform that action at this time.
0 commit comments