revert(ui): restore metadata parsers for created_by

This commit is contained in:
psychedelicious 2024-03-19 21:01:27 +11:00
parent aa2c404cab
commit acca197893
2 changed files with 4 additions and 0 deletions

View File

@ -174,6 +174,7 @@ const buildHandlers: BuildMetadataHandlers = ({
export const handlers = {
// Misc
createdBy: buildHandlers({ getLabel: () => t('metadata.createdBy'), parser: parsers.createdBy }),
generationMode: buildHandlers({ getLabel: () => t('metadata.generationMode'), parser: parsers.generationMode }),
// Core parameters

View File

@ -108,6 +108,8 @@ const getProperty = <T = unknown>(
});
};
const parseCreatedBy: MetadataParseFunc<string> = (metadata) => getProperty(metadata, 'created_by', isString);
const parseGenerationMode: MetadataParseFunc<string> = (metadata) => getProperty(metadata, 'generation_mode', isString);
const parsePositivePrompt: MetadataParseFunc<ParameterPositivePrompt> = (metadata) =>
@ -389,6 +391,7 @@ const parseAllIPAdapters: MetadataParseFunc<IPAdapterConfigMetadata[]> = async (
};
export const parsers = {
createdBy: parseCreatedBy,
generationMode: parseGenerationMode,
positivePrompt: parsePositivePrompt,
negativePrompt: parseNegativePrompt,