mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
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:
parent
3c5b728bee
commit
4b2cd2da9f
@ -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
|
// 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
|
// 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
|
// 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
|
||||||
|
@ -1,17 +1,11 @@
|
|||||||
import { NUMPY_RAND_MAX } from 'app/constants';
|
import { NUMPY_RAND_MAX } from 'app/constants';
|
||||||
import type { RootState } from 'app/store/store';
|
import type { RootState } from 'app/store/store';
|
||||||
import { generateSeeds } from 'common/util/generateSeeds';
|
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 { components } from 'services/api/schema';
|
||||||
import type { Batch, BatchConfig, NonNullableGraph } from 'services/api/types';
|
import type { Batch, BatchConfig, NonNullableGraph } from 'services/api/types';
|
||||||
|
|
||||||
import {
|
import { CANVAS_COHERENCE_NOISE, METADATA, NOISE, POSITIVE_CONDITIONING } from './constants';
|
||||||
CANVAS_COHERENCE_NOISE,
|
|
||||||
METADATA,
|
|
||||||
NOISE,
|
|
||||||
POSITIVE_CONDITIONING,
|
|
||||||
PROMPT_REGION_MASK_TO_TENSOR_PREFIX,
|
|
||||||
} from './constants';
|
|
||||||
import { getHasMetadata, removeMetadata } from './metadata';
|
import { getHasMetadata, removeMetadata } from './metadata';
|
||||||
|
|
||||||
export const prepareLinearUIBatch = (state: RootState, graph: NonNullableGraph, prepend: boolean): BatchConfig => {
|
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 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) {
|
// add to metadata
|
||||||
// zipped batch of prompts
|
if (getHasMetadata(graph)) {
|
||||||
if (graph.nodes[POSITIVE_CONDITIONING]) {
|
removeMetadata(graph, 'positive_prompt');
|
||||||
firstBatchDatumList.push({
|
firstBatchDatumList.push({
|
||||||
node_path: POSITIVE_CONDITIONING,
|
node_path: METADATA,
|
||||||
field_name: 'prompt',
|
field_name: 'positive_prompt',
|
||||||
items: extendedPrompts,
|
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') {
|
if (shouldConcatSDXLStylePrompt && model?.base === 'sdxl') {
|
||||||
|
Loading…
Reference in New Issue
Block a user