mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-16 21:41:28 -05:00
Rolled back the earlier split of the refiner model query. Now, when you use `useGetMainModelsQuery()`, you must provide it an array of base model types. They are provided as constants for simplicity: - ALL_BASE_MODELS - NON_REFINER_BASE_MODELS - REFINER_BASE_MODELS Opted to just use args for the hook instead of wrapping the hook in another hook, we can tidy this up later if desired.
13 lines
405 B
TypeScript
13 lines
405 B
TypeScript
import { REFINER_BASE_MODELS } from 'services/api/constants';
|
|
import { useGetMainModelsQuery } from 'services/api/endpoints/models';
|
|
|
|
export const useIsRefinerAvailable = () => {
|
|
const { isRefinerAvailable } = useGetMainModelsQuery(REFINER_BASE_MODELS, {
|
|
selectFromResult: ({ data }) => ({
|
|
isRefinerAvailable: data ? data.ids.length > 0 : false,
|
|
}),
|
|
});
|
|
|
|
return isRefinerAvailable;
|
|
};
|