fix(ui): fix dynamic prompts with single prompt

Closes #5292

The special handling for single prompt is totally extraneous and caused a bug.
This commit is contained in:
psychedelicious 2024-01-01 20:56:43 +11:00 committed by Kent Keirsey
parent 9359c03c3c
commit 28b74523d0

View File

@ -23,44 +23,6 @@ export const prepareLinearUIBatch = (
const { prompts, seedBehaviour } = state.dynamicPrompts;
const data: Batch['data'] = [];
if (prompts.length === 1) {
const seeds = generateSeeds({
count: iterations,
start: shouldRandomizeSeed ? undefined : seed,
});
const zipped: components['schemas']['BatchDatum'][] = [];
if (graph.nodes[NOISE]) {
zipped.push({
node_path: NOISE,
field_name: 'seed',
items: seeds,
});
}
if (getHasMetadata(graph)) {
// add to metadata
removeMetadata(graph, 'seed');
zipped.push({
node_path: METADATA,
field_name: 'seed',
items: seeds,
});
}
if (graph.nodes[CANVAS_COHERENCE_NOISE]) {
zipped.push({
node_path: CANVAS_COHERENCE_NOISE,
field_name: 'seed',
items: seeds.map((seed) => (seed + 1) % NUMPY_RAND_MAX),
});
}
data.push(zipped);
} else {
// prompts.length > 1 aka dynamic prompts
const firstBatchDatumList: components['schemas']['BatchDatum'][] = [];
const secondBatchDatumList: components['schemas']['BatchDatum'][] = [];
@ -180,7 +142,6 @@ export const prepareLinearUIBatch = (
}
data.push(firstBatchDatumList);
}
const enqueueBatchArg: BatchConfig = {
prepend,