feat(ui): rename "link_id" -> "batch_group_id"

This commit is contained in:
psychedelicious
2025-01-14 12:12:36 +11:00
parent 775bb276b2
commit a7326e3ad4
3 changed files with 16 additions and 14 deletions

View File

@@ -1044,7 +1044,7 @@
"collectionNumberGTExclusiveMax": "{{value}} >= {{exclusiveMaximum}} (exc max)",
"collectionNumberLTExclusiveMin": "{{value}} <= {{exclusiveMinimum}} (exc min)",
"collectionNumberNotMultipleOf": "{{value}} not multiple of {{multipleOf}}",
"batchNodeCollectionSizeMismatch": "Collection size mismatch on batch group {{linkId}}",
"batchNodeCollectionSizeMismatch": "Collection size mismatch on batch group {{batchGroupId}}",
"noModelSelected": "No model selected",
"noT5EncoderModelSelected": "No T5 Encoder model selected for FLUX generation",
"noFLUXVAEModelSelected": "No VAE model selected for FLUX generation",

View File

@@ -43,8 +43,8 @@ export const addEnqueueRequestedNodes = (startAppListening: AppStartListening) =
const batchNodes = nodes.nodes.filter(isInvocationNode).filter(isBatchNode);
// Handle zipping batch nodes. First group the batch nodes by their link_id
const groupedBatchNodes = groupBy(batchNodes, (node) => node.data.inputs['link_id']?.value);
// Handle zipping batch nodes. First group the batch nodes by their batch_group_id
const groupedBatchNodes = groupBy(batchNodes, (node) => node.data.inputs['batch_group_id']?.value);
const addProductBatchDataCollectionItem = (
edges: InvocationNodeEdge[],
@@ -67,7 +67,7 @@ export const addEnqueueRequestedNodes = (startAppListening: AppStartListening) =
};
// Then, we will create a batch data collection item for each group
for (const [linkId, batchNodes] of Object.entries(groupedBatchNodes)) {
for (const [batchGroupId, batchNodes] of Object.entries(groupedBatchNodes)) {
const zippedBatchDataCollectionItems: NonNullable<Batch['data']>[number] = [];
const addZippedBatchDataCollectionItem = (
edges: InvocationNodeEdge[],
@@ -98,7 +98,7 @@ export const addEnqueueRequestedNodes = (startAppListening: AppStartListening) =
// Find outgoing edges from the batch node, we will remove these from the graph and create batch data collection items from them instead
const edgesFromImageBatch = nodes.edges.filter((e) => e.source === node.id && e.sourceHandle === 'image');
if (linkId) {
if (batchGroupId) {
addZippedBatchDataCollectionItem(edgesFromImageBatch, images.value);
} else {
addProductBatchDataCollectionItem(edgesFromImageBatch, images.value);
@@ -117,7 +117,7 @@ export const addEnqueueRequestedNodes = (startAppListening: AppStartListening) =
// Find outgoing edges from the batch node, we will remove these from the graph and create batch data collection items from them instead
const edgesFromStringBatch = nodes.edges.filter((e) => e.source === node.id && e.sourceHandle === 'value');
if (linkId) {
if (batchGroupId) {
addZippedBatchDataCollectionItem(edgesFromStringBatch, strings.value);
} else {
addProductBatchDataCollectionItem(edgesFromStringBatch, strings.value);
@@ -140,7 +140,7 @@ export const addEnqueueRequestedNodes = (startAppListening: AppStartListening) =
// Find outgoing edges from the batch node, we will remove these from the graph and create batch data collection items from them instead
const edgesFromStringBatch = nodes.edges.filter((e) => e.source === node.id && e.sourceHandle === 'value');
if (linkId) {
if (batchGroupId) {
addZippedBatchDataCollectionItem(edgesFromStringBatch, integers.value);
} else {
addProductBatchDataCollectionItem(edgesFromStringBatch, integers.value);
@@ -163,7 +163,7 @@ export const addEnqueueRequestedNodes = (startAppListening: AppStartListening) =
// Find outgoing edges from the batch node, we will remove these from the graph and create batch data collection items from them instead
const edgesFromStringBatch = nodes.edges.filter((e) => e.source === node.id && e.sourceHandle === 'value');
if (linkId) {
if (batchGroupId) {
addZippedBatchDataCollectionItem(edgesFromStringBatch, floats.value);
} else {
addProductBatchDataCollectionItem(edgesFromStringBatch, floats.value);
@@ -171,7 +171,7 @@ export const addEnqueueRequestedNodes = (startAppListening: AppStartListening) =
}
// Finally, if this batch data collection item has any items, add it to the data array
if (linkId && zippedBatchDataCollectionItems.length > 0) {
if (batchGroupId && zippedBatchDataCollectionItems.length > 0) {
data.push(zippedBatchDataCollectionItems);
}
}

View File

@@ -85,10 +85,10 @@ const getReasonsWhyCannotEnqueueWorkflowsTab = (arg: {
}
if (batchNodes.length > 1) {
const groupedBatchNodes = groupBy(batchNodes, (node) => node.data.inputs['link_id']?.value);
for (const [linkId, batchNodes] of Object.entries(groupedBatchNodes)) {
if (!linkId) {
// No link ID implies ungrouped batch nodes, their collection sizes can be different
const groupedBatchNodes = groupBy(batchNodes, (node) => node.data.inputs['batch_group_id']?.value);
for (const [batchGroupId, batchNodes] of Object.entries(groupedBatchNodes)) {
if (!batchGroupId) {
// No batch group ID implies ungrouped batch nodes, their collection sizes can be different
continue;
}
@@ -112,7 +112,9 @@ const getReasonsWhyCannotEnqueueWorkflowsTab = (arg: {
}
if (collectionSizes.some((count) => count !== collectionSizes[0])) {
reasons.push({ content: i18n.t('parameters.invoke.batchNodeCollectionSizeMismatch', { linkId }) });
reasons.push({
content: i18n.t('parameters.invoke.batchNodeCollectionSizeMismatch', { batchGroupId }),
});
}
}
}