mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
First pass at frontend integration for FLUX Redux and SigLIP model types.
This commit is contained in:
committed by
psychedelicious
parent
9c542ed655
commit
7b48ef2264
@@ -15,6 +15,7 @@ import {
|
||||
isControlLoRAModelConfig,
|
||||
isControlNetModelConfig,
|
||||
isFluxMainModelModelConfig,
|
||||
isFluxReduxModelConfig,
|
||||
isFluxVAEModelConfig,
|
||||
isIPAdapterModelConfig,
|
||||
isLoRAModelConfig,
|
||||
@@ -23,6 +24,7 @@ import {
|
||||
isRefinerMainModelModelConfig,
|
||||
isSD3MainModelModelConfig,
|
||||
isSDXLMainModelModelConfig,
|
||||
isSigLipModelConfig,
|
||||
isSpandrelImageToImageModelConfig,
|
||||
isT2IAdapterModelConfig,
|
||||
isT5EncoderModelConfig,
|
||||
@@ -74,6 +76,8 @@ export const useVAEModels = (args?: ModelHookArgs) => buildModelsHook(isVAEModel
|
||||
export const useFluxVAEModels = (args?: ModelHookArgs) =>
|
||||
buildModelsHook(isFluxVAEModelConfig, args?.excludeSubmodels)();
|
||||
export const useCLIPVisionModels = buildModelsHook(isCLIPVisionModelConfig);
|
||||
export const useSigLipModels = buildModelsHook(isSigLipModelConfig);
|
||||
export const useFluxReduxModels = buildModelsHook(isFluxReduxModelConfig);
|
||||
|
||||
// const buildModelsSelector =
|
||||
// <T extends AnyModelConfig>(typeGuard: (config: AnyModelConfig) => config is T): Selector<RootState, T[]> =>
|
||||
|
||||
@@ -62,6 +62,8 @@ type TextualInversionModelConfig = S['TextualInversionFileConfig'] | S['TextualI
|
||||
type DiffusersModelConfig = S['MainDiffusersConfig'];
|
||||
export type CheckpointModelConfig = S['MainCheckpointConfig'];
|
||||
type CLIPVisionDiffusersConfig = S['CLIPVisionDiffusersConfig'];
|
||||
export type SigLipModelConfig = S['SigLIPConfig'];
|
||||
export type FluxReduxModelConfig = S['FluxReduxConfig'];
|
||||
export type MainModelConfig = DiffusersModelConfig | CheckpointModelConfig;
|
||||
export type AnyModelConfig =
|
||||
| ControlLoRAModelConfig
|
||||
@@ -76,7 +78,9 @@ export type AnyModelConfig =
|
||||
| SpandrelImageToImageModelConfig
|
||||
| TextualInversionModelConfig
|
||||
| MainModelConfig
|
||||
| CLIPVisionDiffusersConfig;
|
||||
| CLIPVisionDiffusersConfig
|
||||
| SigLipModelConfig
|
||||
| FluxReduxModelConfig;
|
||||
|
||||
/**
|
||||
* Checks if a list of submodels contains any that match a given variant or type
|
||||
@@ -209,6 +213,14 @@ export const isSpandrelImageToImageModelConfig = (
|
||||
return config.type === 'spandrel_image_to_image';
|
||||
};
|
||||
|
||||
export const isSigLipModelConfig = (config: AnyModelConfig): config is SigLipModelConfig => {
|
||||
return config.type === 'siglip';
|
||||
};
|
||||
|
||||
export const isFluxReduxModelConfig = (config: AnyModelConfig): config is FluxReduxModelConfig => {
|
||||
return config.type === 'flux_redux';
|
||||
};
|
||||
|
||||
export const isNonRefinerMainModelConfig = (config: AnyModelConfig): config is MainModelConfig => {
|
||||
return config.type === 'main' && config.base !== 'sdxl-refiner';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user