diff --git a/invokeai/frontend/web/src/app/invokeai.d.ts b/invokeai/frontend/web/src/app/invokeai.d.ts index e01e414d03..d6cfbf209e 100644 --- a/invokeai/frontend/web/src/app/invokeai.d.ts +++ b/invokeai/frontend/web/src/app/invokeai.d.ts @@ -124,6 +124,7 @@ export declare type Image = { category: GalleryCategory; isBase64?: boolean; dreamPrompt?: 'string'; + name?: string; }; // GalleryImages is an array of Image. diff --git a/invokeai/frontend/web/src/app/nodesSocketio/listeners.ts b/invokeai/frontend/web/src/app/nodesSocketio/listeners.ts index 7a47f6a448..5bb330f67f 100644 --- a/invokeai/frontend/web/src/app/nodesSocketio/listeners.ts +++ b/invokeai/frontend/web/src/app/nodesSocketio/listeners.ts @@ -95,6 +95,7 @@ const makeSocketIOListeners = ( width: 512, height: 512, category: 'result', + name: data.result.image.image_name, mtime: new Date().getTime(), }, }) diff --git a/invokeai/frontend/web/src/common/util/buildGraph.ts b/invokeai/frontend/web/src/common/util/buildGraph.ts index 14da1ae655..c3a3d603cc 100644 --- a/invokeai/frontend/web/src/common/util/buildGraph.ts +++ b/invokeai/frontend/web/src/common/util/buildGraph.ts @@ -3,13 +3,16 @@ import { v4 as uuidv4 } from 'uuid'; import { RootState } from 'app/store'; import { InvokeTabName, tabMap } from 'features/ui/store/tabMap'; import { Graph } from 'services/api'; -import { buildTxt2ImgNode } from './buildNodes'; +import { buildImg2ImgNode, buildTxt2ImgNode } from './buildNodes'; function mapTabToFunction(activeTabName: InvokeTabName) { switch (activeTabName) { case 'txt2img': return buildTxt2ImgNode; + case 'img2img': + return buildImg2ImgNode; + default: return buildTxt2ImgNode; } diff --git a/invokeai/frontend/web/src/common/util/buildNodes.ts b/invokeai/frontend/web/src/common/util/buildNodes.ts index 6973a97505..6ddc6332d9 100644 --- a/invokeai/frontend/web/src/common/util/buildNodes.ts +++ b/invokeai/frontend/web/src/common/util/buildNodes.ts @@ -6,6 +6,8 @@ import { UpscaleInvocation, } from 'services/api'; +import { Image } from 'app/invokeai'; + // fe todo fix model type (frontend uses null, backend uses undefined) // fe todo update front end to store to have whole image field (vs just name) // be todo add symmetry fields @@ -50,7 +52,7 @@ export function buildImg2ImgNode( ): Omit { const { generation, system } = state; - const { shouldDisplayInProgressType, openModel: model } = system; + const { shouldDisplayInProgressType, model } = system; const { prompt, @@ -76,11 +78,10 @@ export function buildImg2ImgNode( cfg_scale: cfgScale, sampler_name: sampler as ImageToImageInvocation['sampler_name'], seamless, - model: model as string | undefined, + model, progress_images: shouldDisplayInProgressType === 'full-res', image: { - image_name: - typeof initialImage === 'string' ? initialImage : initialImage?.url, + image_name: (initialImage as Image).name, }, strength, fit,