File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Expand file tree Collapse file tree 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
8686
8787# ## Build
8888
89+ # ### Build from scratch
90+
8991` ` ` shell
9092mkdir build
9193cd build
9294cmake ..
9395cmake --build . --config Release
9496` ` `
9597
96- # ### Using OpenBLAS
98+ # #### Using OpenBLAS
9799
98100```
99101cmake .. -DGGML_OPENBLAS=ON
@@ -151,6 +153,22 @@ Using formats of different precisions will yield results of varying quality.
151153 <img src="./assets/img2img_output.png" width="256x">
152154</p>
153155
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+
154172## Memory/Disk Requirements
155173
156174| 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