mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
feat(ui): prompt expansion (#8140)
* initializing prompt expansion and putting response in prompt box working for all methods * properly disable UI and show loading state on prompt box when there is a pending prompt expansion item * misc wrapup: disable apploying prompt templates, dont block textarea resize handle * update progress to differentiate between prompt expansion and non * cleanup * lint * more cleanup * add image to background of loading state * add allowPromptExpansion for front-end gating * updated readiness text for needing to accept or discard * fix tsc * lint * lint * refactor(ui): prompt expansion logic * tidy(ui): remove unnecessary changes * revert(ui): unused arg on useImageUploadButton * feat(ui): simplify prompt expansion state * set pending for dragndrop and context menu * add readiness logic for generate tab * missing translation * update error handling for prompt expansion --------- Co-authored-by: Mary Hipp <maryhipp@Marys-Air.lan> Co-authored-by: Mary Hipp <maryhipp@Marys-MacBook-Air.local> Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import type { AppStore } from 'app/store/store';
|
||||
import type { AppDispatch } from 'app/store/store';
|
||||
import { Mutex } from 'async-mutex';
|
||||
import { withResultAsync, WrappedError } from 'common/util/result';
|
||||
import { parseify } from 'common/util/serialize';
|
||||
@@ -135,7 +135,7 @@ export const runGraph = (arg: RunGraphArg): Promise<RunGraphReturn> => {
|
||||
* Creates production dependencies for runGraph using Redux store and socket.
|
||||
*/
|
||||
export const buildRunGraphDependencies = (
|
||||
store: AppStore,
|
||||
dispatch: AppDispatch,
|
||||
socket: {
|
||||
on: (event: 'queue_item_status_changed', handler: (event: S['QueueItemStatusChangedEvent']) => void) => void;
|
||||
off: (event: 'queue_item_status_changed', handler: (event: S['QueueItemStatusChangedEvent']) => void) => void;
|
||||
@@ -143,17 +143,15 @@ export const buildRunGraphDependencies = (
|
||||
): GraphRunnerDependencies => ({
|
||||
executor: {
|
||||
enqueueBatch: (batch) =>
|
||||
store
|
||||
.dispatch(
|
||||
queueApi.endpoints.enqueueBatch.initiate(batch, {
|
||||
...enqueueMutationFixedCacheKeyOptions,
|
||||
track: false,
|
||||
})
|
||||
)
|
||||
.unwrap(),
|
||||
getQueueItem: (id) => store.dispatch(queueApi.endpoints.getQueueItem.initiate(id, { subscribe: false })).unwrap(),
|
||||
dispatch(
|
||||
queueApi.endpoints.enqueueBatch.initiate(batch, {
|
||||
...enqueueMutationFixedCacheKeyOptions,
|
||||
track: false,
|
||||
})
|
||||
).unwrap(),
|
||||
getQueueItem: (id) => dispatch(queueApi.endpoints.getQueueItem.initiate(id, { subscribe: false })).unwrap(),
|
||||
cancelQueueItem: (id) =>
|
||||
store.dispatch(queueApi.endpoints.cancelQueueItem.initiate({ item_id: id }, { track: false })).unwrap(),
|
||||
dispatch(queueApi.endpoints.cancelQueueItem.initiate({ item_id: id }, { track: false })).unwrap(),
|
||||
},
|
||||
eventHandler: {
|
||||
subscribe: (handler) => socket.on('queue_item_status_changed', handler),
|
||||
|
||||
Reference in New Issue
Block a user