mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix: Circular dependency in Mask Blur Method
This commit is contained in:
parent
33779b6339
commit
3ff9961bda
@ -6,7 +6,7 @@ import IAIMantineSelect from 'common/components/IAIMantineSelect';
|
||||
import { setMaskBlurMethod } from 'features/parameters/store/generationSlice';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export type MaskBlurMethods = 'box' | 'gaussian';
|
||||
type MaskBlurMethods = 'box' | 'gaussian';
|
||||
|
||||
const maskBlurMethods: SelectItem[] = [
|
||||
{ label: 'Box Blur', value: 'box' },
|
||||
|
@ -4,12 +4,13 @@ import { roundToMultiple } from 'common/util/roundDownToMultiple';
|
||||
import { configChanged } from 'features/system/store/configSlice';
|
||||
import { clamp } from 'lodash-es';
|
||||
import { ImageDTO } from 'services/api/types';
|
||||
import { MaskBlurMethods } from '../components/Parameters/Canvas/MaskAdjustment/ParamMaskBlurMethod';
|
||||
|
||||
import { clipSkipMap } from '../types/constants';
|
||||
import {
|
||||
CfgScaleParam,
|
||||
HeightParam,
|
||||
MainModelParam,
|
||||
MaskBlurMethodParam,
|
||||
NegativePromptParam,
|
||||
OnnxModelParam,
|
||||
PositivePromptParam,
|
||||
@ -35,7 +36,7 @@ export interface GenerationState {
|
||||
negativePrompt: NegativePromptParam;
|
||||
scheduler: SchedulerParam;
|
||||
maskBlur: number;
|
||||
maskBlurMethod: MaskBlurMethods;
|
||||
maskBlurMethod: MaskBlurMethodParam;
|
||||
seed: SeedParam;
|
||||
seedWeights: string;
|
||||
shouldFitToWidthHeight: boolean;
|
||||
@ -196,7 +197,7 @@ export const generationSlice = createSlice({
|
||||
setMaskBlur: (state, action: PayloadAction<number>) => {
|
||||
state.maskBlur = action.payload;
|
||||
},
|
||||
setMaskBlurMethod: (state, action: PayloadAction<MaskBlurMethods>) => {
|
||||
setMaskBlurMethod: (state, action: PayloadAction<MaskBlurMethodParam>) => {
|
||||
state.maskBlurMethod = action.payload;
|
||||
},
|
||||
setTileSize: (state, action: PayloadAction<number>) => {
|
||||
|
@ -385,6 +385,21 @@ export const isValidSDXLRefinerStart = (
|
||||
val: unknown
|
||||
): val is SDXLRefinerStartParam => zSDXLRefinerstart.safeParse(val).success;
|
||||
|
||||
/**
|
||||
* Zod schema for a mask blur method parameter
|
||||
*/
|
||||
export const zMaskBlurMethod = z.enum(['box', 'gaussian']);
|
||||
/**
|
||||
* Type alias for mask blur method parameter, inferred from its zod schema
|
||||
*/
|
||||
export type MaskBlurMethodParam = z.infer<typeof zMaskBlurMethod>;
|
||||
/**
|
||||
* Validates/type-guards a value as a mask blur method parameter
|
||||
*/
|
||||
export const isValidMaskBlurMethod = (
|
||||
val: unknown
|
||||
): val is MaskBlurMethodParam => zMaskBlurMethod.safeParse(val).success;
|
||||
|
||||
// /**
|
||||
// * Zod schema for BaseModelType
|
||||
// */
|
||||
|
Loading…
Reference in New Issue
Block a user