fix: add response model for star/unstar routes

- also implement pessimistic updates for starring, only changing the images that were successfully updated by backend
- some autoformat changes crept in
This commit is contained in:
psychedelicious 2023-08-16 11:36:43 +10:00
parent 315a056686
commit 60c2c877d7
5 changed files with 169 additions and 233 deletions

View File

@ -5,7 +5,7 @@ from PIL import Image
from fastapi import Body, HTTPException, Path, Query, Request, Response, UploadFile from fastapi import Body, HTTPException, Path, Query, Request, Response, UploadFile
from fastapi.responses import FileResponse from fastapi.responses import FileResponse
from fastapi.routing import APIRouter from fastapi.routing import APIRouter
from pydantic import BaseModel from pydantic import BaseModel, Field
from invokeai.app.invocations.metadata import ImageMetadata from invokeai.app.invocations.metadata import ImageMetadata
from invokeai.app.models.image import ImageCategory, ResourceOrigin from invokeai.app.models.image import ImageCategory, ResourceOrigin
@ -19,6 +19,7 @@ from ..dependencies import ApiDependencies
images_router = APIRouter(prefix="/v1/images", tags=["images"]) images_router = APIRouter(prefix="/v1/images", tags=["images"])
# images are immutable; set a high max-age # images are immutable; set a high max-age
IMAGE_MAX_AGE = 31536000 IMAGE_MAX_AGE = 31536000
@ -286,30 +287,41 @@ async def delete_images_from_list(
return DeleteImagesFromListResult(deleted_images=deleted_images) return DeleteImagesFromListResult(deleted_images=deleted_images)
except Exception as e: except Exception as e:
raise HTTPException(status_code=500, detail="Failed to delete images") raise HTTPException(status_code=500, detail="Failed to delete images")
@images_router.post("/star", operation_id="star_images_in_list") class ImagesUpdatedFromListResult(BaseModel):
updated_image_names: list[str] = Field(description="The image names that were updated")
@images_router.post("/star", operation_id="star_images_in_list", response_model=ImagesUpdatedFromListResult)
async def star_images_in_list( async def star_images_in_list(
image_names: list[str] = Body(description="The list of names of images to star", embed=True), image_names: list[str] = Body(description="The list of names of images to star", embed=True),
): ) -> ImagesUpdatedFromListResult:
try: try:
updated_image_names: list[str] = []
for image_name in image_names: for image_name in image_names:
try: try:
ApiDependencies.invoker.services.images.update(image_name, changes=ImageRecordChanges(starred=True)) ApiDependencies.invoker.services.images.update(image_name, changes=ImageRecordChanges(starred=True))
updated_image_names.append(image_name)
except: except:
pass pass
return ImagesUpdatedFromListResult(updated_image_names=updated_image_names)
except Exception as e: except Exception as e:
raise HTTPException(status_code=500, detail="Failed to star images") raise HTTPException(status_code=500, detail="Failed to star images")
@images_router.post("/unstar", operation_id="unstar_images_in_list")
@images_router.post("/unstar", operation_id="unstar_images_in_list", response_model=ImagesUpdatedFromListResult)
async def unstar_images_in_list( async def unstar_images_in_list(
image_names: list[str] = Body(description="The list of names of images to unstar", embed=True), image_names: list[str] = Body(description="The list of names of images to unstar", embed=True),
): ) -> ImagesUpdatedFromListResult:
try: try:
updated_image_names: list[str] = []
for image_name in image_names: for image_name in image_names:
try: try:
ApiDependencies.invoker.services.images.update(image_name, changes=ImageRecordChanges(starred=False)) ApiDependencies.invoker.services.images.update(image_name, changes=ImageRecordChanges(starred=False))
updated_image_names.append(image_name)
except: except:
pass pass
return ImagesUpdatedFromListResult(updated_image_names=updated_image_names)
except Exception as e: except Exception as e:
raise HTTPException(status_code=500, detail="Failed to unstar images") raise HTTPException(status_code=500, detail="Failed to unstar images")

View File

@ -7,7 +7,7 @@ export const addImagesStarredListener = () => {
startAppListening({ startAppListening({
matcher: imagesApi.endpoints.starImages.matchFulfilled, matcher: imagesApi.endpoints.starImages.matchFulfilled,
effect: async (action, { dispatch, getState }) => { effect: async (action, { dispatch, getState }) => {
const { images: starredImages } = action.payload; const { updated_image_names: starredImages } = action.payload;
const state = getState(); const state = getState();

View File

@ -7,7 +7,7 @@ export const addImagesUnstarredListener = () => {
startAppListening({ startAppListening({
matcher: imagesApi.endpoints.unstarImages.matchFulfilled, matcher: imagesApi.endpoints.unstarImages.matchFulfilled,
effect: async (action, { dispatch, getState }) => { effect: async (action, { dispatch, getState }) => {
const { images: unstarredImages } = action.payload; const { updated_image_names: unstarredImages } = action.payload;
const state = getState(); const state = getState();

View File

@ -8,7 +8,7 @@ import {
} from 'features/gallery/store/types'; } from 'features/gallery/store/types';
import { keyBy } from 'lodash'; import { keyBy } from 'lodash';
import { ApiFullTagDescription, LIST_TAG, api } from '..'; import { ApiFullTagDescription, LIST_TAG, api } from '..';
import { components } from '../schema'; import { components, paths } from '../schema';
import { import {
DeleteBoardResult, DeleteBoardResult,
ImageCategory, ImageCategory,
@ -296,11 +296,11 @@ export const imagesApi = api.injectEndpoints({
imageDTO.image_category imageDTO.image_category
) )
? boardsApi.endpoints.getBoardImagesTotal.select( ? boardsApi.endpoints.getBoardImagesTotal.select(
imageDTO.board_id ?? 'none' imageDTO.board_id ?? 'none'
)(getState()) )(getState())
: boardsApi.endpoints.getBoardAssetsTotal.select( : boardsApi.endpoints.getBoardAssetsTotal.select(
imageDTO.board_id ?? 'none' imageDTO.board_id ?? 'none'
)(getState()); )(getState());
// IF it eligible for insertion into existing $cache // IF it eligible for insertion into existing $cache
// "eligible" means either: // "eligible" means either:
@ -391,13 +391,13 @@ export const imagesApi = api.injectEndpoints({
* Star a list of images. * Star a list of images.
*/ */
starImages: build.mutation< starImages: build.mutation<
{ images: string[] }, paths['/api/v1/images/unstar']['post']['responses']['200']['content']['application/json'],
{ images: ImageDTO[] } { images: ImageDTO[] }
>({ >({
query: ({ images }) => ({ query: ({ images }) => ({
url: `images/star`, url: `images/star`,
method: 'POST', method: 'POST',
body: { image_names: images.map(img => img.image_name) }, body: { image_names: images.map((img) => img.image_name) },
}), }),
invalidatesTags: (result, error, { images }) => { invalidatesTags: (result, error, { images }) => {
// assume all images are on the same board/category // assume all images are on the same board/category
@ -412,15 +412,11 @@ export const imagesApi = api.injectEndpoints({
categories, categories,
}), }),
}, },
] ];
} }
return [] return [];
}, },
async onQueryStarted( async onQueryStarted({ images }, { dispatch, queryFulfilled, getState }) {
{ images },
{ dispatch, queryFulfilled, getState }
) {
try { try {
/** /**
* Cache changes for pinImages: * Cache changes for pinImages:
@ -428,12 +424,18 @@ export const imagesApi = api.injectEndpoints({
* - *upsert* into list for each image * - *upsert* into list for each image
*/ */
// assume all images are on the same board/category const { data } = await queryFulfilled;
if (!images[0]) return; const updatedImages = images.filter((i) =>
const categories = getCategories(images[0]); data.updated_image_names.includes(i.image_name)
const boardId = images[0].board_id; );
images.forEach((imageDTO) => { if (!updatedImages[0]) return;
// assume all images are on the same board/category
const categories = getCategories(updatedImages[0]);
const boardId = updatedImages[0].board_id;
updatedImages.forEach((imageDTO) => {
const { image_name } = imageDTO; const { image_name } = imageDTO;
dispatch( dispatch(
imagesApi.util.updateQueryData( imagesApi.util.updateQueryData(
@ -447,7 +449,7 @@ export const imagesApi = api.injectEndpoints({
const queryArgs = { const queryArgs = {
board_id: boardId ?? 'none', board_id: boardId ?? 'none',
categories categories,
}; };
const currentCache = imagesApi.endpoints.listImages.select( const currentCache = imagesApi.endpoints.listImages.select(
@ -458,11 +460,11 @@ export const imagesApi = api.injectEndpoints({
imageDTO.image_category imageDTO.image_category
) )
? boardsApi.endpoints.getBoardImagesTotal.select( ? boardsApi.endpoints.getBoardImagesTotal.select(
boardId ?? 'none' boardId ?? 'none'
)(getState()) )(getState())
: boardsApi.endpoints.getBoardAssetsTotal.select( : boardsApi.endpoints.getBoardAssetsTotal.select(
boardId ?? 'none' boardId ?? 'none'
)(getState()); )(getState());
const isCacheFullyPopulated = const isCacheFullyPopulated =
currentCache.data && currentCache.data &&
@ -482,7 +484,7 @@ export const imagesApi = api.injectEndpoints({
(draft) => { (draft) => {
imagesAdapter.upsertOne(draft, { imagesAdapter.upsertOne(draft, {
...imageDTO, ...imageDTO,
starred: true starred: true,
}); });
} }
) )
@ -498,13 +500,13 @@ export const imagesApi = api.injectEndpoints({
* Unstar a list of images. * Unstar a list of images.
*/ */
unstarImages: build.mutation< unstarImages: build.mutation<
{ images: string[] }, paths['/api/v1/images/unstar']['post']['responses']['200']['content']['application/json'],
{ images: ImageDTO[] } { images: ImageDTO[] }
>({ >({
query: ({ images }) => ({ query: ({ images }) => ({
url: `images/unstar`, url: `images/unstar`,
method: 'POST', method: 'POST',
body: { image_names: images.map(img => img.image_name) }, body: { image_names: images.map((img) => img.image_name) },
}), }),
invalidatesTags: (result, error, { images }) => { invalidatesTags: (result, error, { images }) => {
// assume all images are on the same board/category // assume all images are on the same board/category
@ -519,15 +521,11 @@ export const imagesApi = api.injectEndpoints({
categories, categories,
}), }),
}, },
] ];
} }
return [] return [];
}, },
async onQueryStarted( async onQueryStarted({ images }, { dispatch, queryFulfilled, getState }) {
{ images },
{ dispatch, queryFulfilled, getState }
) {
try { try {
/** /**
* Cache changes for unstarImages: * Cache changes for unstarImages:
@ -535,12 +533,17 @@ export const imagesApi = api.injectEndpoints({
* - *upsert* into list for each image * - *upsert* into list for each image
*/ */
// assume all images are on the same board/category const { data } = await queryFulfilled;
if (!images[0]) return; const updatedImages = images.filter((i) =>
const categories = getCategories(images[0]); data.updated_image_names.includes(i.image_name)
const boardId = images[0].board_id; );
images.forEach((imageDTO) => { if (!updatedImages[0]) return;
// assume all images are on the same board/category
const categories = getCategories(updatedImages[0]);
const boardId = updatedImages[0].board_id;
updatedImages.forEach((imageDTO) => {
const { image_name } = imageDTO; const { image_name } = imageDTO;
dispatch( dispatch(
imagesApi.util.updateQueryData( imagesApi.util.updateQueryData(
@ -552,10 +555,9 @@ export const imagesApi = api.injectEndpoints({
) )
); );
const queryArgs = { const queryArgs = {
board_id: boardId ?? 'none', board_id: boardId ?? 'none',
categories categories,
}; };
const currentCache = imagesApi.endpoints.listImages.select( const currentCache = imagesApi.endpoints.listImages.select(
@ -566,11 +568,11 @@ export const imagesApi = api.injectEndpoints({
imageDTO.image_category imageDTO.image_category
) )
? boardsApi.endpoints.getBoardImagesTotal.select( ? boardsApi.endpoints.getBoardImagesTotal.select(
boardId ?? 'none' boardId ?? 'none'
)(getState()) )(getState())
: boardsApi.endpoints.getBoardAssetsTotal.select( : boardsApi.endpoints.getBoardAssetsTotal.select(
boardId ?? 'none' boardId ?? 'none'
)(getState()); )(getState());
const isCacheFullyPopulated = const isCacheFullyPopulated =
currentCache.data && currentCache.data &&
@ -590,7 +592,7 @@ export const imagesApi = api.injectEndpoints({
(draft) => { (draft) => {
imagesAdapter.upsertOne(draft, { imagesAdapter.upsertOne(draft, {
...imageDTO, ...imageDTO,
starred: false starred: false,
}); });
} }
) )
@ -941,11 +943,11 @@ export const imagesApi = api.injectEndpoints({
imageDTO.image_category imageDTO.image_category
) )
? boardsApi.endpoints.getBoardImagesTotal.select( ? boardsApi.endpoints.getBoardImagesTotal.select(
imageDTO.board_id ?? 'none' imageDTO.board_id ?? 'none'
)(getState()) )(getState())
: boardsApi.endpoints.getBoardAssetsTotal.select( : boardsApi.endpoints.getBoardAssetsTotal.select(
imageDTO.board_id ?? 'none' imageDTO.board_id ?? 'none'
)(getState()); )(getState());
const isCacheFullyPopulated = const isCacheFullyPopulated =
currentCache.data && currentCache.data.ids.length >= (total ?? 0); currentCache.data && currentCache.data.ids.length >= (total ?? 0);
@ -1061,11 +1063,11 @@ export const imagesApi = api.injectEndpoints({
imageDTO.image_category imageDTO.image_category
) )
? boardsApi.endpoints.getBoardImagesTotal.select( ? boardsApi.endpoints.getBoardImagesTotal.select(
imageDTO.board_id ?? 'none' imageDTO.board_id ?? 'none'
)(getState()) )(getState())
: boardsApi.endpoints.getBoardAssetsTotal.select( : boardsApi.endpoints.getBoardAssetsTotal.select(
imageDTO.board_id ?? 'none' imageDTO.board_id ?? 'none'
)(getState()); )(getState());
const isCacheFullyPopulated = const isCacheFullyPopulated =
currentCache.data && currentCache.data.ids.length >= (total ?? 0); currentCache.data && currentCache.data.ids.length >= (total ?? 0);
@ -1188,11 +1190,11 @@ export const imagesApi = api.injectEndpoints({
imageDTO.image_category imageDTO.image_category
) )
? boardsApi.endpoints.getBoardImagesTotal.select( ? boardsApi.endpoints.getBoardImagesTotal.select(
new_board_id ?? 'none' new_board_id ?? 'none'
)(getState()) )(getState())
: boardsApi.endpoints.getBoardAssetsTotal.select( : boardsApi.endpoints.getBoardAssetsTotal.select(
new_board_id ?? 'none' new_board_id ?? 'none'
)(getState()); )(getState());
const isCacheFullyPopulated = const isCacheFullyPopulated =
currentCache.data && currentCache.data &&
@ -1319,11 +1321,11 @@ export const imagesApi = api.injectEndpoints({
imageDTO.image_category imageDTO.image_category
) )
? boardsApi.endpoints.getBoardImagesTotal.select( ? boardsApi.endpoints.getBoardImagesTotal.select(
imageDTO.board_id ?? 'none' imageDTO.board_id ?? 'none'
)(getState()) )(getState())
: boardsApi.endpoints.getBoardAssetsTotal.select( : boardsApi.endpoints.getBoardAssetsTotal.select(
imageDTO.board_id ?? 'none' imageDTO.board_id ?? 'none'
)(getState()); )(getState());
const isCacheFullyPopulated = const isCacheFullyPopulated =
currentCache.data && currentCache.data.ids.length >= (total ?? 0); currentCache.data && currentCache.data.ids.length >= (total ?? 0);
@ -1376,5 +1378,5 @@ export const {
useDeleteBoardAndImagesMutation, useDeleteBoardAndImagesMutation,
useDeleteBoardMutation, useDeleteBoardMutation,
useStarImagesMutation, useStarImagesMutation,
useUnstarImagesMutation useUnstarImagesMutation,
} = imagesApi; } = imagesApi;

View File

@ -1958,10 +1958,8 @@ export type components = {
| components['schemas']['SDXLLoraLoaderInvocation'] | components['schemas']['SDXLLoraLoaderInvocation']
| components['schemas']['VaeLoaderInvocation'] | components['schemas']['VaeLoaderInvocation']
| components['schemas']['MetadataAccumulatorInvocation'] | components['schemas']['MetadataAccumulatorInvocation']
| components['schemas']['RangeInvocation'] | components['schemas']['SDXLModelLoaderInvocation']
| components['schemas']['RangeOfSizeInvocation'] | components['schemas']['SDXLRefinerModelLoaderInvocation']
| components['schemas']['RandomRangeInvocation']
| components['schemas']['ImageCollectionInvocation']
| components['schemas']['CompelInvocation'] | components['schemas']['CompelInvocation']
| components['schemas']['SDXLCompelPromptInvocation'] | components['schemas']['SDXLCompelPromptInvocation']
| components['schemas']['SDXLRefinerCompelPromptInvocation'] | components['schemas']['SDXLRefinerCompelPromptInvocation']
@ -1987,21 +1985,11 @@ export type components = {
| components['schemas']['ImageHueAdjustmentInvocation'] | components['schemas']['ImageHueAdjustmentInvocation']
| components['schemas']['ImageLuminosityAdjustmentInvocation'] | components['schemas']['ImageLuminosityAdjustmentInvocation']
| components['schemas']['ImageSaturationAdjustmentInvocation'] | components['schemas']['ImageSaturationAdjustmentInvocation']
| components['schemas']['CvInpaintInvocation']
| components['schemas']['InfillColorInvocation']
| components['schemas']['InfillTileInvocation']
| components['schemas']['InfillPatchMatchInvocation']
| components['schemas']['DenoiseLatentsInvocation'] | components['schemas']['DenoiseLatentsInvocation']
| components['schemas']['LatentsToImageInvocation'] | components['schemas']['LatentsToImageInvocation']
| components['schemas']['ResizeLatentsInvocation'] | components['schemas']['ResizeLatentsInvocation']
| components['schemas']['ScaleLatentsInvocation'] | components['schemas']['ScaleLatentsInvocation']
| components['schemas']['ImageToLatentsInvocation'] | components['schemas']['ImageToLatentsInvocation']
| components['schemas']['AddInvocation']
| components['schemas']['SubtractInvocation']
| components['schemas']['MultiplyInvocation']
| components['schemas']['DivideInvocation']
| components['schemas']['RandomIntInvocation']
| components['schemas']['NoiseInvocation']
| components['schemas']['ONNXPromptInvocation'] | components['schemas']['ONNXPromptInvocation']
| components['schemas']['ONNXTextToLatentsInvocation'] | components['schemas']['ONNXTextToLatentsInvocation']
| components['schemas']['ONNXLatentsToImageInvocation'] | components['schemas']['ONNXLatentsToImageInvocation']
@ -2009,15 +1997,27 @@ export type components = {
| components['schemas']['OnnxModelLoaderInvocation'] | components['schemas']['OnnxModelLoaderInvocation']
| components['schemas']['DynamicPromptInvocation'] | components['schemas']['DynamicPromptInvocation']
| components['schemas']['PromptsFromFileInvocation'] | components['schemas']['PromptsFromFileInvocation']
| components['schemas']['AddInvocation']
| components['schemas']['SubtractInvocation']
| components['schemas']['MultiplyInvocation']
| components['schemas']['DivideInvocation']
| components['schemas']['RandomIntInvocation']
| components['schemas']['ParamIntInvocation'] | components['schemas']['ParamIntInvocation']
| components['schemas']['ParamFloatInvocation'] | components['schemas']['ParamFloatInvocation']
| components['schemas']['ParamStringInvocation'] | components['schemas']['ParamStringInvocation']
| components['schemas']['ParamPromptInvocation'] | components['schemas']['ParamPromptInvocation']
| components['schemas']['CvInpaintInvocation']
| components['schemas']['RangeInvocation']
| components['schemas']['RangeOfSizeInvocation']
| components['schemas']['RandomRangeInvocation']
| components['schemas']['ImageCollectionInvocation']
| components['schemas']['FloatLinearRangeInvocation'] | components['schemas']['FloatLinearRangeInvocation']
| components['schemas']['StepParamEasingInvocation'] | components['schemas']['StepParamEasingInvocation']
| components['schemas']['SDXLModelLoaderInvocation'] | components['schemas']['NoiseInvocation']
| components['schemas']['SDXLRefinerModelLoaderInvocation']
| components['schemas']['ESRGANInvocation'] | components['schemas']['ESRGANInvocation']
| components['schemas']['InfillColorInvocation']
| components['schemas']['InfillTileInvocation']
| components['schemas']['InfillPatchMatchInvocation']
| components['schemas']['GraphInvocation'] | components['schemas']['GraphInvocation']
| components['schemas']['IterateInvocation'] | components['schemas']['IterateInvocation']
| components['schemas']['CollectInvocation'] | components['schemas']['CollectInvocation']
@ -2082,22 +2082,8 @@ export type components = {
results: { results: {
[key: string]: [key: string]:
| ( | (
| components['schemas']['BooleanOutput']
| components['schemas']['BooleanCollectionOutput']
| components['schemas']['IntegerOutput']
| components['schemas']['IntegerCollectionOutput']
| components['schemas']['FloatOutput']
| components['schemas']['FloatCollectionOutput']
| components['schemas']['StringOutput']
| components['schemas']['StringCollectionOutput']
| components['schemas']['ImageOutput'] | components['schemas']['ImageOutput']
| components['schemas']['ImageCollectionOutput'] | components['schemas']['MaskOutput']
| components['schemas']['LatentsOutput']
| components['schemas']['LatentsCollectionOutput']
| components['schemas']['ColorOutput']
| components['schemas']['ColorCollectionOutput']
| components['schemas']['ConditioningOutput']
| components['schemas']['ConditioningCollectionOutput']
| components['schemas']['ControlOutput'] | components['schemas']['ControlOutput']
| components['schemas']['ModelLoaderOutput'] | components['schemas']['ModelLoaderOutput']
| components['schemas']['LoraLoaderOutput'] | components['schemas']['LoraLoaderOutput']
@ -2106,8 +2092,18 @@ export type components = {
| components['schemas']['MetadataAccumulatorOutput'] | components['schemas']['MetadataAccumulatorOutput']
| components['schemas']['SDXLModelLoaderOutput'] | components['schemas']['SDXLModelLoaderOutput']
| components['schemas']['SDXLRefinerModelLoaderOutput'] | components['schemas']['SDXLRefinerModelLoaderOutput']
| components['schemas']['CompelOutput']
| components['schemas']['ClipSkipInvocationOutput'] | components['schemas']['ClipSkipInvocationOutput']
| components['schemas']['LatentsOutput']
| components['schemas']['ONNXModelLoaderOutput'] | 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']['NoiseOutput']
| components['schemas']['GraphInvocationOutput'] | components['schemas']['GraphInvocationOutput']
| components['schemas']['IterateInvocationOutput'] | components['schemas']['IterateInvocationOutput']
@ -3175,6 +3171,14 @@ export type components = {
*/ */
metadata?: components['schemas']['CoreMetadata']; metadata?: components['schemas']['CoreMetadata'];
}; };
/** ImagesUpdatedFromListResult */
ImagesUpdatedFromListResult: {
/**
* Updated Image Names
* @description The image names that were updated
*/
updated_image_names: string[];
};
/** /**
* Solid Color Infill * Solid Color Infill
* @description Infills transparent areas of an image with a solid color * @description Infills transparent areas of an image with a solid color
@ -6405,100 +6409,6 @@ export type components = {
*/ */
image?: components['schemas']['ImageField']; image?: components['schemas']['ImageField'];
}; };
/**
* StableDiffusion2ModelFormat
* @description An enumeration.
* @enum {string}
*/
Input: 'connection' | 'direct' | 'any';
/**
* ControlNetModelFormat
* @description An enumeration.
* @enum {string}
*/
ControlNetModelFormat: 'checkpoint' | 'diffusers';
/**
* StableDiffusion1ModelFormat
* @description An enumeration.
* @enum {string}
*/
UIType:
| 'integer'
| 'float'
| 'boolean'
| 'string'
| 'array'
| 'ImageField'
| 'LatentsField'
| 'ConditioningField'
| 'ControlField'
| 'ColorField'
| 'ImageCollection'
| 'ConditioningCollection'
| 'ColorCollection'
| 'LatentsCollection'
| 'IntegerCollection'
| 'FloatCollection'
| 'StringCollection'
| 'BooleanCollection'
| 'MainModelField'
| 'SDXLMainModelField'
| 'SDXLRefinerModelField'
| 'ONNXModelField'
| 'VaeModelField'
| 'LoRAModelField'
| 'ControlNetModelField'
| 'UNetField'
| 'VaeField'
| 'ClipField'
| 'Collection'
| 'CollectionItem'
| 'FilePath'
| 'enum';
/**
* StableDiffusionOnnxModelFormat
* @description An enumeration.
* @enum {string}
*/
StableDiffusionOnnxModelFormat: 'olive' | 'onnx';
/**
* _InputField
* @description *DO NOT USE*
* This helper class is used to tell the client about our custom field attributes via OpenAPI
* schema generation, and Typescript type generation from that schema. It serves no functional
* purpose in the backend.
*/
_InputField: {
input: components['schemas']['Input'];
/** Ui Hidden */
ui_hidden: boolean;
ui_type?: components['schemas']['UIType'];
ui_component?: components['schemas']['UIComponent'];
};
/**
* _OutputField
* @description *DO NOT USE*
* This helper class is used to tell the client about our custom field attributes via OpenAPI
* schema generation, and Typescript type generation from that schema. It serves no functional
* purpose in the backend.
*/
_OutputField: {
/** Ui Hidden */
ui_hidden: boolean;
ui_type?: components['schemas']['UIType'];
};
/**
* StableDiffusionXLModelFormat
* @description An enumeration.
* @enum {string}
*/
StableDiffusionXLModelFormat: 'checkpoint' | 'diffusers';
/**
* StableDiffusion1ModelFormat
* @description An enumeration.
* @enum {string}
*/
StableDiffusion1ModelFormat: 'checkpoint' | 'diffusers';
/** /**
* ControlNetModelFormat * ControlNetModelFormat
* @description An enumeration. * @description An enumeration.
@ -6511,12 +6421,24 @@ export type components = {
* @enum {string} * @enum {string}
*/ */
StableDiffusion2ModelFormat: 'checkpoint' | 'diffusers'; StableDiffusion2ModelFormat: 'checkpoint' | 'diffusers';
/**
* StableDiffusionXLModelFormat
* @description An enumeration.
* @enum {string}
*/
StableDiffusionXLModelFormat: 'checkpoint' | 'diffusers';
/** /**
* StableDiffusionOnnxModelFormat * StableDiffusionOnnxModelFormat
* @description An enumeration. * @description An enumeration.
* @enum {string} * @enum {string}
*/ */
StableDiffusionOnnxModelFormat: 'olive' | 'onnx'; StableDiffusionOnnxModelFormat: 'olive' | 'onnx';
/**
* StableDiffusion1ModelFormat
* @description An enumeration.
* @enum {string}
*/
StableDiffusion1ModelFormat: 'checkpoint' | 'diffusers';
}; };
responses: never; responses: never;
parameters: never; parameters: never;
@ -6634,10 +6556,8 @@ export type operations = {
| components['schemas']['SDXLLoraLoaderInvocation'] | components['schemas']['SDXLLoraLoaderInvocation']
| components['schemas']['VaeLoaderInvocation'] | components['schemas']['VaeLoaderInvocation']
| components['schemas']['MetadataAccumulatorInvocation'] | components['schemas']['MetadataAccumulatorInvocation']
| components['schemas']['RangeInvocation'] | components['schemas']['SDXLModelLoaderInvocation']
| components['schemas']['RangeOfSizeInvocation'] | components['schemas']['SDXLRefinerModelLoaderInvocation']
| components['schemas']['RandomRangeInvocation']
| components['schemas']['ImageCollectionInvocation']
| components['schemas']['CompelInvocation'] | components['schemas']['CompelInvocation']
| components['schemas']['SDXLCompelPromptInvocation'] | components['schemas']['SDXLCompelPromptInvocation']
| components['schemas']['SDXLRefinerCompelPromptInvocation'] | components['schemas']['SDXLRefinerCompelPromptInvocation']
@ -6663,21 +6583,11 @@ export type operations = {
| components['schemas']['ImageHueAdjustmentInvocation'] | components['schemas']['ImageHueAdjustmentInvocation']
| components['schemas']['ImageLuminosityAdjustmentInvocation'] | components['schemas']['ImageLuminosityAdjustmentInvocation']
| components['schemas']['ImageSaturationAdjustmentInvocation'] | components['schemas']['ImageSaturationAdjustmentInvocation']
| components['schemas']['CvInpaintInvocation']
| components['schemas']['InfillColorInvocation']
| components['schemas']['InfillTileInvocation']
| components['schemas']['InfillPatchMatchInvocation']
| components['schemas']['DenoiseLatentsInvocation'] | components['schemas']['DenoiseLatentsInvocation']
| components['schemas']['LatentsToImageInvocation'] | components['schemas']['LatentsToImageInvocation']
| components['schemas']['ResizeLatentsInvocation'] | components['schemas']['ResizeLatentsInvocation']
| components['schemas']['ScaleLatentsInvocation'] | components['schemas']['ScaleLatentsInvocation']
| components['schemas']['ImageToLatentsInvocation'] | components['schemas']['ImageToLatentsInvocation']
| components['schemas']['AddInvocation']
| components['schemas']['SubtractInvocation']
| components['schemas']['MultiplyInvocation']
| components['schemas']['DivideInvocation']
| components['schemas']['RandomIntInvocation']
| components['schemas']['NoiseInvocation']
| components['schemas']['ONNXPromptInvocation'] | components['schemas']['ONNXPromptInvocation']
| components['schemas']['ONNXTextToLatentsInvocation'] | components['schemas']['ONNXTextToLatentsInvocation']
| components['schemas']['ONNXLatentsToImageInvocation'] | components['schemas']['ONNXLatentsToImageInvocation']
@ -6685,15 +6595,27 @@ export type operations = {
| components['schemas']['OnnxModelLoaderInvocation'] | components['schemas']['OnnxModelLoaderInvocation']
| components['schemas']['DynamicPromptInvocation'] | components['schemas']['DynamicPromptInvocation']
| components['schemas']['PromptsFromFileInvocation'] | components['schemas']['PromptsFromFileInvocation']
| components['schemas']['AddInvocation']
| components['schemas']['SubtractInvocation']
| components['schemas']['MultiplyInvocation']
| components['schemas']['DivideInvocation']
| components['schemas']['RandomIntInvocation']
| components['schemas']['ParamIntInvocation'] | components['schemas']['ParamIntInvocation']
| components['schemas']['ParamFloatInvocation'] | components['schemas']['ParamFloatInvocation']
| components['schemas']['ParamStringInvocation'] | components['schemas']['ParamStringInvocation']
| components['schemas']['ParamPromptInvocation'] | components['schemas']['ParamPromptInvocation']
| components['schemas']['CvInpaintInvocation']
| components['schemas']['RangeInvocation']
| components['schemas']['RangeOfSizeInvocation']
| components['schemas']['RandomRangeInvocation']
| components['schemas']['ImageCollectionInvocation']
| components['schemas']['FloatLinearRangeInvocation'] | components['schemas']['FloatLinearRangeInvocation']
| components['schemas']['StepParamEasingInvocation'] | components['schemas']['StepParamEasingInvocation']
| components['schemas']['SDXLModelLoaderInvocation'] | components['schemas']['NoiseInvocation']
| components['schemas']['SDXLRefinerModelLoaderInvocation']
| components['schemas']['ESRGANInvocation'] | components['schemas']['ESRGANInvocation']
| components['schemas']['InfillColorInvocation']
| components['schemas']['InfillTileInvocation']
| components['schemas']['InfillPatchMatchInvocation']
| components['schemas']['GraphInvocation'] | components['schemas']['GraphInvocation']
| components['schemas']['IterateInvocation'] | components['schemas']['IterateInvocation']
| components['schemas']['CollectInvocation'] | components['schemas']['CollectInvocation']
@ -6756,10 +6678,8 @@ export type operations = {
| components['schemas']['SDXLLoraLoaderInvocation'] | components['schemas']['SDXLLoraLoaderInvocation']
| components['schemas']['VaeLoaderInvocation'] | components['schemas']['VaeLoaderInvocation']
| components['schemas']['MetadataAccumulatorInvocation'] | components['schemas']['MetadataAccumulatorInvocation']
| components['schemas']['RangeInvocation'] | components['schemas']['SDXLModelLoaderInvocation']
| components['schemas']['RangeOfSizeInvocation'] | components['schemas']['SDXLRefinerModelLoaderInvocation']
| components['schemas']['RandomRangeInvocation']
| components['schemas']['ImageCollectionInvocation']
| components['schemas']['CompelInvocation'] | components['schemas']['CompelInvocation']
| components['schemas']['SDXLCompelPromptInvocation'] | components['schemas']['SDXLCompelPromptInvocation']
| components['schemas']['SDXLRefinerCompelPromptInvocation'] | components['schemas']['SDXLRefinerCompelPromptInvocation']
@ -6785,21 +6705,11 @@ export type operations = {
| components['schemas']['ImageHueAdjustmentInvocation'] | components['schemas']['ImageHueAdjustmentInvocation']
| components['schemas']['ImageLuminosityAdjustmentInvocation'] | components['schemas']['ImageLuminosityAdjustmentInvocation']
| components['schemas']['ImageSaturationAdjustmentInvocation'] | components['schemas']['ImageSaturationAdjustmentInvocation']
| components['schemas']['CvInpaintInvocation']
| components['schemas']['InfillColorInvocation']
| components['schemas']['InfillTileInvocation']
| components['schemas']['InfillPatchMatchInvocation']
| components['schemas']['DenoiseLatentsInvocation'] | components['schemas']['DenoiseLatentsInvocation']
| components['schemas']['LatentsToImageInvocation'] | components['schemas']['LatentsToImageInvocation']
| components['schemas']['ResizeLatentsInvocation'] | components['schemas']['ResizeLatentsInvocation']
| components['schemas']['ScaleLatentsInvocation'] | components['schemas']['ScaleLatentsInvocation']
| components['schemas']['ImageToLatentsInvocation'] | components['schemas']['ImageToLatentsInvocation']
| components['schemas']['AddInvocation']
| components['schemas']['SubtractInvocation']
| components['schemas']['MultiplyInvocation']
| components['schemas']['DivideInvocation']
| components['schemas']['RandomIntInvocation']
| components['schemas']['NoiseInvocation']
| components['schemas']['ONNXPromptInvocation'] | components['schemas']['ONNXPromptInvocation']
| components['schemas']['ONNXTextToLatentsInvocation'] | components['schemas']['ONNXTextToLatentsInvocation']
| components['schemas']['ONNXLatentsToImageInvocation'] | components['schemas']['ONNXLatentsToImageInvocation']
@ -6807,15 +6717,27 @@ export type operations = {
| components['schemas']['OnnxModelLoaderInvocation'] | components['schemas']['OnnxModelLoaderInvocation']
| components['schemas']['DynamicPromptInvocation'] | components['schemas']['DynamicPromptInvocation']
| components['schemas']['PromptsFromFileInvocation'] | components['schemas']['PromptsFromFileInvocation']
| components['schemas']['AddInvocation']
| components['schemas']['SubtractInvocation']
| components['schemas']['MultiplyInvocation']
| components['schemas']['DivideInvocation']
| components['schemas']['RandomIntInvocation']
| components['schemas']['ParamIntInvocation'] | components['schemas']['ParamIntInvocation']
| components['schemas']['ParamFloatInvocation'] | components['schemas']['ParamFloatInvocation']
| components['schemas']['ParamStringInvocation'] | components['schemas']['ParamStringInvocation']
| components['schemas']['ParamPromptInvocation'] | components['schemas']['ParamPromptInvocation']
| components['schemas']['CvInpaintInvocation']
| components['schemas']['RangeInvocation']
| components['schemas']['RangeOfSizeInvocation']
| components['schemas']['RandomRangeInvocation']
| components['schemas']['ImageCollectionInvocation']
| components['schemas']['FloatLinearRangeInvocation'] | components['schemas']['FloatLinearRangeInvocation']
| components['schemas']['StepParamEasingInvocation'] | components['schemas']['StepParamEasingInvocation']
| components['schemas']['SDXLModelLoaderInvocation'] | components['schemas']['NoiseInvocation']
| components['schemas']['SDXLRefinerModelLoaderInvocation']
| components['schemas']['ESRGANInvocation'] | components['schemas']['ESRGANInvocation']
| components['schemas']['InfillColorInvocation']
| components['schemas']['InfillTileInvocation']
| components['schemas']['InfillPatchMatchInvocation']
| components['schemas']['GraphInvocation'] | components['schemas']['GraphInvocation']
| components['schemas']['IterateInvocation'] | components['schemas']['IterateInvocation']
| components['schemas']['CollectInvocation'] | components['schemas']['CollectInvocation']
@ -7718,7 +7640,7 @@ export type operations = {
/** @description Successful Response */ /** @description Successful Response */
200: { 200: {
content: { content: {
'application/json': unknown; 'application/json': components['schemas']['ImagesUpdatedFromListResult'];
}; };
}; };
/** @description Validation Error */ /** @description Validation Error */
@ -7740,7 +7662,7 @@ export type operations = {
/** @description Successful Response */ /** @description Successful Response */
200: { 200: {
content: { content: {
'application/json': unknown; 'application/json': components['schemas']['ImagesUpdatedFromListResult'];
}; };
}; };
/** @description Validation Error */ /** @description Validation Error */