mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
update simple upscale metadata to match upscale metadata
This commit is contained in:
parent
b46b20210d
commit
cbce89162b
@ -39,7 +39,7 @@ export const addUpscaleRequestedListener = (startAppListening: AppStartListening
|
|||||||
const enqueueBatchArg: BatchConfig = {
|
const enqueueBatchArg: BatchConfig = {
|
||||||
prepend: true,
|
prepend: true,
|
||||||
batch: {
|
batch: {
|
||||||
graph: buildAdHocUpscaleGraph({
|
graph: await buildAdHocUpscaleGraph({
|
||||||
image: imageDTO,
|
image: imageDTO,
|
||||||
state,
|
state,
|
||||||
}),
|
}),
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
import type { RootState } from 'app/store/store';
|
import type { RootState } from 'app/store/store';
|
||||||
import type { Graph, ImageDTO, Invocation, NonNullableGraph } from 'services/api/types';
|
import { fetchModelConfigWithTypeGuard } from 'features/metadata/util/modelFetchingHelpers';
|
||||||
|
import {
|
||||||
|
type ImageDTO,
|
||||||
|
type Invocation,
|
||||||
|
isSpandrelImageToImageModelConfig,
|
||||||
|
type NonNullableGraph,
|
||||||
|
} from 'services/api/types';
|
||||||
import { assert } from 'tsafe';
|
import { assert } from 'tsafe';
|
||||||
|
|
||||||
import { addCoreMetadataNode, upsertMetadata } from './canvas/metadata';
|
import { addCoreMetadataNode, getModelMetadataField, upsertMetadata } from './canvas/metadata';
|
||||||
import { SPANDREL } from './constants';
|
import { SPANDREL } from './constants';
|
||||||
|
|
||||||
type Arg = {
|
type Arg = {
|
||||||
@ -10,7 +16,7 @@ type Arg = {
|
|||||||
state: RootState;
|
state: RootState;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const buildAdHocUpscaleGraph = ({ image, state }: Arg): Graph => {
|
export const buildAdHocUpscaleGraph = async ({ image, state }: Arg): Promise<NonNullableGraph> => {
|
||||||
const { simpleUpscaleModel } = state.upscale;
|
const { simpleUpscaleModel } = state.upscale;
|
||||||
|
|
||||||
assert(simpleUpscaleModel, 'No upscale model found in state');
|
assert(simpleUpscaleModel, 'No upscale model found in state');
|
||||||
@ -30,10 +36,11 @@ export const buildAdHocUpscaleGraph = ({ image, state }: Arg): Graph => {
|
|||||||
},
|
},
|
||||||
edges: [],
|
edges: [],
|
||||||
};
|
};
|
||||||
|
const modelConfig = await fetchModelConfigWithTypeGuard(simpleUpscaleModel.key, isSpandrelImageToImageModelConfig);
|
||||||
|
|
||||||
addCoreMetadataNode(graph, {}, SPANDREL);
|
addCoreMetadataNode(graph, {}, SPANDREL);
|
||||||
upsertMetadata(graph, {
|
upsertMetadata(graph, {
|
||||||
spandrel_model: simpleUpscaleModel,
|
upscale_model: getModelMetadataField(modelConfig),
|
||||||
});
|
});
|
||||||
|
|
||||||
return graph;
|
return graph;
|
||||||
|
Loading…
Reference in New Issue
Block a user