mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat: Make SDXL work across the board + Custom VAE Support
Also a major cleanup pass to the SDXL graphs to ensure there's no ID overlap
This commit is contained in:
parent
55d27f71a3
commit
500cd552bc
@ -2,12 +2,12 @@ import { RootState } from 'app/store/store';
|
|||||||
import { MetadataAccumulatorInvocation } from 'services/api/types';
|
import { MetadataAccumulatorInvocation } from 'services/api/types';
|
||||||
import { NonNullableGraph } from '../../types/types';
|
import { NonNullableGraph } from '../../types/types';
|
||||||
import {
|
import {
|
||||||
DENOISE_LATENTS,
|
|
||||||
IMAGE_TO_LATENTS,
|
IMAGE_TO_LATENTS,
|
||||||
LATENTS_TO_IMAGE,
|
LATENTS_TO_IMAGE,
|
||||||
METADATA_ACCUMULATOR,
|
METADATA_ACCUMULATOR,
|
||||||
SDXL_LATENTS_TO_LATENTS,
|
SDXL_DENOISE_LATENTS,
|
||||||
SDXL_MODEL_LOADER,
|
SDXL_MODEL_LOADER,
|
||||||
|
SDXL_REFINER_DENOISE_LATENTS,
|
||||||
SDXL_REFINER_MODEL_LOADER,
|
SDXL_REFINER_MODEL_LOADER,
|
||||||
SDXL_REFINER_NEGATIVE_CONDITIONING,
|
SDXL_REFINER_NEGATIVE_CONDITIONING,
|
||||||
SDXL_REFINER_POSITIVE_CONDITIONING,
|
SDXL_REFINER_POSITIVE_CONDITIONING,
|
||||||
@ -61,7 +61,7 @@ export const addSDXLRefinerToGraph = (
|
|||||||
|
|
||||||
// connect the VAE back to the i2l, which we just removed in the filter
|
// connect the VAE back to the i2l, which we just removed in the filter
|
||||||
// but only if we are doing l2l
|
// but only if we are doing l2l
|
||||||
if (baseNodeId === SDXL_LATENTS_TO_LATENTS) {
|
if (baseNodeId === SDXL_DENOISE_LATENTS) {
|
||||||
graph.edges.push({
|
graph.edges.push({
|
||||||
source: {
|
source: {
|
||||||
node_id: SDXL_MODEL_LOADER,
|
node_id: SDXL_MODEL_LOADER,
|
||||||
@ -91,9 +91,9 @@ export const addSDXLRefinerToGraph = (
|
|||||||
style: `${negativePrompt} ${negativeStylePrompt}`,
|
style: `${negativePrompt} ${negativeStylePrompt}`,
|
||||||
aesthetic_score: refinerAestheticScore,
|
aesthetic_score: refinerAestheticScore,
|
||||||
};
|
};
|
||||||
graph.nodes[DENOISE_LATENTS] = {
|
graph.nodes[SDXL_REFINER_DENOISE_LATENTS] = {
|
||||||
type: 'denoise_latents',
|
type: 'denoise_latents',
|
||||||
id: DENOISE_LATENTS,
|
id: SDXL_REFINER_DENOISE_LATENTS,
|
||||||
cfg_scale: refinerCFGScale,
|
cfg_scale: refinerCFGScale,
|
||||||
steps: refinerSteps / (1 - Math.min(refinerStart, 0.99)),
|
steps: refinerSteps / (1 - Math.min(refinerStart, 0.99)),
|
||||||
scheduler: refinerScheduler,
|
scheduler: refinerScheduler,
|
||||||
@ -108,7 +108,7 @@ export const addSDXLRefinerToGraph = (
|
|||||||
field: 'unet',
|
field: 'unet',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_REFINER_DENOISE_LATENTS,
|
||||||
field: 'unet',
|
field: 'unet',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -148,7 +148,7 @@ export const addSDXLRefinerToGraph = (
|
|||||||
field: 'conditioning',
|
field: 'conditioning',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_REFINER_DENOISE_LATENTS,
|
||||||
field: 'positive_conditioning',
|
field: 'positive_conditioning',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -158,7 +158,7 @@ export const addSDXLRefinerToGraph = (
|
|||||||
field: 'conditioning',
|
field: 'conditioning',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_REFINER_DENOISE_LATENTS,
|
||||||
field: 'negative_conditioning',
|
field: 'negative_conditioning',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -168,13 +168,13 @@ export const addSDXLRefinerToGraph = (
|
|||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_REFINER_DENOISE_LATENTS,
|
||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_REFINER_DENOISE_LATENTS,
|
||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
|
@ -14,6 +14,12 @@ import {
|
|||||||
MAIN_MODEL_LOADER,
|
MAIN_MODEL_LOADER,
|
||||||
METADATA_ACCUMULATOR,
|
METADATA_ACCUMULATOR,
|
||||||
ONNX_MODEL_LOADER,
|
ONNX_MODEL_LOADER,
|
||||||
|
SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH,
|
||||||
|
SDXL_CANVAS_INPAINT_GRAPH,
|
||||||
|
SDXL_CANVAS_OUTPAINT_GRAPH,
|
||||||
|
SDXL_CANVAS_TEXT_TO_IMAGE_GRAPH,
|
||||||
|
SDXL_IMAGE_TO_IMAGE_GRAPH,
|
||||||
|
SDXL_TEXT_TO_IMAGE_GRAPH,
|
||||||
TEXT_TO_IMAGE_GRAPH,
|
TEXT_TO_IMAGE_GRAPH,
|
||||||
VAE_LOADER,
|
VAE_LOADER,
|
||||||
} from './constants';
|
} from './constants';
|
||||||
@ -40,7 +46,12 @@ export const addVAEToGraph = (
|
|||||||
}
|
}
|
||||||
const isOnnxModel = modelLoaderNodeId == ONNX_MODEL_LOADER;
|
const isOnnxModel = modelLoaderNodeId == ONNX_MODEL_LOADER;
|
||||||
|
|
||||||
if (graph.id === TEXT_TO_IMAGE_GRAPH || graph.id === IMAGE_TO_IMAGE_GRAPH) {
|
if (
|
||||||
|
graph.id === TEXT_TO_IMAGE_GRAPH ||
|
||||||
|
graph.id === IMAGE_TO_IMAGE_GRAPH ||
|
||||||
|
graph.id === SDXL_TEXT_TO_IMAGE_GRAPH ||
|
||||||
|
graph.id === SDXL_IMAGE_TO_IMAGE_GRAPH
|
||||||
|
) {
|
||||||
graph.edges.push({
|
graph.edges.push({
|
||||||
source: {
|
source: {
|
||||||
node_id: isAutoVae ? modelLoaderNodeId : VAE_LOADER,
|
node_id: isAutoVae ? modelLoaderNodeId : VAE_LOADER,
|
||||||
@ -55,7 +66,9 @@ export const addVAEToGraph = (
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
graph.id === CANVAS_TEXT_TO_IMAGE_GRAPH ||
|
graph.id === CANVAS_TEXT_TO_IMAGE_GRAPH ||
|
||||||
graph.id === CANVAS_IMAGE_TO_IMAGE_GRAPH
|
graph.id === CANVAS_IMAGE_TO_IMAGE_GRAPH ||
|
||||||
|
graph.id === SDXL_CANVAS_TEXT_TO_IMAGE_GRAPH ||
|
||||||
|
graph.id == SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH
|
||||||
) {
|
) {
|
||||||
graph.edges.push({
|
graph.edges.push({
|
||||||
source: {
|
source: {
|
||||||
@ -71,7 +84,9 @@ export const addVAEToGraph = (
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
graph.id === IMAGE_TO_IMAGE_GRAPH ||
|
graph.id === IMAGE_TO_IMAGE_GRAPH ||
|
||||||
graph.id === CANVAS_IMAGE_TO_IMAGE_GRAPH
|
graph.id === SDXL_IMAGE_TO_IMAGE_GRAPH ||
|
||||||
|
graph.id === CANVAS_IMAGE_TO_IMAGE_GRAPH ||
|
||||||
|
graph.id === SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH
|
||||||
) {
|
) {
|
||||||
graph.edges.push({
|
graph.edges.push({
|
||||||
source: {
|
source: {
|
||||||
@ -85,7 +100,12 @@ export const addVAEToGraph = (
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (graph.id === CANVAS_INPAINT_GRAPH || graph.id == CANVAS_OUTPAINT_GRAPH) {
|
if (
|
||||||
|
graph.id === CANVAS_INPAINT_GRAPH ||
|
||||||
|
graph.id === CANVAS_OUTPAINT_GRAPH ||
|
||||||
|
graph.id === SDXL_CANVAS_INPAINT_GRAPH ||
|
||||||
|
graph.id === SDXL_CANVAS_OUTPAINT_GRAPH
|
||||||
|
) {
|
||||||
graph.edges.push(
|
graph.edges.push(
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
|
@ -15,15 +15,15 @@ import { addSDXLRefinerToGraph } from './addSDXLRefinerToGraph';
|
|||||||
import { addVAEToGraph } from './addVAEToGraph';
|
import { addVAEToGraph } from './addVAEToGraph';
|
||||||
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
||||||
import {
|
import {
|
||||||
CANVAS_IMAGE_TO_IMAGE_GRAPH,
|
|
||||||
CANVAS_OUTPUT,
|
CANVAS_OUTPUT,
|
||||||
DENOISE_LATENTS,
|
|
||||||
IMAGE_TO_LATENTS,
|
IMAGE_TO_LATENTS,
|
||||||
METADATA_ACCUMULATOR,
|
METADATA_ACCUMULATOR,
|
||||||
NEGATIVE_CONDITIONING,
|
NEGATIVE_CONDITIONING,
|
||||||
NOISE,
|
NOISE,
|
||||||
POSITIVE_CONDITIONING,
|
POSITIVE_CONDITIONING,
|
||||||
RESIZE,
|
RESIZE,
|
||||||
|
SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH,
|
||||||
|
SDXL_DENOISE_LATENTS,
|
||||||
SDXL_MODEL_LOADER,
|
SDXL_MODEL_LOADER,
|
||||||
} from './constants';
|
} from './constants';
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ export const buildCanvasSDXLImageToImageGraph = (
|
|||||||
|
|
||||||
// copy-pasted graph from node editor, filled in with state values & friendly node ids
|
// copy-pasted graph from node editor, filled in with state values & friendly node ids
|
||||||
const graph: NonNullableGraph = {
|
const graph: NonNullableGraph = {
|
||||||
id: CANVAS_IMAGE_TO_IMAGE_GRAPH,
|
id: SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH,
|
||||||
nodes: {
|
nodes: {
|
||||||
[SDXL_MODEL_LOADER]: {
|
[SDXL_MODEL_LOADER]: {
|
||||||
type: 'sdxl_model_loader',
|
type: 'sdxl_model_loader',
|
||||||
@ -119,9 +119,9 @@ export const buildCanvasSDXLImageToImageGraph = (
|
|||||||
// image_name: initialImage.image_name,
|
// image_name: initialImage.image_name,
|
||||||
// },
|
// },
|
||||||
},
|
},
|
||||||
[DENOISE_LATENTS]: {
|
[SDXL_DENOISE_LATENTS]: {
|
||||||
type: 'denoise_latents',
|
type: 'denoise_latents',
|
||||||
id: DENOISE_LATENTS,
|
id: SDXL_DENOISE_LATENTS,
|
||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
cfg_scale,
|
cfg_scale,
|
||||||
scheduler,
|
scheduler,
|
||||||
@ -145,7 +145,7 @@ export const buildCanvasSDXLImageToImageGraph = (
|
|||||||
field: 'unet',
|
field: 'unet',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'unet',
|
field: 'unet',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -196,7 +196,7 @@ export const buildCanvasSDXLImageToImageGraph = (
|
|||||||
field: 'conditioning',
|
field: 'conditioning',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'positive_conditioning',
|
field: 'positive_conditioning',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -206,7 +206,7 @@ export const buildCanvasSDXLImageToImageGraph = (
|
|||||||
field: 'conditioning',
|
field: 'conditioning',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'negative_conditioning',
|
field: 'negative_conditioning',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -216,7 +216,7 @@ export const buildCanvasSDXLImageToImageGraph = (
|
|||||||
field: 'noise',
|
field: 'noise',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'noise',
|
field: 'noise',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -226,14 +226,14 @@ export const buildCanvasSDXLImageToImageGraph = (
|
|||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Decode denoised latents to an image
|
// Decode denoised latents to an image
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
@ -241,17 +241,6 @@ export const buildCanvasSDXLImageToImageGraph = (
|
|||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Canvas Output
|
|
||||||
{
|
|
||||||
source: {
|
|
||||||
node_id: CANVAS_OUTPUT,
|
|
||||||
field: 'image',
|
|
||||||
},
|
|
||||||
destination: {
|
|
||||||
node_id: CANVAS_OUTPUT,
|
|
||||||
field: 'image',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -356,11 +345,11 @@ export const buildCanvasSDXLImageToImageGraph = (
|
|||||||
});
|
});
|
||||||
|
|
||||||
// add LoRA support
|
// add LoRA support
|
||||||
addLoRAsToGraph(state, graph, DENOISE_LATENTS);
|
addLoRAsToGraph(state, graph, SDXL_DENOISE_LATENTS);
|
||||||
|
|
||||||
// Add Refiner if enabled
|
// Add Refiner if enabled
|
||||||
if (shouldUseSDXLRefiner) {
|
if (shouldUseSDXLRefiner) {
|
||||||
addSDXLRefinerToGraph(state, graph, DENOISE_LATENTS);
|
addSDXLRefinerToGraph(state, graph, SDXL_DENOISE_LATENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// optionally add custom VAE
|
// optionally add custom VAE
|
||||||
@ -370,7 +359,7 @@ export const buildCanvasSDXLImageToImageGraph = (
|
|||||||
addDynamicPromptsToGraph(state, graph);
|
addDynamicPromptsToGraph(state, graph);
|
||||||
|
|
||||||
// add controlnet, mutating `graph`
|
// add controlnet, mutating `graph`
|
||||||
addControlNetToLinearGraph(state, graph, DENOISE_LATENTS);
|
addControlNetToLinearGraph(state, graph, SDXL_DENOISE_LATENTS);
|
||||||
|
|
||||||
// NSFW & watermark - must be last thing added to graph
|
// NSFW & watermark - must be last thing added to graph
|
||||||
if (state.system.shouldUseNSFWChecker) {
|
if (state.system.shouldUseNSFWChecker) {
|
||||||
|
@ -13,10 +13,8 @@ import { addSDXLRefinerToGraph } from './addSDXLRefinerToGraph';
|
|||||||
import { addVAEToGraph } from './addVAEToGraph';
|
import { addVAEToGraph } from './addVAEToGraph';
|
||||||
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
||||||
import {
|
import {
|
||||||
CANVAS_INPAINT_GRAPH,
|
|
||||||
CANVAS_OUTPUT,
|
CANVAS_OUTPUT,
|
||||||
COLOR_CORRECT,
|
COLOR_CORRECT,
|
||||||
INPAINT,
|
|
||||||
INPAINT_IMAGE,
|
INPAINT_IMAGE,
|
||||||
ITERATE,
|
ITERATE,
|
||||||
LATENTS_TO_IMAGE,
|
LATENTS_TO_IMAGE,
|
||||||
@ -26,6 +24,8 @@ import {
|
|||||||
POSITIVE_CONDITIONING,
|
POSITIVE_CONDITIONING,
|
||||||
RANDOM_INT,
|
RANDOM_INT,
|
||||||
RANGE_OF_SIZE,
|
RANGE_OF_SIZE,
|
||||||
|
SDXL_CANVAS_INPAINT_GRAPH,
|
||||||
|
SDXL_DENOISE_LATENTS,
|
||||||
SDXL_MODEL_LOADER,
|
SDXL_MODEL_LOADER,
|
||||||
} from './constants';
|
} from './constants';
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ export const buildCanvasSDXLInpaintGraph = (
|
|||||||
: shouldUseCpuNoise;
|
: shouldUseCpuNoise;
|
||||||
|
|
||||||
const graph: NonNullableGraph = {
|
const graph: NonNullableGraph = {
|
||||||
id: CANVAS_INPAINT_GRAPH,
|
id: SDXL_CANVAS_INPAINT_GRAPH,
|
||||||
nodes: {
|
nodes: {
|
||||||
[SDXL_MODEL_LOADER]: {
|
[SDXL_MODEL_LOADER]: {
|
||||||
type: 'sdxl_model_loader',
|
type: 'sdxl_model_loader',
|
||||||
@ -131,9 +131,9 @@ export const buildCanvasSDXLInpaintGraph = (
|
|||||||
use_cpu,
|
use_cpu,
|
||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
},
|
},
|
||||||
[INPAINT]: {
|
[SDXL_DENOISE_LATENTS]: {
|
||||||
type: 'denoise_latents',
|
type: 'denoise_latents',
|
||||||
id: INPAINT,
|
id: SDXL_DENOISE_LATENTS,
|
||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
steps: steps,
|
steps: steps,
|
||||||
cfg_scale: cfg_scale,
|
cfg_scale: cfg_scale,
|
||||||
@ -182,7 +182,7 @@ export const buildCanvasSDXLInpaintGraph = (
|
|||||||
field: 'unet',
|
field: 'unet',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'unet',
|
field: 'unet',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -233,7 +233,7 @@ export const buildCanvasSDXLInpaintGraph = (
|
|||||||
field: 'conditioning',
|
field: 'conditioning',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'positive_conditioning',
|
field: 'positive_conditioning',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -243,7 +243,7 @@ export const buildCanvasSDXLInpaintGraph = (
|
|||||||
field: 'conditioning',
|
field: 'conditioning',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'negative_conditioning',
|
field: 'negative_conditioning',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -253,7 +253,7 @@ export const buildCanvasSDXLInpaintGraph = (
|
|||||||
field: 'noise',
|
field: 'noise',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'noise',
|
field: 'noise',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -263,7 +263,7 @@ export const buildCanvasSDXLInpaintGraph = (
|
|||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -273,7 +273,7 @@ export const buildCanvasSDXLInpaintGraph = (
|
|||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'mask',
|
field: 'mask',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -301,7 +301,7 @@ export const buildCanvasSDXLInpaintGraph = (
|
|||||||
// Decode inpainted latents to image
|
// Decode inpainted latents to image
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
node_id: INPAINT,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
@ -356,10 +356,10 @@ export const buildCanvasSDXLInpaintGraph = (
|
|||||||
|
|
||||||
// Add Refiner if enabled
|
// Add Refiner if enabled
|
||||||
if (shouldUseSDXLRefiner) {
|
if (shouldUseSDXLRefiner) {
|
||||||
addSDXLRefinerToGraph(state, graph, INPAINT);
|
addSDXLRefinerToGraph(state, graph, SDXL_DENOISE_LATENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add VAE
|
// optionally add custom VAE
|
||||||
addVAEToGraph(state, graph, SDXL_MODEL_LOADER);
|
addVAEToGraph(state, graph, SDXL_MODEL_LOADER);
|
||||||
|
|
||||||
// handle seed
|
// handle seed
|
||||||
@ -383,10 +383,10 @@ export const buildCanvasSDXLInpaintGraph = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add LoRA support
|
// add LoRA support
|
||||||
addSDXLLoRAsToGraph(state, graph, INPAINT, SDXL_MODEL_LOADER);
|
addSDXLLoRAsToGraph(state, graph, SDXL_DENOISE_LATENTS, SDXL_MODEL_LOADER);
|
||||||
|
|
||||||
// add controlnet, mutating `graph`
|
// add controlnet, mutating `graph`
|
||||||
addControlNetToLinearGraph(state, graph, INPAINT);
|
addControlNetToLinearGraph(state, graph, SDXL_DENOISE_LATENTS);
|
||||||
|
|
||||||
// NSFW & watermark - must be last thing added to graph
|
// NSFW & watermark - must be last thing added to graph
|
||||||
if (state.system.shouldUseNSFWChecker) {
|
if (state.system.shouldUseNSFWChecker) {
|
||||||
|
@ -15,10 +15,8 @@ import { addSDXLRefinerToGraph } from './addSDXLRefinerToGraph';
|
|||||||
import { addVAEToGraph } from './addVAEToGraph';
|
import { addVAEToGraph } from './addVAEToGraph';
|
||||||
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
||||||
import {
|
import {
|
||||||
CANVAS_OUTPAINT_GRAPH,
|
|
||||||
CANVAS_OUTPUT,
|
CANVAS_OUTPUT,
|
||||||
COLOR_CORRECT,
|
COLOR_CORRECT,
|
||||||
INPAINT,
|
|
||||||
INPAINT_IMAGE,
|
INPAINT_IMAGE,
|
||||||
INPAINT_INFILL,
|
INPAINT_INFILL,
|
||||||
ITERATE,
|
ITERATE,
|
||||||
@ -31,6 +29,8 @@ import {
|
|||||||
POSITIVE_CONDITIONING,
|
POSITIVE_CONDITIONING,
|
||||||
RANDOM_INT,
|
RANDOM_INT,
|
||||||
RANGE_OF_SIZE,
|
RANGE_OF_SIZE,
|
||||||
|
SDXL_CANVAS_OUTPAINT_GRAPH,
|
||||||
|
SDXL_DENOISE_LATENTS,
|
||||||
SDXL_MODEL_LOADER,
|
SDXL_MODEL_LOADER,
|
||||||
} from './constants';
|
} from './constants';
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
const graph: NonNullableGraph = {
|
const graph: NonNullableGraph = {
|
||||||
id: CANVAS_OUTPAINT_GRAPH,
|
id: SDXL_CANVAS_OUTPAINT_GRAPH,
|
||||||
nodes: {
|
nodes: {
|
||||||
[SDXL_MODEL_LOADER]: {
|
[SDXL_MODEL_LOADER]: {
|
||||||
type: 'sdxl_model_loader',
|
type: 'sdxl_model_loader',
|
||||||
@ -166,9 +166,9 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
use_cpu,
|
use_cpu,
|
||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
},
|
},
|
||||||
[INPAINT]: {
|
[SDXL_DENOISE_LATENTS]: {
|
||||||
type: 'denoise_latents',
|
type: 'denoise_latents',
|
||||||
id: INPAINT,
|
id: SDXL_DENOISE_LATENTS,
|
||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
steps: steps,
|
steps: steps,
|
||||||
cfg_scale: cfg_scale,
|
cfg_scale: cfg_scale,
|
||||||
@ -215,7 +215,7 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
field: 'unet',
|
field: 'unet',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'unet',
|
field: 'unet',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -298,7 +298,7 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
field: 'conditioning',
|
field: 'conditioning',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'positive_conditioning',
|
field: 'positive_conditioning',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -308,7 +308,7 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
field: 'conditioning',
|
field: 'conditioning',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'negative_conditioning',
|
field: 'negative_conditioning',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -318,7 +318,7 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
field: 'noise',
|
field: 'noise',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'noise',
|
field: 'noise',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -328,7 +328,7 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -338,7 +338,7 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
field: 'image',
|
field: 'image',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: INPAINT,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'mask',
|
field: 'mask',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -366,7 +366,7 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
// Decode inpainted latents to image
|
// Decode inpainted latents to image
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
node_id: INPAINT,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
@ -441,10 +441,10 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
|
|
||||||
// Add Refiner if enabled
|
// Add Refiner if enabled
|
||||||
if (shouldUseSDXLRefiner) {
|
if (shouldUseSDXLRefiner) {
|
||||||
addSDXLRefinerToGraph(state, graph, INPAINT);
|
addSDXLRefinerToGraph(state, graph, SDXL_DENOISE_LATENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add VAE
|
// optionally add custom VAE
|
||||||
addVAEToGraph(state, graph, SDXL_MODEL_LOADER);
|
addVAEToGraph(state, graph, SDXL_MODEL_LOADER);
|
||||||
|
|
||||||
// handle seed
|
// handle seed
|
||||||
@ -468,10 +468,10 @@ export const buildCanvasSDXLOutpaintGraph = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add LoRA support
|
// add LoRA support
|
||||||
addSDXLLoRAsToGraph(state, graph, INPAINT, SDXL_MODEL_LOADER);
|
addSDXLLoRAsToGraph(state, graph, SDXL_DENOISE_LATENTS, SDXL_MODEL_LOADER);
|
||||||
|
|
||||||
// add controlnet, mutating `graph`
|
// add controlnet, mutating `graph`
|
||||||
addControlNetToLinearGraph(state, graph, INPAINT);
|
addControlNetToLinearGraph(state, graph, SDXL_DENOISE_LATENTS);
|
||||||
|
|
||||||
// NSFW & watermark - must be last thing added to graph
|
// NSFW & watermark - must be last thing added to graph
|
||||||
if (state.system.shouldUseNSFWChecker) {
|
if (state.system.shouldUseNSFWChecker) {
|
||||||
|
@ -15,13 +15,13 @@ import { addVAEToGraph } from './addVAEToGraph';
|
|||||||
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
||||||
import {
|
import {
|
||||||
CANVAS_OUTPUT,
|
CANVAS_OUTPUT,
|
||||||
CANVAS_TEXT_TO_IMAGE_GRAPH,
|
|
||||||
DENOISE_LATENTS,
|
|
||||||
METADATA_ACCUMULATOR,
|
METADATA_ACCUMULATOR,
|
||||||
NEGATIVE_CONDITIONING,
|
NEGATIVE_CONDITIONING,
|
||||||
NOISE,
|
NOISE,
|
||||||
ONNX_MODEL_LOADER,
|
ONNX_MODEL_LOADER,
|
||||||
POSITIVE_CONDITIONING,
|
POSITIVE_CONDITIONING,
|
||||||
|
SDXL_CANVAS_TEXT_TO_IMAGE_GRAPH,
|
||||||
|
SDXL_DENOISE_LATENTS,
|
||||||
SDXL_MODEL_LOADER,
|
SDXL_MODEL_LOADER,
|
||||||
} from './constants';
|
} from './constants';
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ export const buildCanvasSDXLTextToImageGraph = (
|
|||||||
isUsingOnnxModel
|
isUsingOnnxModel
|
||||||
? {
|
? {
|
||||||
type: 't2l_onnx',
|
type: 't2l_onnx',
|
||||||
id: DENOISE_LATENTS,
|
id: SDXL_DENOISE_LATENTS,
|
||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
cfg_scale,
|
cfg_scale,
|
||||||
scheduler,
|
scheduler,
|
||||||
@ -88,7 +88,7 @@ export const buildCanvasSDXLTextToImageGraph = (
|
|||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
type: 'denoise_latents',
|
type: 'denoise_latents',
|
||||||
id: DENOISE_LATENTS,
|
id: SDXL_DENOISE_LATENTS,
|
||||||
is_intermediate: true,
|
is_intermediate: true,
|
||||||
cfg_scale,
|
cfg_scale,
|
||||||
scheduler,
|
scheduler,
|
||||||
@ -108,7 +108,7 @@ export const buildCanvasSDXLTextToImageGraph = (
|
|||||||
// copy-pasted graph from node editor, filled in with state values & friendly node ids
|
// copy-pasted graph from node editor, filled in with state values & friendly node ids
|
||||||
// TODO: Actually create the graph correctly for ONNX
|
// TODO: Actually create the graph correctly for ONNX
|
||||||
const graph: NonNullableGraph = {
|
const graph: NonNullableGraph = {
|
||||||
id: CANVAS_TEXT_TO_IMAGE_GRAPH,
|
id: SDXL_CANVAS_TEXT_TO_IMAGE_GRAPH,
|
||||||
nodes: {
|
nodes: {
|
||||||
[modelLoaderNodeId]: {
|
[modelLoaderNodeId]: {
|
||||||
type: modelLoaderNodeType,
|
type: modelLoaderNodeType,
|
||||||
@ -157,7 +157,7 @@ export const buildCanvasSDXLTextToImageGraph = (
|
|||||||
field: 'unet',
|
field: 'unet',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'unet',
|
field: 'unet',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -208,7 +208,7 @@ export const buildCanvasSDXLTextToImageGraph = (
|
|||||||
field: 'conditioning',
|
field: 'conditioning',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'positive_conditioning',
|
field: 'positive_conditioning',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -218,7 +218,7 @@ export const buildCanvasSDXLTextToImageGraph = (
|
|||||||
field: 'conditioning',
|
field: 'conditioning',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'negative_conditioning',
|
field: 'negative_conditioning',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -228,14 +228,14 @@ export const buildCanvasSDXLTextToImageGraph = (
|
|||||||
field: 'noise',
|
field: 'noise',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'noise',
|
field: 'noise',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Decode Denoised Latents To Image
|
// Decode Denoised Latents To Image
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
@ -280,11 +280,11 @@ export const buildCanvasSDXLTextToImageGraph = (
|
|||||||
|
|
||||||
// Add Refiner if enabled
|
// Add Refiner if enabled
|
||||||
if (shouldUseSDXLRefiner) {
|
if (shouldUseSDXLRefiner) {
|
||||||
addSDXLRefinerToGraph(state, graph, DENOISE_LATENTS);
|
addSDXLRefinerToGraph(state, graph, SDXL_DENOISE_LATENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add LoRA support
|
// add LoRA support
|
||||||
addSDXLLoRAsToGraph(state, graph, DENOISE_LATENTS, modelLoaderNodeId);
|
addSDXLLoRAsToGraph(state, graph, SDXL_DENOISE_LATENTS, modelLoaderNodeId);
|
||||||
|
|
||||||
// optionally add custom VAE
|
// optionally add custom VAE
|
||||||
addVAEToGraph(state, graph, modelLoaderNodeId);
|
addVAEToGraph(state, graph, modelLoaderNodeId);
|
||||||
@ -293,7 +293,7 @@ export const buildCanvasSDXLTextToImageGraph = (
|
|||||||
addDynamicPromptsToGraph(state, graph);
|
addDynamicPromptsToGraph(state, graph);
|
||||||
|
|
||||||
// add controlnet, mutating `graph`
|
// add controlnet, mutating `graph`
|
||||||
addControlNetToLinearGraph(state, graph, DENOISE_LATENTS);
|
addControlNetToLinearGraph(state, graph, SDXL_DENOISE_LATENTS);
|
||||||
|
|
||||||
// NSFW & watermark - must be last thing added to graph
|
// NSFW & watermark - must be last thing added to graph
|
||||||
if (state.system.shouldUseNSFWChecker) {
|
if (state.system.shouldUseNSFWChecker) {
|
||||||
|
@ -10,9 +10,9 @@ import { addDynamicPromptsToGraph } from './addDynamicPromptsToGraph';
|
|||||||
import { addNSFWCheckerToGraph } from './addNSFWCheckerToGraph';
|
import { addNSFWCheckerToGraph } from './addNSFWCheckerToGraph';
|
||||||
import { addSDXLLoRAsToGraph } from './addSDXLLoRAstoGraph';
|
import { addSDXLLoRAsToGraph } from './addSDXLLoRAstoGraph';
|
||||||
import { addSDXLRefinerToGraph } from './addSDXLRefinerToGraph';
|
import { addSDXLRefinerToGraph } from './addSDXLRefinerToGraph';
|
||||||
|
import { addVAEToGraph } from './addVAEToGraph';
|
||||||
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
||||||
import {
|
import {
|
||||||
DENOISE_LATENTS,
|
|
||||||
IMAGE_TO_LATENTS,
|
IMAGE_TO_LATENTS,
|
||||||
LATENTS_TO_IMAGE,
|
LATENTS_TO_IMAGE,
|
||||||
METADATA_ACCUMULATOR,
|
METADATA_ACCUMULATOR,
|
||||||
@ -20,6 +20,7 @@ import {
|
|||||||
NOISE,
|
NOISE,
|
||||||
POSITIVE_CONDITIONING,
|
POSITIVE_CONDITIONING,
|
||||||
RESIZE,
|
RESIZE,
|
||||||
|
SDXL_DENOISE_LATENTS,
|
||||||
SDXL_IMAGE_TO_IMAGE_GRAPH,
|
SDXL_IMAGE_TO_IMAGE_GRAPH,
|
||||||
SDXL_MODEL_LOADER,
|
SDXL_MODEL_LOADER,
|
||||||
} from './constants';
|
} from './constants';
|
||||||
@ -115,9 +116,9 @@ export const buildLinearSDXLImageToImageGraph = (
|
|||||||
id: LATENTS_TO_IMAGE,
|
id: LATENTS_TO_IMAGE,
|
||||||
fp32: vaePrecision === 'fp32' ? true : false,
|
fp32: vaePrecision === 'fp32' ? true : false,
|
||||||
},
|
},
|
||||||
[DENOISE_LATENTS]: {
|
[SDXL_DENOISE_LATENTS]: {
|
||||||
type: 'denoise_latents',
|
type: 'denoise_latents',
|
||||||
id: DENOISE_LATENTS,
|
id: SDXL_DENOISE_LATENTS,
|
||||||
cfg_scale,
|
cfg_scale,
|
||||||
scheduler,
|
scheduler,
|
||||||
steps,
|
steps,
|
||||||
@ -144,30 +145,10 @@ export const buildLinearSDXLImageToImageGraph = (
|
|||||||
field: 'unet',
|
field: 'unet',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'unet',
|
field: 'unet',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
source: {
|
|
||||||
node_id: SDXL_MODEL_LOADER,
|
|
||||||
field: 'vae',
|
|
||||||
},
|
|
||||||
destination: {
|
|
||||||
node_id: LATENTS_TO_IMAGE,
|
|
||||||
field: 'vae',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: {
|
|
||||||
node_id: SDXL_MODEL_LOADER,
|
|
||||||
field: 'vae',
|
|
||||||
},
|
|
||||||
destination: {
|
|
||||||
node_id: IMAGE_TO_LATENTS,
|
|
||||||
field: 'vae',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
node_id: SDXL_MODEL_LOADER,
|
node_id: SDXL_MODEL_LOADER,
|
||||||
@ -215,7 +196,7 @@ export const buildLinearSDXLImageToImageGraph = (
|
|||||||
field: 'conditioning',
|
field: 'conditioning',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'positive_conditioning',
|
field: 'positive_conditioning',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -225,7 +206,7 @@ export const buildLinearSDXLImageToImageGraph = (
|
|||||||
field: 'conditioning',
|
field: 'conditioning',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'negative_conditioning',
|
field: 'negative_conditioning',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -235,7 +216,7 @@ export const buildLinearSDXLImageToImageGraph = (
|
|||||||
field: 'noise',
|
field: 'noise',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'noise',
|
field: 'noise',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -245,14 +226,14 @@ export const buildLinearSDXLImageToImageGraph = (
|
|||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Decode Denoised Latents To Image
|
// Decode Denoised Latents To Image
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
@ -368,13 +349,16 @@ export const buildLinearSDXLImageToImageGraph = (
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
addSDXLLoRAsToGraph(state, graph, DENOISE_LATENTS, SDXL_MODEL_LOADER);
|
addSDXLLoRAsToGraph(state, graph, SDXL_DENOISE_LATENTS, SDXL_MODEL_LOADER);
|
||||||
|
|
||||||
// Add Refiner if enabled
|
// Add Refiner if enabled
|
||||||
if (shouldUseSDXLRefiner) {
|
if (shouldUseSDXLRefiner) {
|
||||||
addSDXLRefinerToGraph(state, graph, DENOISE_LATENTS);
|
addSDXLRefinerToGraph(state, graph, SDXL_DENOISE_LATENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// optionally add custom VAE
|
||||||
|
addVAEToGraph(state, graph, SDXL_MODEL_LOADER);
|
||||||
|
|
||||||
// add dynamic prompts - also sets up core iteration and seed
|
// add dynamic prompts - also sets up core iteration and seed
|
||||||
addDynamicPromptsToGraph(state, graph);
|
addDynamicPromptsToGraph(state, graph);
|
||||||
|
|
||||||
|
@ -6,14 +6,15 @@ import { addDynamicPromptsToGraph } from './addDynamicPromptsToGraph';
|
|||||||
import { addNSFWCheckerToGraph } from './addNSFWCheckerToGraph';
|
import { addNSFWCheckerToGraph } from './addNSFWCheckerToGraph';
|
||||||
import { addSDXLLoRAsToGraph } from './addSDXLLoRAstoGraph';
|
import { addSDXLLoRAsToGraph } from './addSDXLLoRAstoGraph';
|
||||||
import { addSDXLRefinerToGraph } from './addSDXLRefinerToGraph';
|
import { addSDXLRefinerToGraph } from './addSDXLRefinerToGraph';
|
||||||
|
import { addVAEToGraph } from './addVAEToGraph';
|
||||||
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
import { addWatermarkerToGraph } from './addWatermarkerToGraph';
|
||||||
import {
|
import {
|
||||||
DENOISE_LATENTS,
|
|
||||||
LATENTS_TO_IMAGE,
|
LATENTS_TO_IMAGE,
|
||||||
METADATA_ACCUMULATOR,
|
METADATA_ACCUMULATOR,
|
||||||
NEGATIVE_CONDITIONING,
|
NEGATIVE_CONDITIONING,
|
||||||
NOISE,
|
NOISE,
|
||||||
POSITIVE_CONDITIONING,
|
POSITIVE_CONDITIONING,
|
||||||
|
SDXL_DENOISE_LATENTS,
|
||||||
SDXL_MODEL_LOADER,
|
SDXL_MODEL_LOADER,
|
||||||
SDXL_TEXT_TO_IMAGE_GRAPH,
|
SDXL_TEXT_TO_IMAGE_GRAPH,
|
||||||
} from './constants';
|
} from './constants';
|
||||||
@ -95,9 +96,9 @@ export const buildLinearSDXLTextToImageGraph = (
|
|||||||
height,
|
height,
|
||||||
use_cpu,
|
use_cpu,
|
||||||
},
|
},
|
||||||
[DENOISE_LATENTS]: {
|
[SDXL_DENOISE_LATENTS]: {
|
||||||
type: 'denoise_latents',
|
type: 'denoise_latents',
|
||||||
id: DENOISE_LATENTS,
|
id: SDXL_DENOISE_LATENTS,
|
||||||
cfg_scale,
|
cfg_scale,
|
||||||
scheduler,
|
scheduler,
|
||||||
steps,
|
steps,
|
||||||
@ -118,20 +119,10 @@ export const buildLinearSDXLTextToImageGraph = (
|
|||||||
field: 'unet',
|
field: 'unet',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'unet',
|
field: 'unet',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
source: {
|
|
||||||
node_id: SDXL_MODEL_LOADER,
|
|
||||||
field: 'vae',
|
|
||||||
},
|
|
||||||
destination: {
|
|
||||||
node_id: LATENTS_TO_IMAGE,
|
|
||||||
field: 'vae',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
node_id: SDXL_MODEL_LOADER,
|
node_id: SDXL_MODEL_LOADER,
|
||||||
@ -179,7 +170,7 @@ export const buildLinearSDXLTextToImageGraph = (
|
|||||||
field: 'conditioning',
|
field: 'conditioning',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'positive_conditioning',
|
field: 'positive_conditioning',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -189,7 +180,7 @@ export const buildLinearSDXLTextToImageGraph = (
|
|||||||
field: 'conditioning',
|
field: 'conditioning',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'negative_conditioning',
|
field: 'negative_conditioning',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -199,14 +190,14 @@ export const buildLinearSDXLTextToImageGraph = (
|
|||||||
field: 'noise',
|
field: 'noise',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'noise',
|
field: 'noise',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Decode Denoised Latents To Image
|
// Decode Denoised Latents To Image
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
node_id: DENOISE_LATENTS,
|
node_id: SDXL_DENOISE_LATENTS,
|
||||||
field: 'latents',
|
field: 'latents',
|
||||||
},
|
},
|
||||||
destination: {
|
destination: {
|
||||||
@ -251,13 +242,17 @@ export const buildLinearSDXLTextToImageGraph = (
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
addSDXLLoRAsToGraph(state, graph, DENOISE_LATENTS, SDXL_MODEL_LOADER);
|
|
||||||
|
|
||||||
// Add Refiner if enabled
|
// Add Refiner if enabled
|
||||||
if (shouldUseSDXLRefiner) {
|
if (shouldUseSDXLRefiner) {
|
||||||
addSDXLRefinerToGraph(state, graph, DENOISE_LATENTS);
|
addSDXLRefinerToGraph(state, graph, SDXL_DENOISE_LATENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// optionally add custom VAE
|
||||||
|
addVAEToGraph(state, graph, SDXL_MODEL_LOADER);
|
||||||
|
|
||||||
|
// add LoRA support
|
||||||
|
addSDXLLoRAsToGraph(state, graph, SDXL_DENOISE_LATENTS, SDXL_MODEL_LOADER);
|
||||||
|
|
||||||
// add dynamic prompts - also sets up core iteration and seed
|
// add dynamic prompts - also sets up core iteration and seed
|
||||||
addDynamicPromptsToGraph(state, graph);
|
addDynamicPromptsToGraph(state, graph);
|
||||||
|
|
||||||
|
@ -38,14 +38,13 @@ export const REALESRGAN = 'esrgan';
|
|||||||
export const DIVIDE = 'divide';
|
export const DIVIDE = 'divide';
|
||||||
export const SCALE = 'scale_image';
|
export const SCALE = 'scale_image';
|
||||||
export const SDXL_MODEL_LOADER = 'sdxl_model_loader';
|
export const SDXL_MODEL_LOADER = 'sdxl_model_loader';
|
||||||
export const SDXL_TEXT_TO_LATENTS = 't2l_sdxl';
|
export const SDXL_DENOISE_LATENTS = 'sdxl_denoise_latents';
|
||||||
export const SDXL_LATENTS_TO_LATENTS = 'l2l_sdxl';
|
|
||||||
export const SDXL_REFINER_MODEL_LOADER = 'sdxl_refiner_model_loader';
|
export const SDXL_REFINER_MODEL_LOADER = 'sdxl_refiner_model_loader';
|
||||||
export const SDXL_REFINER_POSITIVE_CONDITIONING =
|
export const SDXL_REFINER_POSITIVE_CONDITIONING =
|
||||||
'sdxl_refiner_positive_conditioning';
|
'sdxl_refiner_positive_conditioning';
|
||||||
export const SDXL_REFINER_NEGATIVE_CONDITIONING =
|
export const SDXL_REFINER_NEGATIVE_CONDITIONING =
|
||||||
'sdxl_refiner_negative_conditioning';
|
'sdxl_refiner_negative_conditioning';
|
||||||
export const SDXL_REFINER_LATENTS_TO_LATENTS = 'l2l_sdxl_refiner';
|
export const SDXL_REFINER_DENOISE_LATENTS = 'sdxl_refiner_denoise_latents';
|
||||||
|
|
||||||
// friendly graph ids
|
// friendly graph ids
|
||||||
export const TEXT_TO_IMAGE_GRAPH = 'text_to_image_graph';
|
export const TEXT_TO_IMAGE_GRAPH = 'text_to_image_graph';
|
||||||
@ -56,3 +55,9 @@ export const CANVAS_INPAINT_GRAPH = 'canvas_inpaint_graph';
|
|||||||
export const CANVAS_OUTPAINT_GRAPH = 'canvas_outpaint_graph';
|
export const CANVAS_OUTPAINT_GRAPH = 'canvas_outpaint_graph';
|
||||||
export const SDXL_TEXT_TO_IMAGE_GRAPH = 'sdxl_text_to_image_graph';
|
export const SDXL_TEXT_TO_IMAGE_GRAPH = 'sdxl_text_to_image_graph';
|
||||||
export const SDXL_IMAGE_TO_IMAGE_GRAPH = 'sxdl_image_to_image_graph';
|
export const SDXL_IMAGE_TO_IMAGE_GRAPH = 'sxdl_image_to_image_graph';
|
||||||
|
export const SDXL_CANVAS_TEXT_TO_IMAGE_GRAPH =
|
||||||
|
'sdxl_canvas_text_to_image_graph';
|
||||||
|
export const SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH =
|
||||||
|
'sdxl_canvas_image_to_image_graph';
|
||||||
|
export const SDXL_CANVAS_INPAINT_GRAPH = 'sdxl_canvas_inpaint_graph';
|
||||||
|
export const SDXL_CANVAS_OUTPAINT_GRAPH = 'sdxl_canvas_outpaint_graph';
|
||||||
|
Loading…
Reference in New Issue
Block a user