feat: add custom image inputs
This commit is contained in:
@@ -10,6 +10,7 @@ import { z } from "zod";
|
||||
|
||||
const Request = z.object({
|
||||
deployment_id: z.string(),
|
||||
inputs: z.record(z.string()).optional(),
|
||||
});
|
||||
|
||||
const Request2 = z.object({
|
||||
@@ -48,7 +49,7 @@ export async function POST(request: Request) {
|
||||
|
||||
const origin = new URL(request.url).origin;
|
||||
|
||||
const { deployment_id } = data;
|
||||
const { deployment_id, inputs } = data;
|
||||
|
||||
try {
|
||||
const deploymentData = await db.query.deploymentsTable.findFirst({
|
||||
@@ -60,7 +61,8 @@ export async function POST(request: Request) {
|
||||
const run_id = await createRun(
|
||||
origin,
|
||||
deploymentData.workflow_version_id,
|
||||
deploymentData.machine_id
|
||||
deploymentData.machine_id,
|
||||
inputs
|
||||
);
|
||||
|
||||
return NextResponse.json(
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { replaceCDNUrl } from "@/server/resource";
|
||||
import { NextResponse, type NextRequest } from "next/server";
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
const file = new URL(request.url).searchParams.get("file");
|
||||
console.log(`${process.env.SPACES_ENDPOINT}/comfyui-deploy/${file}`);
|
||||
// console.log(`${process.env.SPACES_ENDPOINT}/comfyui-deploy/${file}`);
|
||||
return NextResponse.redirect(
|
||||
`${process.env.SPACES_ENDPOINT}/comfyui-deploy/${file}`
|
||||
replaceCDNUrl(`${process.env.SPACES_ENDPOINT}/comfyui-deploy/${file}`)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user