fix(ui): filter out batch nodes when checking readiness on workflows tab

This commit is contained in:
psychedelicious
2025-01-13 17:11:16 +11:00
parent 584601d03f
commit 96671d12bd
2 changed files with 6 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ import { v4 as uuidv4 } from 'uuid';
const log = logger('workflows');
// These nodes are not executable, they exist for the frontend only
const filterNonExecutableNodes = (node: InvocationNode) => {
export const filterNonExecutableNodes = (node: InvocationNode) => {
if (node.data.type === 'image_batch') {
return false;
}

View File

@@ -34,6 +34,7 @@ import {
validateStringFieldCollectionValue,
} from 'features/nodes/types/fieldValidators';
import { isInvocationNode } from 'features/nodes/types/invocation';
import { filterNonExecutableNodes } from 'features/nodes/util/graph/buildNodesGraph';
import type { UpscaleState } from 'features/parameters/store/upscaleSlice';
import { selectUpscaleSlice } from 'features/parameters/store/upscaleSlice';
import { selectConfigSlice } from 'features/system/store/configSlice';
@@ -75,11 +76,13 @@ const getReasonsWhyCannotEnqueueWorkflowsTab = (arg: {
}
if (workflowSettings.shouldValidateGraph) {
if (!nodes.nodes.length) {
const nodesToCheck = nodes.nodes.filter(isInvocationNode).filter(filterNonExecutableNodes);
if (!nodesToCheck.length) {
reasons.push({ content: i18n.t('parameters.invoke.noNodesInGraph') });
}
nodes.nodes.forEach((node) => {
nodesToCheck.forEach((node) => {
if (!isInvocationNode(node)) {
return;
}