feat: add admin accounts and image templates
This commit is contained in:
@@ -5,6 +5,7 @@ import { requestOrigin } from "@/lib/server/runtime";
|
||||
import { submitImageJob } from "@/lib/server/generation-service";
|
||||
import { assemblePrompt, type PromptAssemblyInput, type PromptMaterial } from "@/lib/prompt/assembler";
|
||||
import type { EnabledImageCapability } from "@/lib/types";
|
||||
import type { ImageCreationEngine } from "@/lib/evolink/image-client";
|
||||
|
||||
export const runtime = "nodejs";
|
||||
|
||||
@@ -23,6 +24,7 @@ export async function POST(request: Request) {
|
||||
const user = await requireAppUser();
|
||||
const body = await readJsonBody<{
|
||||
capability?: EnabledImageCapability;
|
||||
engine?: ImageCreationEngine;
|
||||
prompt?: string;
|
||||
imageUrls?: string[];
|
||||
materials?: PromptMaterial[];
|
||||
@@ -46,6 +48,7 @@ export async function POST(request: Request) {
|
||||
const job = await submitImageJob({
|
||||
ownerId: user.id,
|
||||
capability,
|
||||
engine: body.engine,
|
||||
prompt: body.prompt || assembled?.prompt,
|
||||
imageUrls: body.imageUrls || materialImages,
|
||||
inputAssetIds: body.inputAssetIds || (body.materials || []).map((material) => material.id).filter(Boolean) as string[],
|
||||
|
||||
Reference in New Issue
Block a user