mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
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:
parent
9359c03c3c
commit
28b74523d0
@ -23,44 +23,6 @@ export const prepareLinearUIBatch = (
|
|||||||
const { prompts, seedBehaviour } = state.dynamicPrompts;
|
const { prompts, seedBehaviour } = state.dynamicPrompts;
|
||||||
|
|
||||||
const data: Batch['data'] = [];
|
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 firstBatchDatumList: components['schemas']['BatchDatum'][] = [];
|
||||||
const secondBatchDatumList: components['schemas']['BatchDatum'][] = [];
|
const secondBatchDatumList: components['schemas']['BatchDatum'][] = [];
|
||||||
|
|
||||||
@ -180,7 +142,6 @@ export const prepareLinearUIBatch = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
data.push(firstBatchDatumList);
|
data.push(firstBatchDatumList);
|
||||||
}
|
|
||||||
|
|
||||||
const enqueueBatchArg: BatchConfig = {
|
const enqueueBatchArg: BatchConfig = {
|
||||||
prepend,
|
prepend,
|
||||||
|
Loading…
Reference in New Issue
Block a user