From fe924daee38cfd16d34bf68502235639ebfec2ca Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Mon, 7 Aug 2023 10:22:12 -0400 Subject: [PATCH 1/4] add option to disable multiselect --- invokeai/frontend/web/src/app/types/invokeai.ts | 3 ++- .../src/features/gallery/hooks/useMultiselect.ts.ts | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/app/types/invokeai.ts b/invokeai/frontend/web/src/app/types/invokeai.ts index b38790e0c9..827424fa7f 100644 --- a/invokeai/frontend/web/src/app/types/invokeai.ts +++ b/invokeai/frontend/web/src/app/types/invokeai.ts @@ -96,7 +96,8 @@ export type AppFeature = | 'consoleLogging' | 'dynamicPrompting' | 'batches' - | 'syncModels'; + | 'syncModels' + | 'multiselect'; /** * A disable-able Stable Diffusion feature diff --git a/invokeai/frontend/web/src/features/gallery/hooks/useMultiselect.ts.ts b/invokeai/frontend/web/src/features/gallery/hooks/useMultiselect.ts.ts index b59a2f3d6f..a162c6788d 100644 --- a/invokeai/frontend/web/src/features/gallery/hooks/useMultiselect.ts.ts +++ b/invokeai/frontend/web/src/features/gallery/hooks/useMultiselect.ts.ts @@ -9,6 +9,7 @@ import { useListImagesQuery } from 'services/api/endpoints/images'; import { ImageDTO } from 'services/api/types'; import { selectionChanged } from '../store/gallerySlice'; import { imagesSelectors } from 'services/api/util'; +import { useFeatureStatus } from '../../system/hooks/useFeatureStatus'; const selector = createSelector( [stateSelector, selectListImagesBaseQueryArgs], @@ -33,11 +34,18 @@ export const useMultiselect = (imageDTO?: ImageDTO) => { }), }); + const isMultiSelectEnabled = useFeatureStatus('multiselect').isFeatureEnabled; + const handleClick = useCallback( (e: MouseEvent) => { if (!imageDTO) { return; } + if (!isMultiSelectEnabled) { + dispatch(selectionChanged([imageDTO])); + return; + } + if (e.shiftKey) { const rangeEndImageName = imageDTO.image_name; const lastSelectedImage = selection[selection.length - 1]?.image_name; @@ -71,7 +79,7 @@ export const useMultiselect = (imageDTO?: ImageDTO) => { dispatch(selectionChanged([imageDTO])); } }, - [dispatch, imageDTO, imageDTOs, selection] + [dispatch, imageDTO, imageDTOs, selection, isMultiSelectEnabled] ); const isSelected = useMemo( From 734a9e42717a91cd0142f31bed4c133254ebc32d Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Mon, 7 Aug 2023 10:23:02 -0400 Subject: [PATCH 2/4] invalidate board total when images deleted, only run date range logic if board has less than 20 images --- .../web/src/services/api/endpoints/images.ts | 101 ++++++++++-------- 1 file changed, 59 insertions(+), 42 deletions(-) diff --git a/invokeai/frontend/web/src/services/api/endpoints/images.ts b/invokeai/frontend/web/src/services/api/endpoints/images.ts index e093c1c33a..26c2268ca5 100644 --- a/invokeai/frontend/web/src/services/api/endpoints/images.ts +++ b/invokeai/frontend/web/src/services/api/endpoints/images.ts @@ -4,6 +4,7 @@ import { ASSETS_CATEGORIES, BoardId, IMAGE_CATEGORIES, + IMAGE_LIMIT, } from 'features/gallery/store/types'; import { keyBy } from 'lodash'; import { ApiFullTagDescription, LIST_TAG, api } from '..'; @@ -167,7 +168,14 @@ export const imagesApi = api.injectEndpoints({ }, }; }, - invalidatesTags: (result, error, imageDTOs) => [], + invalidatesTags: (result, error, { imageDTOs }) => { + // for now, assume bulk delete is all on one board + const boardId = imageDTOs[0]?.board_id + return [ + { type: 'BoardImagesTotal', id: boardId ?? 'none' }, + { type: 'BoardAssetsTotal', id: boardId ?? 'none' }, + ] + }, async onQueryStarted({ imageDTOs }, { dispatch, queryFulfilled }) { /** * Cache changes for `deleteImages`: @@ -288,11 +296,11 @@ export const imagesApi = api.injectEndpoints({ imageDTO.image_category ) ? boardsApi.endpoints.getBoardImagesTotal.select( - imageDTO.board_id ?? 'none' - )(getState()) + imageDTO.board_id ?? 'none' + )(getState()) : boardsApi.endpoints.getBoardAssetsTotal.select( - imageDTO.board_id ?? 'none' - )(getState()); + imageDTO.board_id ?? 'none' + )(getState()); // IF it eligible for insertion into existing $cache // "eligible" means either: @@ -718,11 +726,11 @@ export const imagesApi = api.injectEndpoints({ imageDTO.image_category ) ? boardsApi.endpoints.getBoardImagesTotal.select( - imageDTO.board_id ?? 'none' - )(getState()) + imageDTO.board_id ?? 'none' + )(getState()) : boardsApi.endpoints.getBoardAssetsTotal.select( - imageDTO.board_id ?? 'none' - )(getState()); + imageDTO.board_id ?? 'none' + )(getState()); const isCacheFullyPopulated = currentCache.data && currentCache.data.ids.length >= (total ?? 0); @@ -838,11 +846,11 @@ export const imagesApi = api.injectEndpoints({ imageDTO.image_category ) ? boardsApi.endpoints.getBoardImagesTotal.select( - imageDTO.board_id ?? 'none' - )(getState()) + imageDTO.board_id ?? 'none' + )(getState()) : boardsApi.endpoints.getBoardAssetsTotal.select( - imageDTO.board_id ?? 'none' - )(getState()); + imageDTO.board_id ?? 'none' + )(getState()); const isCacheFullyPopulated = currentCache.data && currentCache.data.ids.length >= (total ?? 0); @@ -889,18 +897,25 @@ export const imagesApi = api.injectEndpoints({ board_id, }, }), - invalidatesTags: (result, error, { board_id }) => [ - // update the destination board - { type: 'Board', id: board_id ?? 'none' }, - // update old board totals - { type: 'BoardImagesTotal', id: board_id ?? 'none' }, - { type: 'BoardAssetsTotal', id: board_id ?? 'none' }, - // update the no_board totals - { type: 'BoardImagesTotal', id: 'none' }, - { type: 'BoardAssetsTotal', id: 'none' }, - ], + invalidatesTags: (result, error, { imageDTOs, board_id }) => { + //assume all images are being moved from one board for now + const oldBoardId = imageDTOs[0]?.board_id; + return [ + // update the destination board + { type: 'Board', id: board_id ?? 'none' }, + // update new board totals + { type: 'BoardImagesTotal', id: board_id ?? 'none' }, + { type: 'BoardAssetsTotal', id: board_id ?? 'none' }, + // update old board totals + { type: 'BoardImagesTotal', id: oldBoardId ?? 'none' }, + { type: 'BoardAssetsTotal', id: oldBoardId ?? 'none' }, + // update the no_board totals + { type: 'BoardImagesTotal', id: 'none' }, + { type: 'BoardAssetsTotal', id: 'none' }, + ] + }, async onQueryStarted( - { board_id, imageDTOs }, + { board_id: new_board_id, imageDTOs }, { dispatch, queryFulfilled, getState } ) { try { @@ -920,7 +935,7 @@ export const imagesApi = api.injectEndpoints({ 'getImageDTO', image_name, (draft) => { - draft.board_id = board_id; + draft.board_id = new_board_id; } ) ); @@ -946,7 +961,7 @@ export const imagesApi = api.injectEndpoints({ ); const queryArgs = { - board_id, + board_id: new_board_id, categories, }; @@ -954,25 +969,27 @@ export const imagesApi = api.injectEndpoints({ queryArgs )(getState()); - const { data: total } = IMAGE_CATEGORIES.includes( + + const { data: previousTotal } = IMAGE_CATEGORIES.includes( imageDTO.image_category ) ? boardsApi.endpoints.getBoardImagesTotal.select( - imageDTO.board_id ?? 'none' - )(getState()) + new_board_id ?? 'none' + )(getState()) : boardsApi.endpoints.getBoardAssetsTotal.select( - imageDTO.board_id ?? 'none' - )(getState()); + new_board_id ?? 'none' + )(getState()); const isCacheFullyPopulated = - currentCache.data && currentCache.data.ids.length >= (total ?? 0); + currentCache.data && currentCache.data.ids.length >= (previousTotal ?? 0); - const isInDateRange = getIsImageInDateRange( + const isInDateRange = (previousTotal || 0) >= IMAGE_LIMIT ? getIsImageInDateRange( currentCache.data, imageDTO - ); + ) : true; if (isCacheFullyPopulated || isInDateRange) { + console.log("upserting") // *upsert* to $cache dispatch( imagesApi.util.updateQueryData( @@ -981,7 +998,7 @@ export const imagesApi = api.injectEndpoints({ (draft) => { imagesAdapter.upsertOne(draft, { ...imageDTO, - board_id, + board_id: new_board_id, }); } ) @@ -1088,19 +1105,19 @@ export const imagesApi = api.injectEndpoints({ imageDTO.image_category ) ? boardsApi.endpoints.getBoardImagesTotal.select( - imageDTO.board_id ?? 'none' - )(getState()) + imageDTO.board_id ?? 'none' + )(getState()) : boardsApi.endpoints.getBoardAssetsTotal.select( - imageDTO.board_id ?? 'none' - )(getState()); + imageDTO.board_id ?? 'none' + )(getState()); const isCacheFullyPopulated = currentCache.data && currentCache.data.ids.length >= (total ?? 0); - const isInDateRange = getIsImageInDateRange( + const isInDateRange = (total || 0) >= IMAGE_LIMIT ? getIsImageInDateRange( currentCache.data, imageDTO - ); + ) : true; if (isCacheFullyPopulated || isInDateRange) { // *upsert* to $cache @@ -1111,7 +1128,7 @@ export const imagesApi = api.injectEndpoints({ (draft) => { imagesAdapter.upsertOne(draft, { ...imageDTO, - board_id: undefined, + board_id: "none", }); } ) From 57e8ec9488361bcce44ff46c06a02476e1782c56 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 8 Aug 2023 12:49:54 +1000 Subject: [PATCH 3/4] chore(ui): lint/format --- .../web/src/services/api/endpoints/images.ts | 69 +++++++++---------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/invokeai/frontend/web/src/services/api/endpoints/images.ts b/invokeai/frontend/web/src/services/api/endpoints/images.ts index 26c2268ca5..0c52258f9d 100644 --- a/invokeai/frontend/web/src/services/api/endpoints/images.ts +++ b/invokeai/frontend/web/src/services/api/endpoints/images.ts @@ -170,11 +170,11 @@ export const imagesApi = api.injectEndpoints({ }, invalidatesTags: (result, error, { imageDTOs }) => { // for now, assume bulk delete is all on one board - const boardId = imageDTOs[0]?.board_id + const boardId = imageDTOs[0]?.board_id; return [ { type: 'BoardImagesTotal', id: boardId ?? 'none' }, { type: 'BoardAssetsTotal', id: boardId ?? 'none' }, - ] + ]; }, async onQueryStarted({ imageDTOs }, { dispatch, queryFulfilled }) { /** @@ -296,11 +296,11 @@ export const imagesApi = api.injectEndpoints({ imageDTO.image_category ) ? boardsApi.endpoints.getBoardImagesTotal.select( - imageDTO.board_id ?? 'none' - )(getState()) + imageDTO.board_id ?? 'none' + )(getState()) : boardsApi.endpoints.getBoardAssetsTotal.select( - imageDTO.board_id ?? 'none' - )(getState()); + imageDTO.board_id ?? 'none' + )(getState()); // IF it eligible for insertion into existing $cache // "eligible" means either: @@ -726,11 +726,11 @@ export const imagesApi = api.injectEndpoints({ imageDTO.image_category ) ? boardsApi.endpoints.getBoardImagesTotal.select( - imageDTO.board_id ?? 'none' - )(getState()) + imageDTO.board_id ?? 'none' + )(getState()) : boardsApi.endpoints.getBoardAssetsTotal.select( - imageDTO.board_id ?? 'none' - )(getState()); + imageDTO.board_id ?? 'none' + )(getState()); const isCacheFullyPopulated = currentCache.data && currentCache.data.ids.length >= (total ?? 0); @@ -846,11 +846,11 @@ export const imagesApi = api.injectEndpoints({ imageDTO.image_category ) ? boardsApi.endpoints.getBoardImagesTotal.select( - imageDTO.board_id ?? 'none' - )(getState()) + imageDTO.board_id ?? 'none' + )(getState()) : boardsApi.endpoints.getBoardAssetsTotal.select( - imageDTO.board_id ?? 'none' - )(getState()); + imageDTO.board_id ?? 'none' + )(getState()); const isCacheFullyPopulated = currentCache.data && currentCache.data.ids.length >= (total ?? 0); @@ -912,7 +912,7 @@ export const imagesApi = api.injectEndpoints({ // update the no_board totals { type: 'BoardImagesTotal', id: 'none' }, { type: 'BoardAssetsTotal', id: 'none' }, - ] + ]; }, async onQueryStarted( { board_id: new_board_id, imageDTOs }, @@ -969,27 +969,26 @@ export const imagesApi = api.injectEndpoints({ queryArgs )(getState()); - const { data: previousTotal } = IMAGE_CATEGORIES.includes( imageDTO.image_category ) ? boardsApi.endpoints.getBoardImagesTotal.select( - new_board_id ?? 'none' - )(getState()) + new_board_id ?? 'none' + )(getState()) : boardsApi.endpoints.getBoardAssetsTotal.select( - new_board_id ?? 'none' - )(getState()); + new_board_id ?? 'none' + )(getState()); const isCacheFullyPopulated = - currentCache.data && currentCache.data.ids.length >= (previousTotal ?? 0); + currentCache.data && + currentCache.data.ids.length >= (previousTotal ?? 0); - const isInDateRange = (previousTotal || 0) >= IMAGE_LIMIT ? getIsImageInDateRange( - currentCache.data, - imageDTO - ) : true; + const isInDateRange = + (previousTotal || 0) >= IMAGE_LIMIT + ? getIsImageInDateRange(currentCache.data, imageDTO) + : true; if (isCacheFullyPopulated || isInDateRange) { - console.log("upserting") // *upsert* to $cache dispatch( imagesApi.util.updateQueryData( @@ -1105,19 +1104,19 @@ export const imagesApi = api.injectEndpoints({ imageDTO.image_category ) ? boardsApi.endpoints.getBoardImagesTotal.select( - imageDTO.board_id ?? 'none' - )(getState()) + imageDTO.board_id ?? 'none' + )(getState()) : boardsApi.endpoints.getBoardAssetsTotal.select( - imageDTO.board_id ?? 'none' - )(getState()); + imageDTO.board_id ?? 'none' + )(getState()); const isCacheFullyPopulated = currentCache.data && currentCache.data.ids.length >= (total ?? 0); - const isInDateRange = (total || 0) >= IMAGE_LIMIT ? getIsImageInDateRange( - currentCache.data, - imageDTO - ) : true; + const isInDateRange = + (total || 0) >= IMAGE_LIMIT + ? getIsImageInDateRange(currentCache.data, imageDTO) + : true; if (isCacheFullyPopulated || isInDateRange) { // *upsert* to $cache @@ -1128,7 +1127,7 @@ export const imagesApi = api.injectEndpoints({ (draft) => { imagesAdapter.upsertOne(draft, { ...imageDTO, - board_id: "none", + board_id: 'none', }); } ) From e20af5aef022b6ec74a8c4d55a6553df26ed83b4 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 8 Aug 2023 12:00:05 +1000 Subject: [PATCH 4/4] feat(ui): add LoRA support to SDXL linear UI new graph modifier `addSDXLLoRasToGraph()` handles adding LoRA to the SDXL t2i and i2i graphs. --- .../lora/components/ParamLoraCollapse.tsx | 2 +- .../lora/components/ParamLoraList.tsx | 14 +- .../util/graphBuilders/addLoRAsToGraph.ts | 9 +- .../util/graphBuilders/addSDXLLoRAstoGraph.ts | 212 +++++++++++++++++ .../buildLinearSDXLImageToImageGraph.ts | 3 + .../buildLinearSDXLTextToImageGraph.ts | 3 + .../SDXLImageToImageTabParameters.tsx | 2 + .../SDXLTextToImageTabParameters.tsx | 2 + .../frontend/web/src/services/api/schema.d.ts | 222 ++++++++++++++++-- .../frontend/web/src/services/api/types.ts | 3 + 10 files changed, 436 insertions(+), 36 deletions(-) create mode 100644 invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSDXLLoRAstoGraph.ts diff --git a/invokeai/frontend/web/src/features/lora/components/ParamLoraCollapse.tsx b/invokeai/frontend/web/src/features/lora/components/ParamLoraCollapse.tsx index e212efbfa2..c2edd94106 100644 --- a/invokeai/frontend/web/src/features/lora/components/ParamLoraCollapse.tsx +++ b/invokeai/frontend/web/src/features/lora/components/ParamLoraCollapse.tsx @@ -31,7 +31,7 @@ const ParamLoraCollapse = () => { } return ( - + diff --git a/invokeai/frontend/web/src/features/lora/components/ParamLoraList.tsx b/invokeai/frontend/web/src/features/lora/components/ParamLoraList.tsx index 835c315e5c..f10084e585 100644 --- a/invokeai/frontend/web/src/features/lora/components/ParamLoraList.tsx +++ b/invokeai/frontend/web/src/features/lora/components/ParamLoraList.tsx @@ -1,3 +1,4 @@ +import { Divider } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; import { stateSelector } from 'app/store/store'; import { useAppSelector } from 'app/store/storeHooks'; @@ -8,20 +9,21 @@ import ParamLora from './ParamLora'; const selector = createSelector( stateSelector, ({ lora }) => { - const { loras } = lora; - - return { loras }; + return { lorasArray: map(lora.loras) }; }, defaultSelectorOptions ); const ParamLoraList = () => { - const { loras } = useAppSelector(selector); + const { lorasArray } = useAppSelector(selector); return ( <> - {map(loras, (lora) => ( - + {lorasArray.map((lora, i) => ( + <> + {i > 0 && } + + ))} ); diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addLoRAsToGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addLoRAsToGraph.ts index bc0bfee8fd..cdd91d6e4f 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addLoRAsToGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addLoRAsToGraph.ts @@ -9,7 +9,6 @@ import { CLIP_SKIP, LORA_LOADER, MAIN_MODEL_LOADER, - ONNX_MODEL_LOADER, METADATA_ACCUMULATOR, NEGATIVE_CONDITIONING, POSITIVE_CONDITIONING, @@ -36,15 +35,11 @@ export const addLoRAsToGraph = ( | undefined; if (loraCount > 0) { - // Remove MAIN_MODEL_LOADER unet connection to feed it to LoRAs + // Remove modelLoaderNodeId unet connection to feed it to LoRAs graph.edges = graph.edges.filter( (e) => !( - e.source.node_id === MAIN_MODEL_LOADER && - ['unet'].includes(e.source.field) - ) && - !( - e.source.node_id === ONNX_MODEL_LOADER && + e.source.node_id === modelLoaderNodeId && ['unet'].includes(e.source.field) ) ); diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSDXLLoRAstoGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSDXLLoRAstoGraph.ts new file mode 100644 index 0000000000..c0f7f7ca82 --- /dev/null +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSDXLLoRAstoGraph.ts @@ -0,0 +1,212 @@ +import { RootState } from 'app/store/store'; +import { NonNullableGraph } from 'features/nodes/types/types'; +import { forEach, size } from 'lodash-es'; +import { + MetadataAccumulatorInvocation, + SDXLLoraLoaderInvocation, +} from 'services/api/types'; +import { + LORA_LOADER, + METADATA_ACCUMULATOR, + NEGATIVE_CONDITIONING, + POSITIVE_CONDITIONING, + SDXL_MODEL_LOADER, +} from './constants'; + +export const addSDXLLoRAsToGraph = ( + state: RootState, + graph: NonNullableGraph, + baseNodeId: string, + modelLoaderNodeId: string = SDXL_MODEL_LOADER +): void => { + /** + * LoRA nodes get the UNet and CLIP models from the main model loader and apply the LoRA to them. + * They then output the UNet and CLIP models references on to either the next LoRA in the chain, + * or to the inference/conditioning nodes. + * + * So we need to inject a LoRA chain into the graph. + */ + + const { loras } = state.lora; + const loraCount = size(loras); + const metadataAccumulator = graph.nodes[METADATA_ACCUMULATOR] as + | MetadataAccumulatorInvocation + | undefined; + + if (loraCount > 0) { + // Remove modelLoaderNodeId unet/clip/clip2 connections to feed it to LoRAs + graph.edges = graph.edges.filter( + (e) => + !( + e.source.node_id === modelLoaderNodeId && + ['unet'].includes(e.source.field) + ) && + !( + e.source.node_id === modelLoaderNodeId && + ['clip'].includes(e.source.field) + ) && + !( + e.source.node_id === modelLoaderNodeId && + ['clip2'].includes(e.source.field) + ) + ); + } + + // we need to remember the last lora so we can chain from it + let lastLoraNodeId = ''; + let currentLoraIndex = 0; + + forEach(loras, (lora) => { + const { model_name, base_model, weight } = lora; + const currentLoraNodeId = `${LORA_LOADER}_${model_name.replace('.', '_')}`; + + const loraLoaderNode: SDXLLoraLoaderInvocation = { + type: 'sdxl_lora_loader', + id: currentLoraNodeId, + is_intermediate: true, + lora: { model_name, base_model }, + weight, + }; + + // add the lora to the metadata accumulator + if (metadataAccumulator) { + metadataAccumulator.loras.push({ + lora: { model_name, base_model }, + weight, + }); + } + + // add to graph + graph.nodes[currentLoraNodeId] = loraLoaderNode; + if (currentLoraIndex === 0) { + // first lora = start the lora chain, attach directly to model loader + graph.edges.push({ + source: { + node_id: modelLoaderNodeId, + field: 'unet', + }, + destination: { + node_id: currentLoraNodeId, + field: 'unet', + }, + }); + + graph.edges.push({ + source: { + node_id: modelLoaderNodeId, + field: 'clip', + }, + destination: { + node_id: currentLoraNodeId, + field: 'clip', + }, + }); + + graph.edges.push({ + source: { + node_id: modelLoaderNodeId, + field: 'clip2', + }, + destination: { + node_id: currentLoraNodeId, + field: 'clip2', + }, + }); + } else { + // we are in the middle of the lora chain, instead connect to the previous lora + graph.edges.push({ + source: { + node_id: lastLoraNodeId, + field: 'unet', + }, + destination: { + node_id: currentLoraNodeId, + field: 'unet', + }, + }); + graph.edges.push({ + source: { + node_id: lastLoraNodeId, + field: 'clip', + }, + destination: { + node_id: currentLoraNodeId, + field: 'clip', + }, + }); + + graph.edges.push({ + source: { + node_id: lastLoraNodeId, + field: 'clip2', + }, + destination: { + node_id: currentLoraNodeId, + field: 'clip2', + }, + }); + } + + if (currentLoraIndex === loraCount - 1) { + // final lora, end the lora chain - we need to connect up to inference and conditioning nodes + graph.edges.push({ + source: { + node_id: currentLoraNodeId, + field: 'unet', + }, + destination: { + node_id: baseNodeId, + field: 'unet', + }, + }); + + graph.edges.push({ + source: { + node_id: currentLoraNodeId, + field: 'clip', + }, + destination: { + node_id: POSITIVE_CONDITIONING, + field: 'clip', + }, + }); + + graph.edges.push({ + source: { + node_id: currentLoraNodeId, + field: 'clip', + }, + destination: { + node_id: NEGATIVE_CONDITIONING, + field: 'clip', + }, + }); + + graph.edges.push({ + source: { + node_id: currentLoraNodeId, + field: 'clip2', + }, + destination: { + node_id: POSITIVE_CONDITIONING, + field: 'clip2', + }, + }); + + graph.edges.push({ + source: { + node_id: currentLoraNodeId, + field: 'clip2', + }, + destination: { + node_id: NEGATIVE_CONDITIONING, + field: 'clip2', + }, + }); + } + + // increment the lora for the next one in the chain + lastLoraNodeId = currentLoraNodeId; + currentLoraIndex += 1; + }); +}; diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearSDXLImageToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearSDXLImageToImageGraph.ts index a260dbc467..0ec4e096d9 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearSDXLImageToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearSDXLImageToImageGraph.ts @@ -22,6 +22,7 @@ import { SDXL_LATENTS_TO_LATENTS, SDXL_MODEL_LOADER, } from './constants'; +import { addSDXLLoRAsToGraph } from './addSDXLLoRAstoGraph'; /** * Builds the Image to Image tab graph. @@ -364,6 +365,8 @@ export const buildLinearSDXLImageToImageGraph = ( }, }); + addSDXLLoRAsToGraph(state, graph, SDXL_LATENTS_TO_LATENTS, SDXL_MODEL_LOADER); + // Add Refiner if enabled if (shouldUseSDXLRefiner) { addSDXLRefinerToGraph(state, graph, SDXL_LATENTS_TO_LATENTS); diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearSDXLTextToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearSDXLTextToImageGraph.ts index c10e7831d3..21b7c1e0ac 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearSDXLTextToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearSDXLTextToImageGraph.ts @@ -4,6 +4,7 @@ import { NonNullableGraph } from 'features/nodes/types/types'; import { initialGenerationState } from 'features/parameters/store/generationSlice'; import { addDynamicPromptsToGraph } from './addDynamicPromptsToGraph'; import { addNSFWCheckerToGraph } from './addNSFWCheckerToGraph'; +import { addSDXLLoRAsToGraph } from './addSDXLLoRAstoGraph'; import { addSDXLRefinerToGraph } from './addSDXLRefinerToGraph'; import { addWatermarkerToGraph } from './addWatermarkerToGraph'; import { @@ -246,6 +247,8 @@ export const buildLinearSDXLTextToImageGraph = ( }, }); + addSDXLLoRAsToGraph(state, graph, SDXL_TEXT_TO_LATENTS, SDXL_MODEL_LOADER); + // Add Refiner if enabled if (shouldUseSDXLRefiner) { addSDXLRefinerToGraph(state, graph, SDXL_TEXT_TO_LATENTS); diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLImageToImageTabParameters.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLImageToImageTabParameters.tsx index c0b143a557..edc92a56c8 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLImageToImageTabParameters.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLImageToImageTabParameters.tsx @@ -4,6 +4,7 @@ import ProcessButtons from 'features/parameters/components/ProcessButtons/Proces import ParamSDXLPromptArea from './ParamSDXLPromptArea'; import ParamSDXLRefinerCollapse from './ParamSDXLRefinerCollapse'; import SDXLImageToImageTabCoreParameters from './SDXLImageToImageTabCoreParameters'; +import ParamLoraCollapse from 'features/lora/components/ParamLoraCollapse'; const SDXLImageToImageTabParameters = () => { return ( @@ -12,6 +13,7 @@ const SDXLImageToImageTabParameters = () => { + diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLTextToImageTabParameters.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLTextToImageTabParameters.tsx index 35bc0b4284..325fd7d881 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLTextToImageTabParameters.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLTextToImageTabParameters.tsx @@ -4,6 +4,7 @@ import ProcessButtons from 'features/parameters/components/ProcessButtons/Proces import TextToImageTabCoreParameters from 'features/ui/components/tabs/TextToImage/TextToImageTabCoreParameters'; import ParamSDXLPromptArea from './ParamSDXLPromptArea'; import ParamSDXLRefinerCollapse from './ParamSDXLRefinerCollapse'; +import ParamLoraCollapse from 'features/lora/components/ParamLoraCollapse'; const SDXLTextToImageTabParameters = () => { return ( @@ -12,6 +13,7 @@ const SDXLTextToImageTabParameters = () => { + diff --git a/invokeai/frontend/web/src/services/api/schema.d.ts b/invokeai/frontend/web/src/services/api/schema.d.ts index 6574ec4909..fc3397820e 100644 --- a/invokeai/frontend/web/src/services/api/schema.d.ts +++ b/invokeai/frontend/web/src/services/api/schema.d.ts @@ -1443,7 +1443,7 @@ export type components = { * @description The nodes in this graph */ nodes?: { - [key: string]: (components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRawPromptInvocation"] | components["schemas"]["SDXLRefinerRawPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SDXLTextToLatentsInvocation"] | components["schemas"]["SDXLLatentsToLatentsInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["ONNXSD1ModelLoaderInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["ParamStringInvocation"] | components["schemas"]["ParamPromptInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]) | undefined; + [key: string]: (components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["SDXLLoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRawPromptInvocation"] | components["schemas"]["SDXLRefinerRawPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageLuminosityAdjustmentInvocation"] | components["schemas"]["ImageSaturationAdjustmentInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SDXLTextToLatentsInvocation"] | components["schemas"]["SDXLLatentsToLatentsInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["ONNXSD1ModelLoaderInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["ParamStringInvocation"] | components["schemas"]["ParamPromptInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]) | undefined; }; /** * Edges @@ -1486,7 +1486,7 @@ export type components = { * @description The results of node executions */ results: { - [key: string]: (components["schemas"]["ImageOutput"] | components["schemas"]["MaskOutput"] | components["schemas"]["ControlOutput"] | components["schemas"]["ModelLoaderOutput"] | components["schemas"]["LoraLoaderOutput"] | components["schemas"]["VaeLoaderOutput"] | components["schemas"]["MetadataAccumulatorOutput"] | components["schemas"]["CompelOutput"] | components["schemas"]["ClipSkipInvocationOutput"] | components["schemas"]["LatentsOutput"] | components["schemas"]["SDXLModelLoaderOutput"] | components["schemas"]["SDXLRefinerModelLoaderOutput"] | components["schemas"]["ONNXModelLoaderOutput"] | components["schemas"]["PromptOutput"] | components["schemas"]["PromptCollectionOutput"] | components["schemas"]["IntOutput"] | components["schemas"]["FloatOutput"] | components["schemas"]["StringOutput"] | components["schemas"]["IntCollectionOutput"] | components["schemas"]["FloatCollectionOutput"] | components["schemas"]["ImageCollectionOutput"] | components["schemas"]["NoiseOutput"] | components["schemas"]["GraphInvocationOutput"] | components["schemas"]["IterateInvocationOutput"] | components["schemas"]["CollectInvocationOutput"]) | undefined; + [key: string]: (components["schemas"]["ImageOutput"] | components["schemas"]["MaskOutput"] | components["schemas"]["ControlOutput"] | components["schemas"]["ModelLoaderOutput"] | components["schemas"]["LoraLoaderOutput"] | components["schemas"]["SDXLLoraLoaderOutput"] | components["schemas"]["VaeLoaderOutput"] | components["schemas"]["MetadataAccumulatorOutput"] | components["schemas"]["CompelOutput"] | components["schemas"]["ClipSkipInvocationOutput"] | components["schemas"]["LatentsOutput"] | components["schemas"]["SDXLModelLoaderOutput"] | components["schemas"]["SDXLRefinerModelLoaderOutput"] | components["schemas"]["ONNXModelLoaderOutput"] | components["schemas"]["PromptOutput"] | components["schemas"]["PromptCollectionOutput"] | components["schemas"]["IntOutput"] | components["schemas"]["FloatOutput"] | components["schemas"]["StringOutput"] | components["schemas"]["IntCollectionOutput"] | components["schemas"]["FloatCollectionOutput"] | components["schemas"]["ImageCollectionOutput"] | components["schemas"]["NoiseOutput"] | components["schemas"]["GraphInvocationOutput"] | components["schemas"]["IterateInvocationOutput"] | components["schemas"]["CollectInvocationOutput"]) | undefined; }; /** * Errors @@ -1904,6 +1904,40 @@ export type components = { */ image_name: string; }; + /** + * ImageHueAdjustmentInvocation + * @description Adjusts the Hue of an image. + */ + ImageHueAdjustmentInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default img_hue_adjust + * @enum {string} + */ + type?: "img_hue_adjust"; + /** + * Image + * @description The image to adjust + */ + image?: components["schemas"]["ImageField"]; + /** + * Hue + * @description The degrees by which to rotate the hue, 0-360 + * @default 0 + */ + hue?: number; + }; /** * ImageInverseLerpInvocation * @description Inverse linear interpolation of all pixels of an image @@ -1984,6 +2018,40 @@ export type components = { */ max?: number; }; + /** + * ImageLuminosityAdjustmentInvocation + * @description Adjusts the Luminosity (Value) of an image. + */ + ImageLuminosityAdjustmentInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default img_luminosity_adjust + * @enum {string} + */ + type?: "img_luminosity_adjust"; + /** + * Image + * @description The image to adjust + */ + image?: components["schemas"]["ImageField"]; + /** + * Luminosity + * @description The factor by which to adjust the luminosity (value) + * @default 1 + */ + luminosity?: number; + }; /** * ImageMetadata * @description An image's generation metadata @@ -2239,6 +2307,40 @@ export type components = { */ resample_mode?: "nearest" | "box" | "bilinear" | "hamming" | "bicubic" | "lanczos"; }; + /** + * ImageSaturationAdjustmentInvocation + * @description Adjusts the Saturation of an image. + */ + ImageSaturationAdjustmentInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default img_saturation_adjust + * @enum {string} + */ + type?: "img_saturation_adjust"; + /** + * Image + * @description The image to adjust + */ + image?: components["schemas"]["ImageField"]; + /** + * Saturation + * @description The factor by which to adjust the saturation + * @default 1 + */ + saturation?: number; + }; /** * ImageScaleInvocation * @description Scales an image by a factor @@ -4912,6 +5014,82 @@ export type components = { */ denoising_end?: number; }; + /** + * SDXLLoraLoaderInvocation + * @description Apply selected lora to unet and text_encoder. + */ + SDXLLoraLoaderInvocation: { + /** + * Id + * @description The id of this node. Must be unique among all nodes. + */ + id: string; + /** + * Is Intermediate + * @description Whether or not this node is an intermediate node. + * @default false + */ + is_intermediate?: boolean; + /** + * Type + * @default sdxl_lora_loader + * @enum {string} + */ + type?: "sdxl_lora_loader"; + /** + * Lora + * @description Lora model name + */ + lora?: components["schemas"]["LoRAModelField"]; + /** + * Weight + * @description With what weight to apply lora + * @default 0.75 + */ + weight?: number; + /** + * Unet + * @description UNet model for applying lora + */ + unet?: components["schemas"]["UNetField"]; + /** + * Clip + * @description Clip model for applying lora + */ + clip?: components["schemas"]["ClipField"]; + /** + * Clip2 + * @description Clip2 model for applying lora + */ + clip2?: components["schemas"]["ClipField"]; + }; + /** + * SDXLLoraLoaderOutput + * @description Model loader output + */ + SDXLLoraLoaderOutput: { + /** + * Type + * @default sdxl_lora_loader_output + * @enum {string} + */ + type?: "sdxl_lora_loader_output"; + /** + * Unet + * @description UNet submodel + */ + unet?: components["schemas"]["UNetField"]; + /** + * Clip + * @description Tokenizer and text_encoder submodels + */ + clip?: components["schemas"]["ClipField"]; + /** + * Clip2 + * @description Tokenizer2 and text_encoder2 submodels + */ + clip2?: components["schemas"]["ClipField"]; + }; /** * SDXLModelLoaderInvocation * @description Loads an sdxl base model, outputting its submodels. @@ -5961,6 +6139,24 @@ export type components = { */ image?: components["schemas"]["ImageField"]; }; + /** + * ControlNetModelFormat + * @description An enumeration. + * @enum {string} + */ + ControlNetModelFormat: "checkpoint" | "diffusers"; + /** + * StableDiffusionXLModelFormat + * @description An enumeration. + * @enum {string} + */ + StableDiffusionXLModelFormat: "checkpoint" | "diffusers"; + /** + * StableDiffusion1ModelFormat + * @description An enumeration. + * @enum {string} + */ + StableDiffusion1ModelFormat: "checkpoint" | "diffusers"; /** * StableDiffusionOnnxModelFormat * @description An enumeration. @@ -5973,24 +6169,6 @@ export type components = { * @enum {string} */ StableDiffusion2ModelFormat: "checkpoint" | "diffusers"; - /** - * StableDiffusion1ModelFormat - * @description An enumeration. - * @enum {string} - */ - StableDiffusion1ModelFormat: "checkpoint" | "diffusers"; - /** - * StableDiffusionXLModelFormat - * @description An enumeration. - * @enum {string} - */ - StableDiffusionXLModelFormat: "checkpoint" | "diffusers"; - /** - * ControlNetModelFormat - * @description An enumeration. - * @enum {string} - */ - ControlNetModelFormat: "checkpoint" | "diffusers"; }; responses: never; parameters: never; @@ -6101,7 +6279,7 @@ export type operations = { }; requestBody: { content: { - "application/json": components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRawPromptInvocation"] | components["schemas"]["SDXLRefinerRawPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SDXLTextToLatentsInvocation"] | components["schemas"]["SDXLLatentsToLatentsInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["ONNXSD1ModelLoaderInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["ParamStringInvocation"] | components["schemas"]["ParamPromptInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]; + "application/json": components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["SDXLLoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRawPromptInvocation"] | components["schemas"]["SDXLRefinerRawPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageLuminosityAdjustmentInvocation"] | components["schemas"]["ImageSaturationAdjustmentInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SDXLTextToLatentsInvocation"] | components["schemas"]["SDXLLatentsToLatentsInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["ONNXSD1ModelLoaderInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["ParamStringInvocation"] | components["schemas"]["ParamPromptInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]; }; }; responses: { @@ -6138,7 +6316,7 @@ export type operations = { }; requestBody: { content: { - "application/json": components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRawPromptInvocation"] | components["schemas"]["SDXLRefinerRawPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SDXLTextToLatentsInvocation"] | components["schemas"]["SDXLLatentsToLatentsInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["ONNXSD1ModelLoaderInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["ParamStringInvocation"] | components["schemas"]["ParamPromptInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]; + "application/json": components["schemas"]["ControlNetInvocation"] | components["schemas"]["ImageProcessorInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["LoraLoaderInvocation"] | components["schemas"]["SDXLLoraLoaderInvocation"] | components["schemas"]["VaeLoaderInvocation"] | components["schemas"]["MetadataAccumulatorInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRawPromptInvocation"] | components["schemas"]["SDXLRefinerRawPromptInvocation"] | components["schemas"]["ClipSkipInvocation"] | components["schemas"]["LoadImageInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageLuminosityAdjustmentInvocation"] | components["schemas"]["ImageSaturationAdjustmentInvocation"] | components["schemas"]["TextToLatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SDXLTextToLatentsInvocation"] | components["schemas"]["SDXLLatentsToLatentsInvocation"] | components["schemas"]["ONNXPromptInvocation"] | components["schemas"]["ONNXTextToLatentsInvocation"] | components["schemas"]["ONNXLatentsToImageInvocation"] | components["schemas"]["ONNXSD1ModelLoaderInvocation"] | components["schemas"]["OnnxModelLoaderInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["AddInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["ParamIntInvocation"] | components["schemas"]["ParamFloatInvocation"] | components["schemas"]["ParamStringInvocation"] | components["schemas"]["ParamPromptInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["StepParamEasingInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["InpaintInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["GraphInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CannyImageProcessorInvocation"] | components["schemas"]["HedImageProcessorInvocation"] | components["schemas"]["LineartImageProcessorInvocation"] | components["schemas"]["LineartAnimeImageProcessorInvocation"] | components["schemas"]["OpenposeImageProcessorInvocation"] | components["schemas"]["MidasDepthImageProcessorInvocation"] | components["schemas"]["NormalbaeImageProcessorInvocation"] | components["schemas"]["MlsdImageProcessorInvocation"] | components["schemas"]["PidiImageProcessorInvocation"] | components["schemas"]["ContentShuffleImageProcessorInvocation"] | components["schemas"]["ZoeDepthImageProcessorInvocation"] | components["schemas"]["MediapipeFaceProcessorInvocation"] | components["schemas"]["LeresImageProcessorInvocation"] | components["schemas"]["TileResamplerProcessorInvocation"] | components["schemas"]["SegmentAnythingProcessorInvocation"] | components["schemas"]["LatentsToLatentsInvocation"]; }; }; responses: { diff --git a/invokeai/frontend/web/src/services/api/types.ts b/invokeai/frontend/web/src/services/api/types.ts index ca9dbb3aeb..e7e3accdad 100644 --- a/invokeai/frontend/web/src/services/api/types.ts +++ b/invokeai/frontend/web/src/services/api/types.ts @@ -166,6 +166,9 @@ export type OnnxModelLoaderInvocation = TypeReq< export type LoraLoaderInvocation = TypeReq< components['schemas']['LoraLoaderInvocation'] >; +export type SDXLLoraLoaderInvocation = TypeReq< + components['schemas']['SDXLLoraLoaderInvocation'] +>; export type MetadataAccumulatorInvocation = TypeReq< components['schemas']['MetadataAccumulatorInvocation'] >;