mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 06:44:32 +00:00
[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:
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user