Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

fix(webv2): record ERNIE-Image's encoder and SD PiD models in image metadata

Josh Corbettc0035d10fc3a
diff --git a/invokeai/app/invocations/metadata.py b/invokeai/app/invocations/metadata.py
index 59057903d9..79577774cc 100644
--- a/invokeai/app/invocations/metadata.py
+++ b/invokeai/app/invocations/metadata.py
@@ -288,11 +288,11 @@ class CoreMetadataInvocation(BaseInvocation):
default=None,
description="The Qwen3 text encoder model used for Z-Image inference",
)
- # FLUX.2 [dev] uses a Mistral text encoder where FLUX.2 Klein uses Qwen3, so it needs its own slot
- # rather than reusing `qwen3_encoder` - the two are never both present on one image.
+ # FLUX.2 [dev] and ERNIE-Image use Mistral-family text encoders where FLUX.2 Klein uses Qwen3, so they
+ # need their own slot rather than reusing `qwen3_encoder` - the two are never both present on one image.
mistral_encoder: Optional[ModelIdentifierField] = InputField(
default=None,
- description="The Mistral text encoder model used for FLUX.2 [dev] inference",
+ description="The Mistral text encoder model used for FLUX.2 [dev] or ERNIE-Image inference",
)
# Ideogram 4 assembles its structured JSON caption at generation time (ideogram4_caption_builder),
# so this is a declared field rather than a static extra: the graph wires the builder's output to it
diff --git a/invokeai/frontend/web/openapi.json b/invokeai/frontend/web/openapi.json
index 7b5d82e2c4..82b0afffc3 100644
--- a/invokeai/frontend/web/openapi.json
+++ b/invokeai/frontend/web/openapi.json
@@ -27406,7 +27406,7 @@
}
],
"default": null,
- "description": "The Mistral text encoder model used for FLUX.2 [dev] inference",
+ "description": "The Mistral text encoder model used for FLUX.2 [dev] or ERNIE-Image inference",
"field_kind": "input",
"input": "any",
"orig_default": null,
diff --git a/invokeai/frontend/web/src/services/api/schema.ts b/invokeai/frontend/web/src/services/api/schema.ts
index 508a31ce75..281265b050 100644
--- a/invokeai/frontend/web/src/services/api/schema.ts
+++ b/invokeai/frontend/web/src/services/api/schema.ts
@@ -9988,7 +9988,7 @@ export type components = {
*/
qwen3_encoder?: components["schemas"]["ModelIdentifierField"] | null;
/**
- * @description The Mistral text encoder model used for FLUX.2 [dev] inference
+ * @description The Mistral text encoder model used for FLUX.2 [dev] or ERNIE-Image inference
* @default null
*/
mistral_encoder?: components["schemas"]["ModelIdentifierField"] | null;
diff --git a/invokeai/frontend/webv2/src/features/generation/core/graph.ts b/invokeai/frontend/webv2/src/features/generation/core/graph.ts
index 67a55c7b40..87a4168e40 100644
--- a/invokeai/frontend/webv2/src/features/generation/core/graph.ts
+++ b/invokeai/frontend/webv2/src/features/generation/core/graph.ts
@@ -453,6 +453,7 @@ const buildSDGraph = (
hidiffusion_window_attn: settings.hiDiffusionWindowAttentionEnabled,
}
: {}),
+ ...(shouldUsePidDecode(settings, model.base) ? getPidMetadata(settings) : {}),
scheduler,
});
addReferenceImageMetadata(graph, output, settings);
@@ -893,7 +894,9 @@ const buildErnieImageGraph = (
addEdge(graph, seed, 'value', denoise, 'seed');
addEdge(graph, denoise, 'latents', output, 'latents');
- addMetadata(graph, output, settings, model, 'ernie_image_txt2img', projectSettings);
+ addMetadata(graph, output, settings, model, 'ernie_image_txt2img', projectSettings, {
+ mistral_encoder: mistralEncoderModel ?? undefined,
+ });
return graph;
};