Add an AIGen-only generate API for external tools.
Cursor and similar clients can enqueue Studio 2 stills with the same steps and CFG the bench uses, through session or AIGEN_API_KEY. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
} from '~/utils/keepPrompts'
|
||||
import { familyBaseName, nextClipPartName, clipPartLabel } from '~/utils/libraryBrowse'
|
||||
import { musicExtension } from '~/utils/music'
|
||||
import { aigenBearerAuthorized, aigenInstanceOwnerKey } from '~/server/utils/aigenApiAuth'
|
||||
|
||||
export { familyBaseName, nextClipPartName, clipPartLabel }
|
||||
|
||||
@@ -197,6 +198,8 @@ export function libraryRoot() {
|
||||
|
||||
export function libraryOwnerKey(event: H3Event) {
|
||||
if (passwordAuthEnabled()) return privateInstanceId()
|
||||
// AIGen API key: same catalog as the unauthenticated local owner. Never invent a second tree.
|
||||
if (aigenBearerAuthorized(event)) return aigenInstanceOwnerKey()
|
||||
const user = getSessionUser(event)
|
||||
const raw = user?.sub || user?.email || (!authEnabled() ? 'local' : '')
|
||||
if (!raw) {
|
||||
|
||||
Reference in New Issue
Block a user