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.
- `SD_API_URL` - URL to Stable Diffusion API. Only used on first run. Default:
`http://127.0.0.1:7860/`
- `TG_ADMIN_USERS` - Comma separated list of usernames of users that can use admin commands. Only
used on first run. Optional.
- `TG_ADMIN_USERNAMES` - Comma separated list of usernames of users that can use admin commands.
Only used on first run. Optional.
## Running
@ -25,9 +25,9 @@ You can put these in `.env` file or pass them as environment variables.
## 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:
```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 config = configEntry?.value;
return {
adminUsernames: config?.adminUsernames ?? [],
adminUsernames: config?.adminUsernames ?? Deno.env.get("TG_ADMIN_USERNAMES")?.split(",") ?? [],
pausedReason: config?.pausedReason ?? null,
maxUserJobs: config?.maxUserJobs ?? Infinity,
maxJobs: config?.maxJobs ?? Infinity,
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,
},
},
};
}