[backport cloud/1.37] feat: add Hugging Face model source support (#8331)

Backport of #8330 to `cloud/1.37`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8331-backport-cloud-1-37-feat-add-Hugging-Face-model-source-support-2f56d73d365081708413c99c384c0806)
by [Unito](https://www.unito.io)

Co-authored-by: Alexander Brown <drjkl@comfy.org>
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Comfy Org PR Bot
2026-01-27 14:19:01 +09:00
committed by GitHub
parent e751cf42a2
commit a5f50ac91b
2 changed files with 9 additions and 0 deletions

View File

@@ -50,6 +50,12 @@
alt=""
class="size-4 shrink-0"
/>
<img
v-else-if="sourceName === 'Hugging Face'"
src="/assets/images/hf-logo.svg"
alt=""
class="size-4 shrink-0"
/>
{{ t('assetBrowser.modelInfo.viewOnSource', { source: sourceName }) }}
<i class="icon-[lucide--external-link] size-4 shrink-0" />
</a>

View File

@@ -72,6 +72,9 @@ export function getAssetDisplayName(asset: AssetItem): string {
* @returns The source URL or null if not present/parseable
*/
export function getAssetSourceUrl(asset: AssetItem): string | null {
if (typeof asset.metadata?.repo_url === 'string') {
return asset.metadata.repo_url
}
// Note: Reversed priority for backwards compatibility
const sourceArn =
asset.metadata?.source_arn ?? asset.user_metadata?.source_arn