Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
import { isAcceptedUploadFile } from 'common/util/uploadMediaAccept';
import { z } from 'zod';
/**
* Validates files entering via the fullscreen drag-drop / paste path.
*
* MIME type and filename extension each suffice on their own (`isAcceptedUploadFile`):
* browsers sometimes supply an empty or generic `File.type` — e.g. a `clip.mp4` dragged
* from some file managers — and requiring both signals used to reject files the backend
* upload routes would happily accept.
*/
export const zUploadFile = z.custom<File>().refine(isAcceptedUploadFile, { message: 'File type is not supported' });