Skip to content

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.

754 B
Raw Blame
import type { GraphBearingSurfaceContract, WidgetManifest, WorkbenchRegion } from '@workbench/widgetContracts';

import { isInvocationSourceAvailable } from './invocation';

export const createGraphBearingSurface = (
  manifest: WidgetManifest,
  region: WorkbenchRegion,
  label: string
): GraphBearingSurfaceContract | null => {
  const graphBearing = manifest.graphBearing;

  if (!graphBearing || !graphBearing.surfaces.includes(region)) {
    return null;
  }

  return {
    canPreviewGraph: true,
    canSetSource: isInvocationSourceAvailable(graphBearing.sourceId),
    graphId: graphBearing.defaultGraphId,
    label,
    region,
    sourceId: graphBearing.sourceId,
    surfaceId: `${manifest.id}:${region}`,
    widgetId: manifest.id,
  };
};