diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasImageToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasImageToImageGraph.ts index d3334d31c3..51fe0ab733 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasImageToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasImageToImageGraph.ts @@ -7,6 +7,7 @@ import { addControlNetToLinearGraph } from './addControlNetToLinearGraph'; import { addDynamicPromptsToGraph } from './addDynamicPromptsToGraph'; import { addLoRAsToGraph } from './addLoRAsToGraph'; import { addNSFWCheckerToGraph } from './addNSFWCheckerToGraph'; +import { addSeamlessToLinearGraph } from './addSeamlessToLinearGraph'; import { addVAEToGraph } from './addVAEToGraph'; import { addWatermarkerToGraph } from './addWatermarkerToGraph'; import { @@ -22,6 +23,7 @@ import { NEGATIVE_CONDITIONING, NOISE, POSITIVE_CONDITIONING, + SEAMLESS, } from './constants'; /** @@ -44,6 +46,8 @@ export const buildCanvasImageToImageGraph = ( clipSkip, shouldUseCpuNoise, shouldUseNoiseSettings, + seamlessXAxis, + seamlessYAxis, } = state.generation; // The bounding box determines width and height, not the width and height params @@ -64,6 +68,8 @@ export const buildCanvasImageToImageGraph = ( throw new Error('No model found in state'); } + let modelLoaderNodeId = MAIN_MODEL_LOADER; + const use_cpu = shouldUseNoiseSettings ? shouldUseCpuNoise : initialGenerationState.shouldUseCpuNoise; @@ -340,11 +346,17 @@ export const buildCanvasImageToImageGraph = ( }, }); + // Add Seamless To Graph + if (seamlessXAxis || seamlessYAxis) { + addSeamlessToLinearGraph(state, graph, modelLoaderNodeId); + modelLoaderNodeId = SEAMLESS; + } + // add LoRA support addLoRAsToGraph(state, graph, DENOISE_LATENTS); // optionally add custom VAE - addVAEToGraph(state, graph, MAIN_MODEL_LOADER); + addVAEToGraph(state, graph, modelLoaderNodeId); // add dynamic prompts - also sets up core iteration and seed addDynamicPromptsToGraph(state, graph); diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasSDXLImageToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasSDXLImageToImageGraph.ts index ea46e8a956..ba1fe46675 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasSDXLImageToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasSDXLImageToImageGraph.ts @@ -8,6 +8,7 @@ import { addDynamicPromptsToGraph } from './addDynamicPromptsToGraph'; import { addNSFWCheckerToGraph } from './addNSFWCheckerToGraph'; import { addSDXLLoRAsToGraph } from './addSDXLLoRAstoGraph'; import { addSDXLRefinerToGraph } from './addSDXLRefinerToGraph'; +import { addSeamlessToLinearGraph } from './addSeamlessToLinearGraph'; import { addVAEToGraph } from './addVAEToGraph'; import { addWatermarkerToGraph } from './addWatermarkerToGraph'; import { @@ -19,9 +20,11 @@ import { NEGATIVE_CONDITIONING, NOISE, POSITIVE_CONDITIONING, + REFINER_SEAMLESS, SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH, SDXL_DENOISE_LATENTS, SDXL_MODEL_LOADER, + SEAMLESS, } from './constants'; import { craftSDXLStylePrompt } from './helpers/craftSDXLStylePrompt'; @@ -44,6 +47,8 @@ export const buildCanvasSDXLImageToImageGraph = ( clipSkip, shouldUseCpuNoise, shouldUseNoiseSettings, + seamlessXAxis, + seamlessYAxis, } = state.generation; const { @@ -71,6 +76,9 @@ export const buildCanvasSDXLImageToImageGraph = ( throw new Error('No model found in state'); } + // Model Loader ID + let modelLoaderNodeId = SDXL_MODEL_LOADER; + const use_cpu = shouldUseNoiseSettings ? shouldUseCpuNoise : initialGenerationState.shouldUseCpuNoise; @@ -351,16 +359,23 @@ export const buildCanvasSDXLImageToImageGraph = ( }, }); - // add LoRA support - addSDXLLoRAsToGraph(state, graph, SDXL_DENOISE_LATENTS, SDXL_MODEL_LOADER); + // Add Seamless To Graph + if (seamlessXAxis || seamlessYAxis) { + addSeamlessToLinearGraph(state, graph, modelLoaderNodeId); + modelLoaderNodeId = SEAMLESS; + } // Add Refiner if enabled if (shouldUseSDXLRefiner) { addSDXLRefinerToGraph(state, graph, SDXL_DENOISE_LATENTS); + modelLoaderNodeId = REFINER_SEAMLESS; } // optionally add custom VAE - addVAEToGraph(state, graph, SDXL_MODEL_LOADER); + addVAEToGraph(state, graph, modelLoaderNodeId); + + // add LoRA support + addSDXLLoRAsToGraph(state, graph, SDXL_DENOISE_LATENTS, modelLoaderNodeId); // add dynamic prompts - also sets up core iteration and seed addDynamicPromptsToGraph(state, graph); diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasSDXLTextToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasSDXLTextToImageGraph.ts index bdfc60fe00..afefa53645 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasSDXLTextToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasSDXLTextToImageGraph.ts @@ -11,6 +11,7 @@ import { addDynamicPromptsToGraph } from './addDynamicPromptsToGraph'; import { addNSFWCheckerToGraph } from './addNSFWCheckerToGraph'; import { addSDXLLoRAsToGraph } from './addSDXLLoRAstoGraph'; import { addSDXLRefinerToGraph } from './addSDXLRefinerToGraph'; +import { addSeamlessToLinearGraph } from './addSeamlessToLinearGraph'; import { addVAEToGraph } from './addVAEToGraph'; import { addWatermarkerToGraph } from './addWatermarkerToGraph'; import { @@ -21,9 +22,11 @@ import { NOISE, ONNX_MODEL_LOADER, POSITIVE_CONDITIONING, + REFINER_SEAMLESS, SDXL_CANVAS_TEXT_TO_IMAGE_GRAPH, SDXL_DENOISE_LATENTS, SDXL_MODEL_LOADER, + SEAMLESS, } from './constants'; import { craftSDXLStylePrompt } from './helpers/craftSDXLStylePrompt'; @@ -45,6 +48,8 @@ export const buildCanvasSDXLTextToImageGraph = ( clipSkip, shouldUseCpuNoise, shouldUseNoiseSettings, + seamlessXAxis, + seamlessYAxis, } = state.generation; // The bounding box determines width and height, not the width and height params @@ -74,7 +79,7 @@ export const buildCanvasSDXLTextToImageGraph = ( const isUsingOnnxModel = model.model_type === 'onnx'; - const modelLoaderNodeId = isUsingOnnxModel + let modelLoaderNodeId = isUsingOnnxModel ? ONNX_MODEL_LOADER : SDXL_MODEL_LOADER; @@ -334,9 +339,16 @@ export const buildCanvasSDXLTextToImageGraph = ( }, }); + // Add Seamless To Graph + if (seamlessXAxis || seamlessYAxis) { + addSeamlessToLinearGraph(state, graph, modelLoaderNodeId); + modelLoaderNodeId = SEAMLESS; + } + // Add Refiner if enabled if (shouldUseSDXLRefiner) { addSDXLRefinerToGraph(state, graph, SDXL_DENOISE_LATENTS); + modelLoaderNodeId = REFINER_SEAMLESS; } // add LoRA support diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasTextToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasTextToImageGraph.ts index 1ceb23b71e..b25c266d66 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasTextToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildCanvasTextToImageGraph.ts @@ -10,6 +10,7 @@ import { addControlNetToLinearGraph } from './addControlNetToLinearGraph'; import { addDynamicPromptsToGraph } from './addDynamicPromptsToGraph'; import { addLoRAsToGraph } from './addLoRAsToGraph'; import { addNSFWCheckerToGraph } from './addNSFWCheckerToGraph'; +import { addSeamlessToLinearGraph } from './addSeamlessToLinearGraph'; import { addVAEToGraph } from './addVAEToGraph'; import { addWatermarkerToGraph } from './addWatermarkerToGraph'; import { @@ -24,6 +25,7 @@ import { NOISE, ONNX_MODEL_LOADER, POSITIVE_CONDITIONING, + SEAMLESS, } from './constants'; /** @@ -44,6 +46,8 @@ export const buildCanvasTextToImageGraph = ( clipSkip, shouldUseCpuNoise, shouldUseNoiseSettings, + seamlessXAxis, + seamlessYAxis, } = state.generation; // The bounding box determines width and height, not the width and height params @@ -70,7 +74,7 @@ export const buildCanvasTextToImageGraph = ( const isUsingOnnxModel = model.model_type === 'onnx'; - const modelLoaderNodeId = isUsingOnnxModel + let modelLoaderNodeId = isUsingOnnxModel ? ONNX_MODEL_LOADER : MAIN_MODEL_LOADER; @@ -321,6 +325,12 @@ export const buildCanvasTextToImageGraph = ( }, }); + // Add Seamless To Graph + if (seamlessXAxis || seamlessYAxis) { + addSeamlessToLinearGraph(state, graph, modelLoaderNodeId); + modelLoaderNodeId = SEAMLESS; + } + // optionally add custom VAE addVAEToGraph(state, graph, modelLoaderNodeId); diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLUnifiedCanvasTabParameters.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLUnifiedCanvasTabParameters.tsx index 00432bcec8..8fc4a3181c 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLUnifiedCanvasTabParameters.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLUnifiedCanvasTabParameters.tsx @@ -5,6 +5,7 @@ import ParamMaskAdjustmentCollapse from 'features/parameters/components/Paramete import ParamCanvasCoherencePassCollapse from 'features/parameters/components/Parameters/Canvas/SeamPainting/ParamCanvasCoherencePassCollapse'; import ParamControlNetCollapse from 'features/parameters/components/Parameters/ControlNet/ParamControlNetCollapse'; import ParamNoiseCollapse from 'features/parameters/components/Parameters/Noise/ParamNoiseCollapse'; +import ParamSeamlessCollapse from 'features/parameters/components/Parameters/Seamless/ParamSeamlessCollapse'; import ParamSDXLPromptArea from './ParamSDXLPromptArea'; import ParamSDXLRefinerCollapse from './ParamSDXLRefinerCollapse'; import SDXLUnifiedCanvasTabCoreParameters from './SDXLUnifiedCanvasTabCoreParameters'; @@ -22,6 +23,7 @@ export default function SDXLUnifiedCanvasTabParameters() { + ); } diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasParameters.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasParameters.tsx index 1c3d3cd270..a640e1bae4 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasParameters.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvas/UnifiedCanvasParameters.tsx @@ -6,6 +6,7 @@ import ParamMaskAdjustmentCollapse from 'features/parameters/components/Paramete import ParamCanvasCoherencePassCollapse from 'features/parameters/components/Parameters/Canvas/SeamPainting/ParamCanvasCoherencePassCollapse'; import ParamControlNetCollapse from 'features/parameters/components/Parameters/ControlNet/ParamControlNetCollapse'; import ParamPromptArea from 'features/parameters/components/Parameters/Prompt/ParamPromptArea'; +import ParamSeamlessCollapse from 'features/parameters/components/Parameters/Seamless/ParamSeamlessCollapse'; import ParamSymmetryCollapse from 'features/parameters/components/Parameters/Symmetry/ParamSymmetryCollapse'; import { memo } from 'react'; import UnifiedCanvasCoreParameters from './UnifiedCanvasCoreParameters'; @@ -22,6 +23,7 @@ const UnifiedCanvasParameters = () => { + );