Skip to content

Commit 70b9195

Browse files
authored
Merge branch 'invoke-ai:main' into dype-paper
2 parents 2b13e1d + 7f2878f commit 70b9195

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

invokeai/frontend/web/src/features/nodes/util/graph/generation/buildFLUXGraph.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,20 +271,26 @@ export const buildFLUXGraph = async (arg: GraphBuilderArg): Promise<GraphBuilder
271271
.filter((entity) => getGlobalReferenceImageWarnings(entity, model).length === 0);
272272

273273
if (validFlux2RefImageConfigs.length > 0) {
274-
const flux2KontextCollect = g.addNode({
275-
type: 'collect',
276-
id: getPrefixedId('flux2_kontext_collect'),
277-
});
274+
let prevCollect: Invocation<'collect'> | null = null;
278275
for (const { config } of validFlux2RefImageConfigs) {
279276
// FLUX.2 uses the same flux_kontext node - it just packages the image
280277
const kontextConditioning = g.addNode({
281278
type: 'flux_kontext',
282279
id: getPrefixedId('flux_kontext'),
283280
image: zImageField.parse(config.image?.crop?.image ?? config.image?.original.image),
284281
});
285-
g.addEdge(kontextConditioning, 'kontext_cond', flux2KontextCollect, 'item');
282+
const collectNode = g.addNode({
283+
type: 'collect',
284+
id: getPrefixedId('flux2_kontext_collect'),
285+
});
286+
g.addEdge(kontextConditioning, 'kontext_cond', collectNode, 'item');
287+
if (prevCollect !== null) {
288+
g.addEdge(prevCollect, 'collection', collectNode, 'collection');
289+
}
290+
prevCollect = collectNode;
286291
}
287-
g.addEdge(flux2KontextCollect, 'collection', flux2Denoise, 'kontext_conditioning');
292+
assert(prevCollect !== null);
293+
g.addEdge(prevCollect, 'collection', flux2Denoise, 'kontext_conditioning');
288294

289295
g.upsertMetadata({ ref_images: validFlux2RefImageConfigs }, 'merge');
290296
}

0 commit comments

Comments
 (0)