mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): img2img implementation
This commit is contained in:
parent
40b2d2b05b
commit
2db2c986d1
1
invokeai/frontend/web/src/app/invokeai.d.ts
vendored
1
invokeai/frontend/web/src/app/invokeai.d.ts
vendored
@ -124,6 +124,7 @@ export declare type Image = {
|
||||
category: GalleryCategory;
|
||||
isBase64?: boolean;
|
||||
dreamPrompt?: 'string';
|
||||
name?: string;
|
||||
};
|
||||
|
||||
// GalleryImages is an array of Image.
|
||||
|
@ -95,6 +95,7 @@ const makeSocketIOListeners = (
|
||||
width: 512,
|
||||
height: 512,
|
||||
category: 'result',
|
||||
name: data.result.image.image_name,
|
||||
mtime: new Date().getTime(),
|
||||
},
|
||||
})
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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<ImageToImageInvocation, 'id'> {
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user