-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into stalker7779/modular_rescale_cfg
- Loading branch information
Showing
45 changed files
with
1,374 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...tend/web/src/app/store/middleware/listenerMiddleware/listeners/enqueueRequestedUpscale.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { enqueueRequested } from 'app/store/actions'; | ||
import type { AppStartListening } from 'app/store/middleware/listenerMiddleware'; | ||
import { isImageViewerOpenChanged } from 'features/gallery/store/gallerySlice'; | ||
import { prepareLinearUIBatch } from 'features/nodes/util/graph/buildLinearBatchConfig'; | ||
import { buildMultidiffusionUpscaleGraph } from 'features/nodes/util/graph/buildMultidiffusionUpscaleGraph'; | ||
import { queueApi } from 'services/api/endpoints/queue'; | ||
|
||
export const addEnqueueRequestedUpscale = (startAppListening: AppStartListening) => { | ||
startAppListening({ | ||
predicate: (action): action is ReturnType<typeof enqueueRequested> => | ||
enqueueRequested.match(action) && action.payload.tabName === 'upscaling', | ||
effect: async (action, { getState, dispatch }) => { | ||
const state = getState(); | ||
const { shouldShowProgressInViewer } = state.ui; | ||
const { prepend } = action.payload; | ||
|
||
const graph = await buildMultidiffusionUpscaleGraph(state); | ||
|
||
const batchConfig = prepareLinearUIBatch(state, graph, prepend); | ||
|
||
const req = dispatch( | ||
queueApi.endpoints.enqueueBatch.initiate(batchConfig, { | ||
fixedCacheKey: 'enqueueBatch', | ||
}) | ||
); | ||
try { | ||
await req.unwrap(); | ||
if (shouldShowProgressInViewer) { | ||
dispatch(isImageViewerOpenChanged(true)); | ||
} | ||
} finally { | ||
req.reset(); | ||
} | ||
}, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.