mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-15 16:55:06 -05:00
Templates are stored in nanostores. All hooks, selectors, etc are reworked to reference the nanostore.
11 lines
482 B
TypeScript
11 lines
482 B
TypeScript
import { useNodeTemplate } from 'features/nodes/hooks/useNodeTemplate';
|
|
import { getSortedFilteredFieldNames } from 'features/nodes/util/node/getSortedFilteredFieldNames';
|
|
import { map } from 'lodash-es';
|
|
import { useMemo } from 'react';
|
|
|
|
export const useOutputFieldNames = (nodeId: string): string[] => {
|
|
const template = useNodeTemplate(nodeId);
|
|
const fieldNames = useMemo(() => getSortedFilteredFieldNames(map(template.outputs)), [template.outputs]);
|
|
return fieldNames;
|
|
};
|