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.

498 B
Raw Blame
import { skipToken } from '@reduxjs/toolkit/query';
import { useGetImageWorkflowQuery } from 'services/api/endpoints/images';
import type { ImageDTO } from 'services/api/types';
import { useDebounce } from 'use-debounce';

export const useDebouncedImageWorkflow = (imageDTO?: ImageDTO | null) => {
  const [debouncedImageName] = useDebounce(imageDTO?.has_workflow ? imageDTO.image_name : null, 300);

  const result = useGetImageWorkflowQuery(debouncedImageName ?? skipToken);

  return result;
};