mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
chore(ui): lint
This commit is contained in:
parent
8b25c1a62e
commit
e36e5871a1
@ -34,9 +34,7 @@ export const IPAdapterImagePreview = memo(
|
||||
const optimalDimension = useAppSelector(selectOptimalDimension);
|
||||
const shift = useShiftModifier();
|
||||
|
||||
const { currentData: controlImage, isError: isErrorControlImage } = useGetImageDTOQuery(
|
||||
image?.name ?? skipToken
|
||||
);
|
||||
const { currentData: controlImage, isError: isErrorControlImage } = useGetImageDTOQuery(image?.name ?? skipToken);
|
||||
const handleResetControlImage = useCallback(() => {
|
||||
onChangeImage(null);
|
||||
}, [onChangeImage]);
|
||||
|
@ -19,15 +19,15 @@ import {
|
||||
} from 'features/parameters/types/parameterSchemas';
|
||||
import { z } from 'zod';
|
||||
|
||||
export const zTool = z.enum(['brush', 'eraser', 'move', 'rect']);
|
||||
const zTool = z.enum(['brush', 'eraser', 'move', 'rect']);
|
||||
export type Tool = z.infer<typeof zTool>;
|
||||
export const zDrawingTool = zTool.extract(['brush', 'eraser']);
|
||||
const zDrawingTool = zTool.extract(['brush', 'eraser']);
|
||||
export type DrawingTool = z.infer<typeof zDrawingTool>;
|
||||
|
||||
const zPoints = z.array(z.number()).refine((points) => points.length % 2 === 0, {
|
||||
message: 'Must have an even number of points',
|
||||
});
|
||||
export const zVectorMaskLine = z.object({
|
||||
const zVectorMaskLine = z.object({
|
||||
id: z.string(),
|
||||
type: z.literal('vector_mask_line'),
|
||||
tool: zDrawingTool,
|
||||
@ -36,7 +36,7 @@ export const zVectorMaskLine = z.object({
|
||||
});
|
||||
export type VectorMaskLine = z.infer<typeof zVectorMaskLine>;
|
||||
|
||||
export const zVectorMaskRect = z.object({
|
||||
const zVectorMaskRect = z.object({
|
||||
id: z.string(),
|
||||
type: z.literal('vector_mask_rect'),
|
||||
x: z.number(),
|
||||
@ -116,7 +116,6 @@ export const zLayer = z.discriminatedUnion('type', [
|
||||
zInitialImageLayer,
|
||||
]);
|
||||
export type Layer = z.infer<typeof zLayer>;
|
||||
export const zLayers = z.array(zLayer);
|
||||
|
||||
export type ControlLayersState = {
|
||||
_version: 2;
|
||||
|
@ -162,7 +162,7 @@ const zZoeDepthProcessorConfig = z.object({
|
||||
export type _ZoeDepthProcessorConfig = Required<Pick<ZoeDepthImageProcessorInvocation, 'id' | 'type'>>;
|
||||
export type ZoeDepthProcessorConfig = z.infer<typeof zZoeDepthProcessorConfig>;
|
||||
|
||||
export const zProcessorConfig = z.discriminatedUnion('type', [
|
||||
const zProcessorConfig = z.discriminatedUnion('type', [
|
||||
zCannyProcessorConfig,
|
||||
zColorMapProcessorConfig,
|
||||
zContentShuffleProcessorConfig,
|
||||
@ -519,7 +519,7 @@ export const CA_PROCESSOR_DATA: CAProcessorsData = {
|
||||
},
|
||||
};
|
||||
|
||||
export const initialControlNetV2: Omit<ControlNetConfigV2, 'id'> = {
|
||||
const initialControlNetV2: Omit<ControlNetConfigV2, 'id'> = {
|
||||
type: 'controlnet',
|
||||
model: null,
|
||||
weight: 1,
|
||||
@ -531,7 +531,7 @@ export const initialControlNetV2: Omit<ControlNetConfigV2, 'id'> = {
|
||||
processorConfig: CA_PROCESSOR_DATA.canny_image_processor.buildDefaults(),
|
||||
};
|
||||
|
||||
export const initialT2IAdapterV2: Omit<T2IAdapterConfigV2, 'id'> = {
|
||||
const initialT2IAdapterV2: Omit<T2IAdapterConfigV2, 'id'> = {
|
||||
type: 't2i_adapter',
|
||||
model: null,
|
||||
weight: 1,
|
||||
@ -542,7 +542,7 @@ export const initialT2IAdapterV2: Omit<T2IAdapterConfigV2, 'id'> = {
|
||||
processorConfig: CA_PROCESSOR_DATA.canny_image_processor.buildDefaults(),
|
||||
};
|
||||
|
||||
export const initialIPAdapterV2: Omit<IPAdapterConfigV2, 'id'> = {
|
||||
const initialIPAdapterV2: Omit<IPAdapterConfigV2, 'id'> = {
|
||||
type: 'ip_adapter',
|
||||
image: null,
|
||||
model: null,
|
||||
|
@ -49,9 +49,7 @@ export const getImageUsage = (
|
||||
return l.ipAdapters.some((ipa) => ipa.image?.name === image_name);
|
||||
}
|
||||
if (isControlAdapterLayer(l)) {
|
||||
return (
|
||||
l.controlAdapter.image?.name === image_name || l.controlAdapter.processedImage?.name === image_name
|
||||
);
|
||||
return l.controlAdapter.image?.name === image_name || l.controlAdapter.processedImage?.name === image_name;
|
||||
}
|
||||
if (isIPAdapterLayer(l)) {
|
||||
return l.ipAdapter.image?.name === image_name;
|
||||
|
@ -51,7 +51,7 @@ export type MetadataValidateFunc<T> = (value: T) => Promise<T>;
|
||||
* @param value The value to check.
|
||||
* @returns True if the item should be visible, false otherwise.
|
||||
*/
|
||||
export type MetadataGetIsVisibleFunc<T> = (value: T) => boolean;
|
||||
type MetadataGetIsVisibleFunc<T> = (value: T) => boolean;
|
||||
|
||||
export type MetadataHandlers<TValue = unknown, TItem = unknown> = {
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user