diff --git a/invokeai/app/invocations/metadata.py b/invokeai/app/invocations/metadata.py index 4a968ff3ac..9c028a2dc1 100644 --- a/invokeai/app/invocations/metadata.py +++ b/invokeai/app/invocations/metadata.py @@ -72,10 +72,10 @@ class CoreMetadata(BaseModelExcludeNull): ) refiner_steps: Optional[int] = Field(default=None, description="The number of steps used for the refiner") refiner_scheduler: Optional[str] = Field(default=None, description="The scheduler used for the refiner") - refiner_positive_aesthetic_store: Optional[float] = Field( + refiner_positive_aesthetic_score: Optional[float] = Field( default=None, description="The aesthetic score used for the refiner" ) - refiner_negative_aesthetic_store: Optional[float] = Field( + refiner_negative_aesthetic_score: Optional[float] = Field( default=None, description="The aesthetic score used for the refiner" ) refiner_start: Optional[float] = Field(default=None, description="The start value used for refiner denoising") @@ -160,11 +160,11 @@ class MetadataAccumulatorInvocation(BaseInvocation): default=None, description="The scheduler used for the refiner", ) - refiner_positive_aesthetic_store: Optional[float] = InputField( + refiner_positive_aesthetic_score: Optional[float] = InputField( default=None, description="The aesthetic score used for the refiner", ) - refiner_negative_aesthetic_store: Optional[float] = InputField( + refiner_negative_aesthetic_score: Optional[float] = InputField( default=None, description="The aesthetic score used for the refiner", ) diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataActions.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataActions.tsx index 65d7be454e..e82b03360e 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataActions.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataActions.tsx @@ -101,13 +101,15 @@ const ImageMetadataActions = (props: Props) => { onClick={handleRecallSeed} /> )} - {metadata.model !== undefined && metadata.model !== null && ( - - )} + {metadata.model !== undefined && + metadata.model !== null && + metadata.model.model_name && ( + + )} {metadata.width && ( ; diff --git a/invokeai/frontend/web/src/features/nodes/util/getMetadataAndWorkflowFromImageBlob.ts b/invokeai/frontend/web/src/features/nodes/util/getMetadataAndWorkflowFromImageBlob.ts index d44b4a7db1..b46a701757 100644 --- a/invokeai/frontend/web/src/features/nodes/util/getMetadataAndWorkflowFromImageBlob.ts +++ b/invokeai/frontend/web/src/features/nodes/util/getMetadataAndWorkflowFromImageBlob.ts @@ -1,4 +1,6 @@ import * as png from '@stevebel/png'; +import { logger } from 'app/logging/logger'; +import { parseify } from 'common/util/serialize'; import { ImageMetadataAndWorkflow, zCoreMetadata, @@ -18,6 +20,11 @@ export const getMetadataAndWorkflowFromImageBlob = async ( const metadataResult = zCoreMetadata.safeParse(JSON.parse(rawMetadata)); if (metadataResult.success) { data.metadata = metadataResult.data; + } else { + logger('system').error( + { error: parseify(metadataResult.error) }, + 'Problem reading metadata from image' + ); } } @@ -26,6 +33,11 @@ export const getMetadataAndWorkflowFromImageBlob = async ( const workflowResult = zWorkflow.safeParse(JSON.parse(rawWorkflow)); if (workflowResult.success) { data.workflow = workflowResult.data; + } else { + logger('system').error( + { error: parseify(workflowResult.error) }, + 'Problem reading workflow from image' + ); } } diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSDXLRefinerToGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSDXLRefinerToGraph.ts index 92d15ffd8c..f35e37d8e7 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSDXLRefinerToGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSDXLRefinerToGraph.ts @@ -60,9 +60,9 @@ export const addSDXLRefinerToGraph = ( if (metadataAccumulator) { metadataAccumulator.refiner_model = refinerModel; - metadataAccumulator.refiner_positive_aesthetic_store = + metadataAccumulator.refiner_positive_aesthetic_score = refinerPositiveAestheticScore; - metadataAccumulator.refiner_negative_aesthetic_store = + metadataAccumulator.refiner_negative_aesthetic_score = refinerNegativeAestheticScore; metadataAccumulator.refiner_cfg_scale = refinerCFGScale; metadataAccumulator.refiner_scheduler = refinerScheduler; diff --git a/invokeai/frontend/web/src/features/parameters/hooks/useRecallParameters.ts b/invokeai/frontend/web/src/features/parameters/hooks/useRecallParameters.ts index 6794aababc..203ff2cb1b 100644 --- a/invokeai/frontend/web/src/features/parameters/hooks/useRecallParameters.ts +++ b/invokeai/frontend/web/src/features/parameters/hooks/useRecallParameters.ts @@ -341,8 +341,8 @@ export const useRecallParameters = () => { refiner_cfg_scale, refiner_steps, refiner_scheduler, - refiner_positive_aesthetic_store, - refiner_negative_aesthetic_store, + refiner_positive_aesthetic_score, + refiner_negative_aesthetic_score, refiner_start, } = metadata; @@ -403,21 +403,21 @@ export const useRecallParameters = () => { if ( isValidSDXLRefinerPositiveAestheticScore( - refiner_positive_aesthetic_store + refiner_positive_aesthetic_score ) ) { dispatch( - setRefinerPositiveAestheticScore(refiner_positive_aesthetic_store) + setRefinerPositiveAestheticScore(refiner_positive_aesthetic_score) ); } if ( isValidSDXLRefinerNegativeAestheticScore( - refiner_negative_aesthetic_store + refiner_negative_aesthetic_score ) ) { dispatch( - setRefinerNegativeAestheticScore(refiner_negative_aesthetic_store) + setRefinerNegativeAestheticScore(refiner_negative_aesthetic_score) ); }