Spaces:
Sleeping
Sleeping
Download src/app/queries/getDynamicConfig.ts from network01/ai-comic-factory: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/spaces/network01/ai-comic-factory/resolve/main/src/app/queries/getDynamicConfig.ts
- Command line
-
hf download hf://spaces/network01/ai-comic-factory/src/app/queries/getDynamicConfig.ts
-
curl -L -o getDynamicConfig.ts https://huggingface.co/spaces/network01/ai-comic-factory/resolve/main/src/app/queries/getDynamicConfig.ts
1.05 kB
| "use server" | |
| import { getValidBoolean } from "@/lib/getValidBoolean" | |
| import { getValidNumber } from "@/lib/getValidNumber" | |
| import { getValidString } from "@/lib/getValidString" | |
| import { DynamicConfig } from "@/types" | |
| export async function getDynamicConfig(): Promise<DynamicConfig> { | |
| const maxNbPages = getValidNumber(process.env.MAX_NB_PAGES, 1, Number.MAX_SAFE_INTEGER, 1) | |
| const nbPanelsPerPage = 4 // for now this is static | |
| const nbTotalPanelsToGenerate = maxNbPages * nbPanelsPerPage | |
| const config = { | |
| maxNbPages, | |
| nbPanelsPerPage, | |
| nbTotalPanelsToGenerate, | |
| oauthClientId: getValidString(process.env.HUGGING_FACE_OAUTH_CLIENT_ID, ""), | |
| // this doesn't work (conceptually) | |
| oauthRedirectUrl: getValidString(process.env.HUGGING_FACE_OAUTH_REDIRECT_URL, ""), | |
| oauthScopes: "openid profile inference-api", | |
| enableHuggingFaceOAuth: getValidBoolean(process.env.ENABLE_HUGGING_FACE_OAUTH, false), | |
| enableHuggingFaceOAuthWall: getValidBoolean(process.env.ENABLE_HUGGING_FACE_OAUTH_WALL, false), | |
| } | |
| return config | |
| } |