Skip to content

feat(web): add stable-diffusion.cpp client#823

Open
Xe wants to merge 1 commit intomasterfrom
Xe/sdcpp
Open

feat(web): add stable-diffusion.cpp client#823
Xe wants to merge 1 commit intomasterfrom
Xe/sdcpp

Conversation

@Xe
Copy link
Owner

@Xe Xe commented Jan 19, 2026

Summary

Add a Go client for the stable-diffusion.cpp HTTP server, supporting:

  • Text-to-image generation
  • Image editing (img2img)
  • Model listing
  • WebP and AVIF format conversion

Assisted-by: GLM 4.6 via Claude Code
Reviewbot-request: yes

Details

Test plan

  • Code compiles with go build ./...
  • Code formatted with npm run format
  • Manual testing

@Xe Xe self-assigned this Jan 19, 2026
@Xe
Copy link
Owner Author

Xe commented Jan 19, 2026

/reviewbot

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

  • web/sdcpp/README.md: Added comprehensive documentation for the new stable‑diffusion.cpp Go client.
  • web/sdcpp/example_test.go: Provided example test cases demonstrating typical client usage.
  • web/sdcpp/sdcpp.go: Implemented the client library with functions for image generation, editing, model listing, and image format conversion (WebP, AVIF). Includes flag handling and helper utilities.
  • web/sdcpp/sdcpp_test.go: Added extensive unit tests covering generation, editing, model listing, error handling, URL building, image decoding, and format conversion.

Suggestions

  • Verify that the external dependencies (github.com/gen2brain/avif and github.com/gen2brain/webp) are listed in go.mod so the CI can fetch them automatically.
  • Consider adding basic validation for request fields (e.g., ensuring N is within the allowed range) to provide clearer errors before making HTTP calls.

Overall, the changes compile, are well‑tested, and adhere to the repository’s guidelines.


Recommendation: Approve the pull request.

Add a Go client for the stable-diffusion.cpp HTTP server, supporting:
- Text-to-image generation
- Image editing (img2img)
- Model listing
- WebP and AVIF format conversion

Co-Authored-By: GLM 4.6 via Claude Code
Assisted-by: GLM 4.6 via Claude Code
Reviewbot-request: yes
Signed-off-by: Xe Iaso <me@xeiaso.net>
@github-actions
Copy link
Contributor

The latest Buf updates on your PR. Results from workflow Go / build (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJan 21, 2026, 6:43 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant