Had to add absolute pathing for SILERO_SAMPLES_PATH, SILERO_SAMPLE_TEXT, & audio to set the extras directory based on the parent folder. Because of STSL dynamic install locations they were getting placed in the STSL folder instead of extras.
Should not effect regular launching via python.
Inverting the use of float16 with SD on cuda was introduced with my MPS
hack. Fixed.
Also, make the MPS changes more consistent with cuda_device, since we
don't need a hardcoded value any more.
When the extras server was hosted publicly, there was a huge security
risk of anyone finding a cloudflare tunnel URL and directly querying
API routes.
However, this had a simple solution of implementing middleware to check
if a generated API key is valid. Since the server is simple, the API
key is a string of bytes stored in a textfile. If that textfile is
deleted, extras will automatically create a new API key/textfile.
Additionally, this is enabled via an optional argument to prevent
local user irritation.
Signed-off-by: kingbri <bdashore3@proton.me>
ChromaDB can be run in a remote context using docker. However, there
is no inbuilt authentication solution yet according to the documentation.
Therefore, this method is only useful if a user want to connect to an
unauthenticated ChromaDB instance. Only use this on a local network
or with mesh solutions such as Tailscale/Zerotier.
Signed-off-by: kingbri <bdashore3@proton.me>
Added sd endpoints for getting available models, current model, available samplers and setting the current model. In addition, added the ability to set the sampler, steps, cfg and model with the '/api/image' API call.