feat: Add more information in description metadata

This commit is contained in:
hayden
2024-10-27 21:23:10 +08:00
parent 92c55e04fd
commit 86e587eba2

View File

@@ -182,9 +182,20 @@ class Civitai extends ModelSearch {
pathIndex: 0, pathIndex: 0,
description: [ description: [
'---', '---',
`website: Civitai`, ...[
``, `website: Civitai`,
`modelPage: https://civitai.com/models/${modelId}?modelVersionId=${version.id}`, `modelPage: https://civitai.com/models/${modelId}?modelVersionId=${version.id}`,
`author: ${resData.creator?.username}`,
version.baseModel && `baseModel: ${version.baseModel}`,
file.hashes && `hashes:`,
...Object.entries(file.hashes ?? {}).map(
([key, value]) => ` ${key}: ${value}`,
),
file.metadata && `metadata:`,
...Object.entries(file.metadata ?? {}).map(
([key, value]) => ` ${key}: ${value}`,
),
].filter(Boolean),
'---', '---',
'', '',
'# Trigger Words', '# Trigger Words',
@@ -279,9 +290,11 @@ class Huggingface extends ModelSearch {
pathIndex: 0, pathIndex: 0,
description: [ description: [
'---', '---',
`website: HuggingFace`, ...[
`author: ${resData.author}`, `website: HuggingFace`,
`modelPage: https://huggingface.co/${modelId}`, `modelPage: https://huggingface.co/${modelId}`,
`author: ${resData.author}`,
].filter(Boolean),
'---', '---',
'', '',
'# Trigger Words', '# Trigger Words',