feat(server): add recipe-based model management (#2176) · unslothai/stable-diffusion.cpp@0518b34 · GitHub
Skip to content

Commit 0518b34

Browse files
authored
feat(server): add recipe-based model management (leejet#2176)
1 parent 9b7da27 commit 0518b34

132 files changed

Lines changed: 6683 additions & 142 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 2 additions & 0 deletions

‎.github/workflows/build.yml‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ on:
2626
"ggml",
2727
"examples/server/frontend",
2828
"examples/server/frontend/**",
29+
"start-server.sh",
30+
"start-server.bat",
2931
]
3032
pull_request:
3133
types: [opened, synchronize, reopened]
@@ -44,6 +46,8 @@ on:
4446
"ggml",
4547
"examples/server/frontend",
4648
"examples/server/frontend/**",
49+
"start-server.sh",
50+
"start-server.bat",
4751
]
4852

4953
env:
@@ -107,7 +111,8 @@ jobs:
107111
run: |
108112
cp ggml/LICENSE ./build/bin/ggml.txt
109113
cp LICENSE ./build/bin/stable-diffusion.cpp.txt
110-
zip -j sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}.zip ./build/bin/*
114+
chmod +x start-server.sh
115+
zip -j sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}.zip ./build/bin/* ./start-server.sh ./start-server.bat
111116
112117
- name: Upload artifacts
113118
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
@@ -170,7 +175,8 @@ jobs:
170175
run: |
171176
cp ggml/LICENSE ./build/bin/ggml.txt
172177
cp LICENSE ./build/bin/stable-diffusion.cpp.txt
173-
zip -j sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}-vulkan.zip ./build/bin/*
178+
chmod +x start-server.sh
179+
zip -j sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}-vulkan.zip ./build/bin/* ./start-server.sh ./start-server.bat
174180
175181
- name: Upload artifacts
176182
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
@@ -325,7 +331,8 @@ jobs:
325331
run: |
326332
cp ggml/LICENSE ./build/bin/ggml.txt
327333
cp LICENSE ./build/bin/stable-diffusion.cpp.txt
328-
zip -j sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}.zip ./build/bin/*
334+
chmod +x start-server.sh
335+
zip -j sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}.zip ./build/bin/* ./start-server.sh ./start-server.bat
329336
330337
- name: Upload artifacts
331338
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
@@ -420,7 +427,7 @@ jobs:
420427
ls .\build\bin
421428
throw "Can't find stable-diffusion.dll"
422429
}
423-
7z a sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip $filePath
430+
7z a sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip $filePath .\start-server.sh .\start-server.bat
424431
425432
- name: Copy and pack Cuda runtime
426433
id: pack_cuda_runtime
@@ -575,7 +582,7 @@ jobs:
575582
- name: Pack artifacts
576583
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
577584
run: |
578-
7z a sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-rocm-${{ env.ROCM_VERSION }}-x64.zip .\build\bin\*
585+
7z a sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-rocm-${{ env.ROCM_VERSION }}-x64.zip .\build\bin\* .\start-server.sh .\start-server.bat
579586
580587
- name: Upload artifacts
581588
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
@@ -737,7 +744,8 @@ jobs:
737744
run: |
738745
cp ggml/LICENSE ./build/bin/ggml.txt
739746
cp LICENSE ./build/bin/stable-diffusion.cpp.txt
740-
zip -y -r sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-Ubuntu-${{ env.UBUNTU_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}-rocm-${{ matrix.ROCM_VERSION }}.zip ./build/bin
747+
chmod +x start-server.sh
748+
zip -y -r sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-Ubuntu-${{ env.UBUNTU_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}-rocm-${{ matrix.ROCM_VERSION }}.zip ./build/bin ./start-server.sh ./start-server.bat
741749
742750
- name: Upload artifacts
743751
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ tests/
77
.cache/
88
*.swp
99
*.bat
10+
!/start-server.bat
11+
/start-server.local.sh
12+
/start-server.local.bat
13+
/start-server.local.ps1
1014
*.bin
1115
*.exe
1216
*.gguf

‎AGENTS.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ documentation.
8383
and debugging.
8484
* `examples/common/` - shared example support code.
8585
* `examples/server/` - server application built on top of the library.
86+
Before modifying built-in recipes, read and follow
87+
[the built-in recipe policy](examples/server/recipes/README.md).
8688
* `examples/server/frontend/` - git submodule containing independent frontend
8789
code. Avoid modifying it unless explicitly requested.
8890

‎CONTRIBUTING.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ PRs should include:
3333

3434
The [UIs list in the README](README.md#uis) only includes open-source projects that use `stable-diffusion.cpp` as a backend. Do not submit PRs to add closed-source UIs.
3535

36+
## Server Recipes
37+
38+
Before adding or changing a built-in server recipe, read and follow the
39+
[built-in recipe policy](examples/server/recipes/README.md). The policy governs
40+
native editing, community editing LoRAs, distinct task checkpoints, external
41+
adapters, native components and layer-count variants. Do not add recipes solely
42+
for style or acceleration LoRAs, separately stored native components, or added
43+
or removed model layers. Explain the task, component compatibility or capability
44+
difference that justifies a new recipe, and verify its required components,
45+
feature declarations and embedded API representation.
46+
3647
## Code Style
3748

3849
Format code according to the repository style before submitting changes.

‎examples/server/CMakeLists.txt‎

Lines changed: 13 additions & 0 deletions

0 commit comments

Comments
 (0)