feat(ui): add canvas objects to metadat a for all canvas graphs

This commit is contained in:
psychedelicious 2024-05-20 09:35:47 +10:00
parent c94742bde6
commit f4625c2671
8 changed files with 44 additions and 0 deletions

View File

@ -330,6 +330,7 @@ export const buildCanvasImageToImageGraph = async (
clip_skip: clipSkip,
strength,
init_image: initialImage.image_name,
_canvas_objects: state.canvas.layerState.objects,
},
CANVAS_OUTPUT
);

View File

@ -1,5 +1,6 @@
import { logger } from 'app/logging/logger';
import type { RootState } from 'app/store/store';
import { addCoreMetadataNode } from 'features/nodes/util/graph/canvas/metadata';
import {
CANVAS_INPAINT_GRAPH,
CANVAS_OUTPUT,
@ -421,6 +422,15 @@ export const buildCanvasInpaintGraph = async (
});
}
addCoreMetadataNode(
graph,
{
generation_mode: 'inpaint',
_canvas_objects: state.canvas.layerState.objects,
},
CANVAS_OUTPUT
);
// Add Seamless To Graph
if (seamlessXAxis || seamlessYAxis) {
addSeamlessToLinearGraph(state, graph, modelLoaderNodeId);

View File

@ -1,5 +1,6 @@
import { logger } from 'app/logging/logger';
import type { RootState } from 'app/store/store';
import { addCoreMetadataNode } from 'features/nodes/util/graph/canvas/metadata';
import {
CANVAS_OUTPAINT_GRAPH,
CANVAS_OUTPUT,
@ -579,6 +580,15 @@ export const buildCanvasOutpaintGraph = async (
);
}
addCoreMetadataNode(
graph,
{
generation_mode: 'outpaint',
_canvas_objects: state.canvas.layerState.objects,
},
CANVAS_OUTPUT
);
// Add Seamless To Graph
if (seamlessXAxis || seamlessYAxis) {
addSeamlessToLinearGraph(state, graph, modelLoaderNodeId);

View File

@ -332,6 +332,7 @@ export const buildCanvasSDXLImageToImageGraph = async (
init_image: initialImage.image_name,
positive_style_prompt: positiveStylePrompt,
negative_style_prompt: negativeStylePrompt,
_canvas_objects: state.canvas.layerState.objects,
},
CANVAS_OUTPUT
);

View File

@ -1,5 +1,6 @@
import { logger } from 'app/logging/logger';
import type { RootState } from 'app/store/store';
import { addCoreMetadataNode } from 'features/nodes/util/graph/canvas/metadata';
import {
CANVAS_OUTPUT,
INPAINT_CREATE_MASK,
@ -432,6 +433,15 @@ export const buildCanvasSDXLInpaintGraph = async (
});
}
addCoreMetadataNode(
graph,
{
generation_mode: 'sdxl_inpaint',
_canvas_objects: state.canvas.layerState.objects,
},
CANVAS_OUTPUT
);
// Add Seamless To Graph
if (seamlessXAxis || seamlessYAxis) {
addSeamlessToLinearGraph(state, graph, modelLoaderNodeId);

View File

@ -1,5 +1,6 @@
import { logger } from 'app/logging/logger';
import type { RootState } from 'app/store/store';
import { addCoreMetadataNode } from 'features/nodes/util/graph/canvas/metadata';
import {
CANVAS_OUTPUT,
INPAINT_CREATE_MASK,
@ -588,6 +589,15 @@ export const buildCanvasSDXLOutpaintGraph = async (
);
}
addCoreMetadataNode(
graph,
{
generation_mode: 'sdxl_outpaint',
_canvas_objects: state.canvas.layerState.objects,
},
CANVAS_OUTPUT
);
// Add Seamless To Graph
if (seamlessXAxis || seamlessYAxis) {
addSeamlessToLinearGraph(state, graph, modelLoaderNodeId);

View File

@ -291,6 +291,7 @@ export const buildCanvasSDXLTextToImageGraph = async (state: RootState): Promise
steps,
rand_device: use_cpu ? 'cpu' : 'cuda',
scheduler,
_canvas_objects: state.canvas.layerState.objects,
},
CANVAS_OUTPUT
);

View File

@ -280,6 +280,7 @@ export const buildCanvasTextToImageGraph = async (state: RootState): Promise<Non
rand_device: use_cpu ? 'cpu' : 'cuda',
scheduler,
clip_skip: clipSkip,
_canvas_objects: state.canvas.layerState.objects,
},
CANVAS_OUTPUT
);