mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat: Add Canvas Output node to all Canvas Graphs
This commit is contained in:
parent
27bd127fb0
commit
ad96c41156
@ -7,7 +7,7 @@ import {
|
|||||||
imageSelected,
|
imageSelected,
|
||||||
} from 'features/gallery/store/gallerySlice';
|
} from 'features/gallery/store/gallerySlice';
|
||||||
import { IMAGE_CATEGORIES } from 'features/gallery/store/types';
|
import { IMAGE_CATEGORIES } from 'features/gallery/store/types';
|
||||||
import { INPAINT_FINAL_IMAGE } from 'features/nodes/util/graphBuilders/constants';
|
import { CANVAS_OUTPUT } from 'features/nodes/util/graphBuilders/constants';
|
||||||
import { progressImageSet } from 'features/system/store/systemSlice';
|
import { progressImageSet } from 'features/system/store/systemSlice';
|
||||||
import { imagesApi } from 'services/api/endpoints/images';
|
import { imagesApi } from 'services/api/endpoints/images';
|
||||||
import { isImageOutput } from 'services/api/guards';
|
import { isImageOutput } from 'services/api/guards';
|
||||||
@ -55,7 +55,7 @@ export const addInvocationCompleteEventListener = () => {
|
|||||||
if (
|
if (
|
||||||
graph_execution_state_id ===
|
graph_execution_state_id ===
|
||||||
canvas.layerState.stagingArea.sessionId &&
|
canvas.layerState.stagingArea.sessionId &&
|
||||||
data.source_node_id === INPAINT_FINAL_IMAGE
|
[CANVAS_OUTPUT].includes(data.source_node_id)
|
||||||
) {
|
) {
|
||||||
dispatch(addImageToStagingArea(imageDTO));
|
dispatch(addImageToStagingArea(imageDTO));
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ import { addNSFWCheckerToGraph } from './addNSFWCheckerToGraph';
|
|||||||
import { addVAEToGraph } from './addVAEToGraph';
|
import { addVAEToGraph } from './addVAEToGraph';
|
||||||
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
||||||
import {
|
import {
|
||||||
|
CANVAS_OUTPUT,
|
||||||
CLIP_SKIP,
|
CLIP_SKIP,
|
||||||
DENOISE_LATENTS,
|
DENOISE_LATENTS,
|
||||||
IMAGE_TO_IMAGE_GRAPH,
|
IMAGE_TO_IMAGE_GRAPH,
|
||||||
@ -129,6 +130,10 @@ export const buildCanvasImageToImageGraph = (
|
|||||||
id: LATENTS_TO_IMAGE,
|
id: LATENTS_TO_IMAGE,
|
||||||
is_intermediate: !shouldAutoSave,
|
is_intermediate: !shouldAutoSave,
|
||||||
},
|
},
|
||||||
|
[CANVAS_OUTPUT]: {
|
||||||
|
type: 'load_image',
|
||||||
|
id: CANVAS_OUTPUT,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
edges: [
|
edges: [
|
||||||
// Connect Model Loader to CLIP Skip and UNet
|
// Connect Model Loader to CLIP Skip and UNet
|
||||||
@ -225,6 +230,17 @@ export const buildCanvasImageToImageGraph = (
|
|||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// Canvas Output
|
||||||
|
{
|
||||||
|
source: {
|
||||||
|
node_id: LATENTS_TO_IMAGE,
|
||||||
|
field: 'image',
|
||||||
|
},
|
||||||
|
destination: {
|
||||||
|
node_id: CANVAS_OUTPUT,
|
||||||
|
field: 'image',
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,10 +12,10 @@ import { addNSFWCheckerToGraph } from './addNSFWCheckerToGraph';
|
|||||||
import { addVAEToGraph } from './addVAEToGraph';
|
import { addVAEToGraph } from './addVAEToGraph';
|
||||||
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
||||||
import {
|
import {
|
||||||
|
CANVAS_OUTPUT,
|
||||||
CLIP_SKIP,
|
CLIP_SKIP,
|
||||||
COLOR_CORRECT,
|
COLOR_CORRECT,
|
||||||
INPAINT,
|
INPAINT,
|
||||||
INPAINT_FINAL_IMAGE,
|
|
||||||
INPAINT_GRAPH,
|
INPAINT_GRAPH,
|
||||||
INPAINT_IMAGE,
|
INPAINT_IMAGE,
|
||||||
ITERATE,
|
ITERATE,
|
||||||
@ -149,9 +149,9 @@ export const buildCanvasInpaintGraph = (
|
|||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
reference: canvasInitImage,
|
reference: canvasInitImage,
|
||||||
},
|
},
|
||||||
[INPAINT_FINAL_IMAGE]: {
|
[CANVAS_OUTPUT]: {
|
||||||
type: 'img_paste',
|
type: 'img_paste',
|
||||||
id: INPAINT_FINAL_IMAGE,
|
id: CANVAS_OUTPUT,
|
||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
base_image: canvasInitImage,
|
base_image: canvasInitImage,
|
||||||
},
|
},
|
||||||
@ -324,7 +324,7 @@ export const buildCanvasInpaintGraph = (
|
|||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT_FINAL_IMAGE,
|
node_id: CANVAS_OUTPUT,
|
||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -334,7 +334,7 @@ export const buildCanvasInpaintGraph = (
|
|||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT_FINAL_IMAGE,
|
node_id: CANVAS_OUTPUT,
|
||||||
field: 'mask',
|
field: 'mask',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -14,10 +14,10 @@ import { addNSFWCheckerToGraph } from './addNSFWCheckerToGraph';
|
|||||||
import { addVAEToGraph } from './addVAEToGraph';
|
import { addVAEToGraph } from './addVAEToGraph';
|
||||||
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
||||||
import {
|
import {
|
||||||
|
CANVAS_OUTPUT,
|
||||||
CLIP_SKIP,
|
CLIP_SKIP,
|
||||||
COLOR_CORRECT,
|
COLOR_CORRECT,
|
||||||
INPAINT,
|
INPAINT,
|
||||||
INPAINT_FINAL_IMAGE,
|
|
||||||
INPAINT_GRAPH,
|
INPAINT_GRAPH,
|
||||||
INPAINT_IMAGE,
|
INPAINT_IMAGE,
|
||||||
INPAINT_INFILL,
|
INPAINT_INFILL,
|
||||||
@ -183,9 +183,9 @@ export const buildCanvasOutpaintGraph = (
|
|||||||
id: COLOR_CORRECT,
|
id: COLOR_CORRECT,
|
||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
},
|
},
|
||||||
[INPAINT_FINAL_IMAGE]: {
|
[CANVAS_OUTPUT]: {
|
||||||
type: 'img_paste',
|
type: 'img_paste',
|
||||||
id: INPAINT_FINAL_IMAGE,
|
id: CANVAS_OUTPUT,
|
||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
},
|
},
|
||||||
[RANGE_OF_SIZE]: {
|
[RANGE_OF_SIZE]: {
|
||||||
@ -399,7 +399,7 @@ export const buildCanvasOutpaintGraph = (
|
|||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT_FINAL_IMAGE,
|
node_id: CANVAS_OUTPUT,
|
||||||
field: 'base_image',
|
field: 'base_image',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -409,7 +409,7 @@ export const buildCanvasOutpaintGraph = (
|
|||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT_FINAL_IMAGE,
|
node_id: CANVAS_OUTPUT,
|
||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -419,7 +419,7 @@ export const buildCanvasOutpaintGraph = (
|
|||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT_FINAL_IMAGE,
|
node_id: CANVAS_OUTPUT,
|
||||||
field: 'mask',
|
field: 'mask',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -15,6 +15,7 @@ import { addSDXLRefinerToGraph } from './addSDXLRefinerToGraph';
|
|||||||
import { addVAEToGraph } from './addVAEToGraph';
|
import { addVAEToGraph } from './addVAEToGraph';
|
||||||
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
||||||
import {
|
import {
|
||||||
|
CANVAS_OUTPUT,
|
||||||
DENOISE_LATENTS,
|
DENOISE_LATENTS,
|
||||||
IMAGE_TO_IMAGE_GRAPH,
|
IMAGE_TO_IMAGE_GRAPH,
|
||||||
IMAGE_TO_LATENTS,
|
IMAGE_TO_LATENTS,
|
||||||
@ -136,6 +137,10 @@ export const buildCanvasSDXLImageToImageGraph = (
|
|||||||
id: LATENTS_TO_IMAGE,
|
id: LATENTS_TO_IMAGE,
|
||||||
is_intermediate: !shouldAutoSave,
|
is_intermediate: !shouldAutoSave,
|
||||||
},
|
},
|
||||||
|
[CANVAS_OUTPUT]: {
|
||||||
|
type: 'load_image',
|
||||||
|
id: CANVAS_OUTPUT,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
edges: [
|
edges: [
|
||||||
// Connect Model Loader To UNet & CLIP
|
// Connect Model Loader To UNet & CLIP
|
||||||
@ -241,6 +246,17 @@ export const buildCanvasSDXLImageToImageGraph = (
|
|||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// Canvas Output
|
||||||
|
{
|
||||||
|
source: {
|
||||||
|
node_id: LATENTS_TO_IMAGE,
|
||||||
|
field: 'image',
|
||||||
|
},
|
||||||
|
destination: {
|
||||||
|
node_id: CANVAS_OUTPUT,
|
||||||
|
field: 'image',
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@ import { addSDXLRefinerToGraph } from './addSDXLRefinerToGraph';
|
|||||||
import { addVAEToGraph } from './addVAEToGraph';
|
import { addVAEToGraph } from './addVAEToGraph';
|
||||||
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
||||||
import {
|
import {
|
||||||
|
CANVAS_OUTPUT,
|
||||||
COLOR_CORRECT,
|
COLOR_CORRECT,
|
||||||
INPAINT,
|
INPAINT,
|
||||||
INPAINT_FINAL_IMAGE,
|
|
||||||
INPAINT_GRAPH,
|
INPAINT_GRAPH,
|
||||||
INPAINT_IMAGE,
|
INPAINT_IMAGE,
|
||||||
ITERATE,
|
ITERATE,
|
||||||
@ -153,9 +153,9 @@ export const buildCanvasSDXLInpaintGraph = (
|
|||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
reference: canvasInitImage,
|
reference: canvasInitImage,
|
||||||
},
|
},
|
||||||
[INPAINT_FINAL_IMAGE]: {
|
[CANVAS_OUTPUT]: {
|
||||||
type: 'img_paste',
|
type: 'img_paste',
|
||||||
id: INPAINT_FINAL_IMAGE,
|
id: CANVAS_OUTPUT,
|
||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
base_image: canvasInitImage,
|
base_image: canvasInitImage,
|
||||||
},
|
},
|
||||||
@ -337,7 +337,7 @@ export const buildCanvasSDXLInpaintGraph = (
|
|||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT_FINAL_IMAGE,
|
node_id: CANVAS_OUTPUT,
|
||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -347,7 +347,7 @@ export const buildCanvasSDXLInpaintGraph = (
|
|||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT_FINAL_IMAGE,
|
node_id: CANVAS_OUTPUT,
|
||||||
field: 'mask',
|
field: 'mask',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -15,9 +15,9 @@ import { addSDXLRefinerToGraph } from './addSDXLRefinerToGraph';
|
|||||||
import { addVAEToGraph } from './addVAEToGraph';
|
import { addVAEToGraph } from './addVAEToGraph';
|
||||||
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
||||||
import {
|
import {
|
||||||
|
CANVAS_OUTPUT,
|
||||||
COLOR_CORRECT,
|
COLOR_CORRECT,
|
||||||
INPAINT,
|
INPAINT,
|
||||||
INPAINT_FINAL_IMAGE,
|
|
||||||
INPAINT_GRAPH,
|
INPAINT_GRAPH,
|
||||||
INPAINT_IMAGE,
|
INPAINT_IMAGE,
|
||||||
INPAINT_INFILL,
|
INPAINT_INFILL,
|
||||||
@ -187,9 +187,9 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
id: COLOR_CORRECT,
|
id: COLOR_CORRECT,
|
||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
},
|
},
|
||||||
[INPAINT_FINAL_IMAGE]: {
|
[CANVAS_OUTPUT]: {
|
||||||
type: 'img_paste',
|
type: 'img_paste',
|
||||||
id: INPAINT_FINAL_IMAGE,
|
id: CANVAS_OUTPUT,
|
||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
},
|
},
|
||||||
[RANGE_OF_SIZE]: {
|
[RANGE_OF_SIZE]: {
|
||||||
@ -412,7 +412,7 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT_FINAL_IMAGE,
|
node_id: CANVAS_OUTPUT,
|
||||||
field: 'base_image',
|
field: 'base_image',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -422,7 +422,7 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT_FINAL_IMAGE,
|
node_id: CANVAS_OUTPUT,
|
||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -432,7 +432,7 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT_FINAL_IMAGE,
|
node_id: CANVAS_OUTPUT,
|
||||||
field: 'mask',
|
field: 'mask',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -14,6 +14,7 @@ import { addSDXLRefinerToGraph } from './addSDXLRefinerToGraph';
|
|||||||
import { addVAEToGraph } from './addVAEToGraph';
|
import { addVAEToGraph } from './addVAEToGraph';
|
||||||
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
||||||
import {
|
import {
|
||||||
|
CANVAS_OUTPUT,
|
||||||
DENOISE_LATENTS,
|
DENOISE_LATENTS,
|
||||||
LATENTS_TO_IMAGE,
|
LATENTS_TO_IMAGE,
|
||||||
METADATA_ACCUMULATOR,
|
METADATA_ACCUMULATOR,
|
||||||
@ -148,6 +149,10 @@ export const buildCanvasSDXLTextToImageGraph = (
|
|||||||
id: LATENTS_TO_IMAGE,
|
id: LATENTS_TO_IMAGE,
|
||||||
is_intermediate: !shouldAutoSave,
|
is_intermediate: !shouldAutoSave,
|
||||||
},
|
},
|
||||||
|
[CANVAS_OUTPUT]: {
|
||||||
|
type: 'load_image',
|
||||||
|
id: CANVAS_OUTPUT,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
edges: [
|
edges: [
|
||||||
// Connect Model Loader to UNet and CLIP
|
// Connect Model Loader to UNet and CLIP
|
||||||
@ -243,6 +248,17 @@ export const buildCanvasSDXLTextToImageGraph = (
|
|||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// Canvas Output
|
||||||
|
{
|
||||||
|
source: {
|
||||||
|
node_id: LATENTS_TO_IMAGE,
|
||||||
|
field: 'image',
|
||||||
|
},
|
||||||
|
destination: {
|
||||||
|
node_id: CANVAS_OUTPUT,
|
||||||
|
field: 'image',
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ import { addNSFWCheckerToGraph } from './addNSFWCheckerToGraph';
|
|||||||
import { addVAEToGraph } from './addVAEToGraph';
|
import { addVAEToGraph } from './addVAEToGraph';
|
||||||
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
||||||
import {
|
import {
|
||||||
|
CANVAS_OUTPUT,
|
||||||
CLIP_SKIP,
|
CLIP_SKIP,
|
||||||
DENOISE_LATENTS,
|
DENOISE_LATENTS,
|
||||||
LATENTS_TO_IMAGE,
|
LATENTS_TO_IMAGE,
|
||||||
@ -141,6 +142,10 @@ export const buildCanvasTextToImageGraph = (
|
|||||||
id: LATENTS_TO_IMAGE,
|
id: LATENTS_TO_IMAGE,
|
||||||
is_intermediate: !shouldAutoSave,
|
is_intermediate: !shouldAutoSave,
|
||||||
},
|
},
|
||||||
|
[CANVAS_OUTPUT]: {
|
||||||
|
type: 'load_image',
|
||||||
|
id: CANVAS_OUTPUT,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
edges: [
|
edges: [
|
||||||
// Connect Model Loader to UNet & CLIP Skip
|
// Connect Model Loader to UNet & CLIP Skip
|
||||||
@ -227,6 +232,17 @@ export const buildCanvasTextToImageGraph = (
|
|||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// Canvas Output
|
||||||
|
{
|
||||||
|
source: {
|
||||||
|
node_id: LATENTS_TO_IMAGE,
|
||||||
|
field: 'image',
|
||||||
|
},
|
||||||
|
destination: {
|
||||||
|
node_id: CANVAS_OUTPUT,
|
||||||
|
field: 'image',
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ export const CLIP_SKIP = 'clip_skip';
|
|||||||
export const IMAGE_TO_LATENTS = 'image_to_latents';
|
export const IMAGE_TO_LATENTS = 'image_to_latents';
|
||||||
export const LATENTS_TO_LATENTS = 'latents_to_latents';
|
export const LATENTS_TO_LATENTS = 'latents_to_latents';
|
||||||
export const RESIZE = 'resize_image';
|
export const RESIZE = 'resize_image';
|
||||||
|
export const CANVAS_OUTPUT = 'canvas_output';
|
||||||
export const INPAINT = 'inpaint';
|
export const INPAINT = 'inpaint';
|
||||||
export const INPAINT_SEAM_FIX = 'inpaint_seam_fix';
|
export const INPAINT_SEAM_FIX = 'inpaint_seam_fix';
|
||||||
export const INPAINT_IMAGE = 'inpaint_image';
|
export const INPAINT_IMAGE = 'inpaint_image';
|
||||||
|
Loading…
Reference in New Issue
Block a user