File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
invokeai/frontend/web/src/features/metadata Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -950,21 +950,24 @@ const recallByHandlers = async (arg: {
950
950
}
951
951
}
952
952
953
- // If we recalled style prompts, and they were _different_ from the positive prompt, we need to disable prompt concat.
953
+ // We may need to update the prompt concat flag based on the recalled prompts
954
954
const positivePrompt = recalled . get ( MetadataHandlers . PositivePrompt ) ;
955
955
const negativePrompt = recalled . get ( MetadataHandlers . NegativePrompt ) ;
956
956
const positiveStylePrompt = recalled . get ( MetadataHandlers . PositiveStylePrompt ) ;
957
957
const negativeStylePrompt = recalled . get ( MetadataHandlers . NegativeStylePrompt ) ;
958
958
959
+ // The values will be undefined if the handler was not recalled
959
960
if (
960
- ( positiveStylePrompt && positiveStylePrompt !== positivePrompt ) ||
961
- ( negativeStylePrompt && negativeStylePrompt !== negativePrompt )
961
+ positivePrompt !== undefined ||
962
+ negativePrompt !== undefined ||
963
+ positiveStylePrompt !== undefined ||
964
+ negativeStylePrompt !== undefined
962
965
) {
963
- // If we set the negative style prompt or positive style prompt, we should disable prompt concat
964
- store . dispatch ( shouldConcatPromptsChanged ( false ) ) ;
965
- } else {
966
- // Otherwise, we should enable prompt concat
967
- store . dispatch ( shouldConcatPromptsChanged ( true ) ) ;
966
+ const concat =
967
+ ( Boolean ( positiveStylePrompt ) && positiveStylePrompt === positivePrompt ) ||
968
+ ( Boolean ( negativeStylePrompt ) && negativeStylePrompt === negativePrompt ) ;
969
+
970
+ store . dispatch ( shouldConcatPromptsChanged ( concat ) ) ;
968
971
}
969
972
970
973
if ( ! silent ) {
You can’t perform that action at this time.
0 commit comments