15bd55d3a9
Add proxy routes for stable-diffusion.cpp's /sdapi/v1/txt2img, /sdapi/v1/img2img, and /sdapi/v1/loras endpoints. POST endpoints use proxyInferenceHandler (model in JSON body), GET /loras uses proxyGETModelHandler (model in query param). Update the image playground with a dual-mode UI supporting both OpenAI and SDAPI backends. In SDAPI mode, loras are fetched first to prime the server-side cache, and all txt2img parameters are exposed (negative prompt, steps, cfg_scale, seed, batch_size, clip_skip, sampler, scheduler, lora selection with multipliers). - Add 3 sdapi route registrations in proxymanager.go - Add sdApi.ts client with generateSdImage and fetchSdLoras - Add SDAPI types (SdApiTxt2ImgRequest, SdApiResponse, etc.) - Add /sdapi to vite dev proxy config - Add backend tests for sdapi routing - Support batch image display in gallery grid https://claude.ai/code/session_0186MGX6NXdHVBTv2KH45fqn --------- Co-authored-by: Claude <noreply@anthropic.com>
71 lines
1.8 KiB
YAML
71 lines
1.8 KiB
YAML
name: Linux CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
# only run when backend source changes
|
|
# cmd/ is excluded because it contains utilities without tests
|
|
paths:
|
|
- '**/*.go'
|
|
- '!cmd/**'
|
|
- 'go.mod'
|
|
- 'go.sum'
|
|
- 'Makefile'
|
|
- '.github/workflows/go-ci.yml'
|
|
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
paths:
|
|
- '**/*.go'
|
|
- '!cmd/**'
|
|
- 'go.mod'
|
|
- 'go.sum'
|
|
- 'Makefile'
|
|
- '.github/workflows/go-ci.yml'
|
|
|
|
# Allows manual triggering of the workflow
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
|
|
run-tests:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
# Only run in this linux based runner
|
|
- name: Check Formatting
|
|
run: |
|
|
if [ "$(gofmt -l . | grep -v 'event/.*_test.go' | wc -l)" -gt 0 ]; then
|
|
gofmt -l . | grep -v 'event/.*_test.go'
|
|
exit 1
|
|
fi
|
|
# cache simple-responder to save the build time
|
|
- name: Restore Simple Responder
|
|
id: restore-simple-responder
|
|
uses: actions/cache/restore@v4
|
|
with:
|
|
path: ./build
|
|
key: ${{ runner.os }}-simple-responder-${{ hashFiles('cmd/simple-responder/simple-responder.go') }}
|
|
|
|
# necessary for testing proxy/Process swapping
|
|
- name: Create simple-responder
|
|
run: make simple-responder
|
|
|
|
- name: Save Simple Responder
|
|
# nothing new to save ... skip this step
|
|
if: steps.restore-simple-responder.outputs.cache-hit != 'true'
|
|
id: save-simple-responder
|
|
uses: actions/cache/save@v4
|
|
with:
|
|
path: ./build
|
|
key: ${{ runner.os }}-simple-responder-${{ hashFiles('misc/simple-responder/simple-responder.go') }}
|
|
|
|
- name: Test all
|
|
run: make test-all
|