From a251d5e9659c67466be03b29b74ef9756e9b5c0c Mon Sep 17 00:00:00 2001 From: pinks Date: Thu, 12 Oct 2023 11:39:19 +0200 Subject: [PATCH] fix README --- README.md | 8 ++++---- app/config.ts | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c0e4e31..e5253cb 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/app/config.ts b/app/config.ts index c60c396..fdf9a15 100644 --- a/app/config.ts +++ b/app/config.ts @@ -50,12 +50,18 @@ export async function getConfig(): Promise { const configEntry = await db.get(["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, + }, + }, }; }