mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(nodes): fix missing generation modes
Lax typing on the metadata util functions allowed a typing issue to slip through. Fixed the lax typing, updated core metadata node.
This commit is contained in:
parent
7b066681f0
commit
8615d53e65
@ -107,11 +107,16 @@ class MergeMetadataInvocation(BaseInvocation):
|
|||||||
return MetadataOutput(metadata=MetadataField.model_validate(data))
|
return MetadataOutput(metadata=MetadataField.model_validate(data))
|
||||||
|
|
||||||
|
|
||||||
|
GENERATION_MODES = Literal[
|
||||||
|
"txt2img", "img2img", "inpaint", "outpaint", "sdxl_txt2img", "sdxl_img2img", "sdxl_inpaint", "sdxl_outpaint"
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
@invocation("core_metadata", title="Core Metadata", tags=["metadata"], category="metadata", version="1.0.0")
|
@invocation("core_metadata", title="Core Metadata", tags=["metadata"], category="metadata", version="1.0.0")
|
||||||
class CoreMetadataInvocation(BaseInvocation):
|
class CoreMetadataInvocation(BaseInvocation):
|
||||||
"""Collects core generation metadata into a MetadataField"""
|
"""Collects core generation metadata into a MetadataField"""
|
||||||
|
|
||||||
generation_mode: Literal["txt2img", "img2img", "inpaint", "outpaint"] = InputField(
|
generation_mode: Optional[GENERATION_MODES] = InputField(
|
||||||
default=None,
|
default=None,
|
||||||
description="The generation mode that output this image",
|
description="The generation mode that output this image",
|
||||||
)
|
)
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
SaveImageInvocation,
|
SaveImageInvocation,
|
||||||
} from 'services/api/types';
|
} from 'services/api/types';
|
||||||
import { REALESRGAN as ESRGAN, SAVE_IMAGE } from './constants';
|
import { REALESRGAN as ESRGAN, SAVE_IMAGE } from './constants';
|
||||||
import { addCoreMetadataNode } from './metadata';
|
import { addCoreMetadataNode, upsertMetadata } from './metadata';
|
||||||
|
|
||||||
type Arg = {
|
type Arg = {
|
||||||
image_name: string;
|
image_name: string;
|
||||||
@ -56,7 +56,8 @@ export const buildAdHocUpscaleGraph = ({
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
addCoreMetadataNode(graph, {
|
addCoreMetadataNode(graph, {});
|
||||||
|
upsertMetadata(graph, {
|
||||||
esrgan_model: esrganModelName,
|
esrgan_model: esrganModelName,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import { METADATA, SAVE_IMAGE } from './constants';
|
|||||||
|
|
||||||
export const addCoreMetadataNode = (
|
export const addCoreMetadataNode = (
|
||||||
graph: NonNullableGraph,
|
graph: NonNullableGraph,
|
||||||
metadata: Partial<CoreMetadataInvocation> | JsonObject
|
metadata: Partial<CoreMetadataInvocation>
|
||||||
): void => {
|
): void => {
|
||||||
graph.nodes[METADATA] = {
|
graph.nodes[METADATA] = {
|
||||||
id: METADATA,
|
id: METADATA,
|
||||||
|
152
invokeai/frontend/web/src/services/api/schema.d.ts
vendored
152
invokeai/frontend/web/src/services/api/schema.d.ts
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user