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 { galleryImages } from '@features/gallery';
import { ApiError } from '@platform/transport/http';
/**
* The metadata a Model only upscale copies into its result. Null when the image has none (an upload) or the server no
* longer has it; any other failure throws, so the run is not queued without the metadata it should carry. Callers load
* this module on demand, keeping its gallery read out of the editor's startup graph.
*/
export const readUpscaleSourceMetadata = async (
imageName: string,
signal?: AbortSignal
): Promise<Record<string, unknown> | null> => {
try {
return await galleryImages.metadata(imageName, signal);
} catch (error) {
if (error instanceof ApiError && error.status === 404) {
return null;
}
throw error;
}
};