feat(ui): remove special handling of main prompt

Until we have a good handle on what works best, leaving this to the user
This commit is contained in:
psychedelicious 2024-04-19 16:40:21 +10:00 committed by Kent Keirsey
parent 3c5b728bee
commit 4b2cd2da9f
2 changed files with 18 additions and 32 deletions

View File

@ -96,10 +96,6 @@ export const addRegionalPromptsToGraph = async (state: RootState, graph: NonNull
},
});
// Remove the global prompt
// TODO: Append regional prompts to CLIP2's prompt? Dunno...
(graph.nodes[POSITIVE_CONDITIONING] as S['SDXLCompelPromptInvocation'] | S['CompelInvocation']).prompt = '';
// Upload the blobs to the backend, add each to graph
// TODO: Store the uploaded image names in redux to reuse them, so long as the layer hasn't otherwise changed. This
// would be a great perf win - not only would we skip re-uploading the same image, but we'd be able to use the node

View File

@ -1,17 +1,11 @@
import { NUMPY_RAND_MAX } from 'app/constants';
import type { RootState } from 'app/store/store';
import { generateSeeds } from 'common/util/generateSeeds';
import { range, some } from 'lodash-es';
import { range } from 'lodash-es';
import type { components } from 'services/api/schema';
import type { Batch, BatchConfig, NonNullableGraph } from 'services/api/types';
import {
CANVAS_COHERENCE_NOISE,
METADATA,
NOISE,
POSITIVE_CONDITIONING,
PROMPT_REGION_MASK_TO_TENSOR_PREFIX,
} from './constants';
import { CANVAS_COHERENCE_NOISE, METADATA, NOISE, POSITIVE_CONDITIONING } from './constants';
import { getHasMetadata, removeMetadata } from './metadata';
export const prepareLinearUIBatch = (state: RootState, graph: NonNullableGraph, prepend: boolean): BatchConfig => {
@ -92,27 +86,23 @@ export const prepareLinearUIBatch = (state: RootState, graph: NonNullableGraph,
const extendedPrompts = seedBehaviour === 'PER_PROMPT' ? range(iterations).flatMap(() => prompts) : prompts;
const hasRegionalPrompts = some(graph.nodes, (n) => n.id.startsWith(PROMPT_REGION_MASK_TO_TENSOR_PREFIX));
// zipped batch of prompts
if (graph.nodes[POSITIVE_CONDITIONING]) {
firstBatchDatumList.push({
node_path: POSITIVE_CONDITIONING,
field_name: 'prompt',
items: extendedPrompts,
});
}
if (!hasRegionalPrompts) {
// zipped batch of prompts
if (graph.nodes[POSITIVE_CONDITIONING]) {
firstBatchDatumList.push({
node_path: POSITIVE_CONDITIONING,
field_name: 'prompt',
items: extendedPrompts,
});
}
// add to metadata
if (getHasMetadata(graph)) {
removeMetadata(graph, 'positive_prompt');
firstBatchDatumList.push({
node_path: METADATA,
field_name: 'positive_prompt',
items: extendedPrompts,
});
}
// add to metadata
if (getHasMetadata(graph)) {
removeMetadata(graph, 'positive_prompt');
firstBatchDatumList.push({
node_path: METADATA,
field_name: 'positive_prompt',
items: extendedPrompts,
});
}
if (shouldConcatSDXLStylePrompt && model?.base === 'sdxl') {