forked from pinks/eris
1
0
Fork 0

fix README

This commit is contained in:
pinks 2023-10-12 11:39:19 +02:00
parent 6313c5d67e
commit a251d5e965
2 changed files with 12 additions and 6 deletions

View File

@ -15,8 +15,8 @@ You can put these in `.env` file or pass them as environment variables.
Required. Required.
- `SD_API_URL` - URL to Stable Diffusion API. Only used on first run. Default: - `SD_API_URL` - URL to Stable Diffusion API. Only used on first run. Default:
`http://127.0.0.1:7860/` `http://127.0.0.1:7860/`
- `TG_ADMIN_USERS` - Comma separated list of usernames of users that can use admin commands. Only - `TG_ADMIN_USERNAMES` - Comma separated list of usernames of users that can use admin commands.
used on first run. Optional. Only used on first run. Optional.
## Running ## Running
@ -25,9 +25,9 @@ You can put these in `.env` file or pass them as environment variables.
## Codegen ## Codegen
The Stable Diffusion API in `sd/sdApi.ts` is auto-generated. To regenerate it, first start your SD The Stable Diffusion API in `app/sdApi.ts` is auto-generated. To regenerate it, first start your SD
WebUI with `--nowebui --api`, and then run: WebUI with `--nowebui --api`, and then run:
```sh ```sh
deno run npm:openapi-typescript http://localhost:7861/openapi.json -o sd/sdApi.ts deno run npm:openapi-typescript http://localhost:7861/openapi.json -o app/sdApi.ts
``` ```

View File

@ -50,12 +50,18 @@ export async function getConfig(): Promise<Config> {
const configEntry = await db.get<Config>(["config"]); const configEntry = await db.get<Config>(["config"]);
const config = configEntry?.value; const config = configEntry?.value;
return { return {
adminUsernames: config?.adminUsernames ?? [], adminUsernames: config?.adminUsernames ?? Deno.env.get("TG_ADMIN_USERNAMES")?.split(",") ?? [],
pausedReason: config?.pausedReason ?? null, pausedReason: config?.pausedReason ?? null,
maxUserJobs: config?.maxUserJobs ?? Infinity, maxUserJobs: config?.maxUserJobs ?? Infinity,
maxJobs: config?.maxJobs ?? Infinity, maxJobs: config?.maxJobs ?? Infinity,
defaultParams: config?.defaultParams ?? {}, defaultParams: config?.defaultParams ?? {},
sdInstances: config?.sdInstances ?? {}, sdInstances: config?.sdInstances ??
{
"local": {
api: { url: Deno.env.get("SD_API_URL") ?? "http://127.0.0.1:7860/" },
maxResolution: 1024 * 1024,
},
},
}; };
} }