-
Notifications
You must be signed in to change notification settings - Fork 456
Very simple http server #367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
stduhpf
wants to merge
75
commits into
leejet:master
Choose a base branch
from
stduhpf:server
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
af79e9e
Add server example
stduhpf 4b92c60
server: remove pingpong endpoint
stduhpf c30eb9e
Server: Fix missing return on non-void function
stduhpf 1a35a45
Server: change default host
stduhpf fdc38b6
Server: Fix printf
stduhpf 043cc62
server: move httplib to thirdparty folder
stduhpf 4c851d8
Server: accept json inputs + return bas64 image
stduhpf 185f218
server: use t.join() instead of infinite loop
stduhpf c52c9c5
server: fix CI Build
stduhpf 181a354
server: attach image metadata in response
stduhpf f0ce3ec
server: add simple client script
stduhpf 45797b5
Server: add client docstrings
stduhpf bb05737
server: client: fix image preview on non-windows os
stduhpf f845f41
server: support sampling method arg
stduhpf 5a51e7d
server: small test client fixes
stduhpf 28d7ee0
Try adding photomaker support
stduhpf 2636107
server: update
stduhpf b9d1fb8
server: update and refacor (add queue)
stduhpf 38bfcba
server: update samplers and schedulers
stduhpf 8364bba
global running task_id
stduhpf 4d17555
basic webui
stduhpf db963ee
Make server ui better
stduhpf 9ad1d3a
Fixes
stduhpf db9f47f
Frontend: dirty queue display
stduhpf 614fb30
server: do not block when loading
stduhpf ed66505
server: fix queue
stduhpf b876341
server: allow to unload model components
stduhpf f76afb9
Frontend: qol
stduhpf 750c823
Use progress_callback
stduhpf a36a508
update progress bars (+fixes)
stduhpf c281f15
frontend.cpp: use relative paths in fetch() (#4) (cherry-picked)
mord0d 5095ff2
rebaseon master and apply api changes
stduhpf 6553235
server: update api
stduhpf cfa17db
server: use new naming convention
stduhpf 57aed4f
server: change API
stduhpf 818fd14
server: redirect base path to ui
stduhpf f8e9b3d
server: update lib api (fix build)
stduhpf b643de1
server: enable previews
stduhpf c5c0085
server: fix default shift (+format code)
stduhpf 9044052
sd.h API changes again
stduhpf b4386fc
server: refactor args parsing (same as cli)
stduhpf f997056
server: refactor inner params to match api
stduhpf bc2ece7
fix small order of operation mistake
stduhpf 10a591a
server: clean launch args
stduhpf 8757cd9
server: refactor prompt json parsing + new API (kept legacy API worki…
stduhpf 33d4f5e
server: implement some stuff
stduhpf 68bc7e3
fix sd_ctx leak
stduhpf 5639836
server: fix ctx not reliably updating when it should
stduhpf a706b33
do not expose lora dir
stduhpf 7354bbf
implement even more stuff
stduhpf a083d8e
Support Qwen
stduhpf 0ddd3da
Fix http code for task not found
stduhpf 34847c7
support init_image (basic img2img)
stduhpf e104251
add (ai-generated) openAPI documentation
stduhpf ea7db7d
fix documentation
stduhpf 0f1843a
add support for mask, ref_images and control image (flex.2)
stduhpf ff9588d
update API doc
stduhpf 4273723
server: support photomaker and controlnets
stduhpf b796278
fix
stduhpf 495977c
fix mistake in docs
stduhpf 47e46bc
Fix more LLM mistakes in doc
stduhpf 979f089
Fix symlink handling
stduhpf 14f15a8
Fix invalid paths with missing trailing /
stduhpf 968025d
fix mask_image channels + remove duplicated preview_interval parsing
stduhpf de5dd79
Load user-provided front-ends
stduhpf 752bbd4
docs: fix
stduhpf 060b579
improve docs
stduhpf 9602849
fix img2img channels
stduhpf 84d1736
docs: small fix
stduhpf 913c657
Fix useless ctx reload when ctx gen options are specified but kept th…
stduhpf 5fa7017
update api again
stduhpf fef1a4c
server: rebase on lastest master
stduhpf 3952d59
qwen2vl -> llm
stduhpf 6ded7f0
server: refactor
stduhpf c88cdee
rebase
stduhpf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| include_directories(${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| add_subdirectory(cli) | ||
| add_subdirectory(cli) | ||
| add_subdirectory(server) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| set(TARGET sd-server) | ||
|
|
||
| add_executable(${TARGET} main.cpp) | ||
| install(TARGETS ${TARGET} RUNTIME) | ||
| target_link_libraries(${TARGET} PRIVATE stable-diffusion ${CMAKE_THREAD_LIBS_INIT}) | ||
| target_compile_features(${TARGET} PUBLIC cxx_std_17) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
|
|
||
| //FROM | ||
| //https://stackoverflow.com/a/34571089/5155484 | ||
|
|
||
| static const std::string b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";//= | ||
| static std::string base64_encode(const std::string &in) { | ||
| std::string out; | ||
|
|
||
| int val=0, valb=-6; | ||
| for (uint8_t c : in) { | ||
| val = (val<<8) + c; | ||
| valb += 8; | ||
| while (valb>=0) { | ||
| out.push_back(b[(val>>valb)&0x3F]); | ||
| valb-=6; | ||
| } | ||
| } | ||
| if (valb>-6) out.push_back(b[((val<<8)>>(valb+8))&0x3F]); | ||
| while (out.size()%4) out.push_back('='); | ||
| return out; | ||
| } | ||
|
|
||
|
|
||
| static std::string base64_decode(const std::string &in) { | ||
|
|
||
| std::string out; | ||
|
|
||
| std::vector<int> T(256,-1); | ||
| for (int i=0; i<64; i++) T[b[i]] = i; | ||
|
|
||
| int val=0, valb=-8; | ||
| for (uint8_t c : in) { | ||
| if (T[c] == -1) break; | ||
| val = (val<<6) + T[c]; | ||
| valb += 6; | ||
| if (valb>=0) { | ||
| out.push_back(char((val>>valb)&0xFF)); | ||
| valb-=8; | ||
| } | ||
| } | ||
| return out; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename to
b64.hpp?