mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-11 01:24:36 +00:00
added SD samplers endpoint
This commit is contained in:
parent
b8bc500a4b
commit
d4a12133e7
2 changed files with 26 additions and 2 deletions
|
@ -894,6 +894,25 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"/sdapi/v1/samplers": {
|
||||
"get": {
|
||||
"description": "Gets a list of supported samplers.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"example": [{"name":"Euler a","aliases":["k_euler_a","k_euler_ancestral"],"options":{}},{"name":"Euler","aliases":["k_euler"],"options":{}},{"name":"Heun","aliases":["k_heun"],"options":{}},{"name":"DPM2","aliases":["k_dpm_2"],"options":{}},{"name":"DPM++ 2M","aliases":["k_dpmpp_2m"],"options":{}}]
|
||||
}
|
||||
},
|
||||
"description": "Successful request"
|
||||
}
|
||||
},
|
||||
"summary": "Gets a list of supported samplers",
|
||||
"tags": [
|
||||
"sdapi/v1"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/sdapi/v1/txt2img": {
|
||||
"post": {
|
||||
"description": "Generates an image from a text prompt, and returns a base64 encoded png.",
|
||||
|
@ -1030,8 +1049,7 @@
|
|||
}
|
||||
]
|
||||
};
|
||||
</script>
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
//self destruct into json if requested
|
||||
|
|
|
@ -978,6 +978,12 @@ Enter Prompt:<br>
|
|||
response_body = (json.dumps([{"title":friendlysdmodelname,"model_name":friendlysdmodelname,"hash":"8888888888","sha256":"8888888888888888888888888888888888888888888888888888888888888888","filename":fullsdmodelpath,"config": None}]).encode())
|
||||
elif self.path.endswith('/sdapi/v1/options'):
|
||||
response_body = (json.dumps({"samples_format":"png","sd_model_checkpoint":friendlysdmodelname}).encode())
|
||||
elif self.path.endswith('/sdapi/v1/samplers'):
|
||||
if friendlysdmodelname=="inactive" or fullsdmodelpath=="":
|
||||
response_body = (json.dumps([]).encode())
|
||||
else:
|
||||
response_body = (json.dumps([{"name":"Euler a","aliases":["k_euler_a","k_euler_ancestral"],"options":{}},{"name":"Euler","aliases":["k_euler"],"options":{}},{"name":"Heun","aliases":["k_heun"],"options":{}},{"name":"DPM2","aliases":["k_dpm_2"],"options":{}},{"name":"DPM++ 2M","aliases":["k_dpmpp_2m"],"options":{}}]).encode())
|
||||
|
||||
|
||||
elif self.path=="/api":
|
||||
content_type = 'text/html'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue