Green-Sky commited on
Commit
6e45cff
·
unverified ·
1 Parent(s): 345534c

setup sdcpp and dl model

Browse files
Files changed (2) hide show
  1. Dockerfile +40 -0
  2. README.md +3 -0
Dockerfile ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM debian:13
2
+
3
+ RUN apt update && apt install -y git gcc g++ cmake ninja-build wget npm
4
+
5
+ RUN npm install -g pnpm
6
+
7
+ RUN node -v && pnpm -v
8
+
9
+ # make sd.cpp
10
+ WORKDIR /app
11
+
12
+ RUN git clone --recursive https://github.com/leejet/stable-diffusion.cpp.git
13
+
14
+ WORKDIR /app/stable-diffusion.cpp/build
15
+
16
+ RUN cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release && cmake --build . -j 1
17
+
18
+ # fetch a model
19
+ WORKDIR /app/models
20
+
21
+ RUN wget 'https://huggingface.co/akleine/sdxs-512/resolve/main/sdxs.safetensors'
22
+
23
+ # prep launch
24
+ WORKDIR /app
25
+
26
+ RUN <<EOF cat > /app/entrypoint.sh
27
+ #!/bin/bash
28
+ set -e
29
+
30
+ cd /app
31
+ echo "starting..."
32
+
33
+ free -h
34
+
35
+ stable-diffusion.cpp/build/bin/sd-server -m models/sdxs.safetensors -l 0.0.0.0 -p 1234 -v --cfg-scale 1 --steps 1
36
+ EOF
37
+
38
+ RUN chmod +x /app/entrypoint.sh
39
+
40
+ ENTRYPOINT ["/app/entrypoint.sh"]
README.md CHANGED
@@ -6,6 +6,9 @@ colorTo: gray
6
  sdk: docker
7
  pinned: false
8
  short_description: stable-diffusion.cpp in server mode
 
 
 
9
  ---
10
 
11
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
6
  sdk: docker
7
  pinned: false
8
  short_description: stable-diffusion.cpp in server mode
9
+ app_port: 1234
10
+ startup_duration_timeout: 20m
11
+ models: [akleine/sdxs-512]
12
  ---
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference