hotfix: adapt new fal response (#7480)

This commit is contained in:
darkskygit
2024-07-12 03:22:03 +00:00
parent 4591b3391e
commit 5f16cb400d

View File

@@ -28,10 +28,10 @@ export type FalConfig = {
const FalImageSchema = z const FalImageSchema = z
.object({ .object({
url: z.string(), url: z.string(),
seed: z.number().optional(), seed: z.number().nullable().optional(),
content_type: z.string(), content_type: z.string(),
file_name: z.string().optional(), file_name: z.string().nullable().optional(),
file_size: z.number().optional(), file_size: z.number().nullable().optional(),
width: z.number(), width: z.number(),
height: z.number(), height: z.number(),
}) })
@@ -46,9 +46,9 @@ const FalResponseSchema = z.object({
z.string(), z.string(),
]) ])
.optional(), .optional(),
images: z.array(FalImageSchema).optional(), images: z.array(FalImageSchema).nullable().optional(),
image: FalImageSchema.optional(), image: FalImageSchema.nullable().optional(),
output: z.string().optional(), output: z.string().nullable().optional(),
}); });
type FalResponse = z.infer<typeof FalResponseSchema>; type FalResponse = z.infer<typeof FalResponseSchema>;