diff --git a/.i18nrc.cjs b/.i18nrc.cjs index 53acf0546..14c958591 100644 --- a/.i18nrc.cjs +++ b/.i18nrc.cjs @@ -10,7 +10,7 @@ module.exports = defineConfig({ entryLocale: 'en', output: 'src/locales', outputLocales: ['zh', 'zh-TW', 'ru', 'ja', 'ko', 'fr', 'es', 'ar', 'tr', 'pt-BR'], - reference: `Special names to keep untranslated: flux, photomaker, clip, vae, cfg, stable audio, stable cascade, stable zero, controlnet, lora, HiDream. + reference: `Special names to keep untranslated: flux, photomaker, clip, vae, cfg, stable audio, stable cascade, stable zero, controlnet, lora, HiDream, Civitai, Hugging Face. 'latent' is the short form of 'latent space'. 'mask' is in the context of image processing. diff --git a/public/assets/images/hf-logo.svg b/public/assets/images/hf-logo.svg new file mode 100644 index 000000000..ab959d165 --- /dev/null +++ b/public/assets/images/hf-logo.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/composables/useFeatureFlags.ts b/src/composables/useFeatureFlags.ts index 4f2e65abd..697818c4e 100644 --- a/src/composables/useFeatureFlags.ts +++ b/src/composables/useFeatureFlags.ts @@ -13,7 +13,8 @@ export enum ServerFeatureFlag { MODEL_UPLOAD_BUTTON_ENABLED = 'model_upload_button_enabled', ASSET_UPDATE_OPTIONS_ENABLED = 'asset_update_options_enabled', PRIVATE_MODELS_ENABLED = 'private_models_enabled', - ONBOARDING_SURVEY_ENABLED = 'onboarding_survey_enabled' + ONBOARDING_SURVEY_ENABLED = 'onboarding_survey_enabled', + HUGGINGFACE_MODEL_IMPORT_ENABLED = 'huggingface_model_import_enabled' } /** @@ -62,6 +63,16 @@ export function useFeatureFlags() { remoteConfig.value.onboarding_survey_enabled ?? api.getServerFeature(ServerFeatureFlag.ONBOARDING_SURVEY_ENABLED, true) ) + }, + get huggingfaceModelImportEnabled() { + // Check remote config first (from /api/features), fall back to websocket feature flags + return ( + remoteConfig.value.huggingface_model_import_enabled ?? + api.getServerFeature( + ServerFeatureFlag.HUGGINGFACE_MODEL_IMPORT_ENABLED, + false + ) + ) } }) diff --git a/src/locales/en/main.json b/src/locales/en/main.json index 14e4a348d..0bdf5409b 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -2216,8 +2216,11 @@ "baseModels": "Base models", "browseAssets": "Browse Assets", "checkpoints": "Checkpoints", - "civitaiLinkExample": "Example: https://civitai.com/models/10706/luisap-z-image-and-qwen-pixel-art-refiner?modelVersionId=2225295", - "civitaiLinkLabel": "Civitai model download link", + "civitaiLinkExample": "{example} {link}", + "civitaiLinkExampleStrong": "Example:", + "civitaiLinkExampleUrl": "https://civitai.com/models/10706/luisap-z-image-and-qwen-pixel-art-refiner?modelVersionId=2225295", + "civitaiLinkLabel": "Civitai model {download} link", + "civitaiLinkLabelDownload": "download", "civitaiLinkPlaceholder": "Paste link here", "confirmModelDetails": "Confirm Model Details", "connectionError": "Please check your connection and try again", @@ -2235,8 +2238,11 @@ "filterBy": "Filter by", "findInLibrary": "Find it in the {type} section of the models library.", "finish": "Finish", + "genericLinkPlaceholder": "Paste link here", "jobId": "Job ID", "loadingModels": "Loading {type}...", + "maxFileSize": "Max file size: {size}", + "maxFileSizeValue": "1 GB", "modelAssociatedWithLink": "The model associated with the link you provided:", "modelName": "Model Name", "modelNamePlaceholder": "Enter a name for this model", @@ -2251,20 +2257,24 @@ "ownershipAll": "All", "ownershipMyModels": "My models", "ownershipPublicModels": "Public models", + "providerCivitai": "Civitai", + "providerHuggingFace": "Hugging Face", + "noValidSourceDetected": "No valid import source detected", "selectFrameworks": "Select Frameworks", "selectModelType": "Select model type", "selectProjects": "Select Projects", "sortAZ": "A-Z", "sortBy": "Sort by", + "sortingType": "Sorting Type", "sortPopular": "Popular", "sortRecent": "Recent", "sortZA": "Z-A", - "sortingType": "Sorting Type", "tags": "Tags", "tagsHelp": "Separate tags with commas", "tagsPlaceholder": "e.g., models, checkpoint", "tryAdjustingFilters": "Try adjusting your search or filters", "unknown": "Unknown", + "unsupportedUrlSource": "Only URLs from {sources} are supported", "upgradeFeatureDescription": "This feature is only available with Creator or Pro plans.", "upgradeToUnlockFeature": "Upgrade to unlock this feature", "upload": "Import", @@ -2272,10 +2282,15 @@ "uploadingModel": "Importing model...", "uploadModel": "Import", "uploadModelDescription1": "Paste a Civitai model download link to add it to your library.", - "uploadModelDescription2": "Only links from https://civitai.com/models are supported at the moment", - "uploadModelDescription3": "Max file size: 1 GB", + "uploadModelDescription1Generic": "Paste a model download link to add it to your library.", + "uploadModelDescription2": "Only links from {link} are supported at the moment", + "uploadModelDescription2Link": "https://civitai.com/models", + "uploadModelDescription2Generic": "Only URLs from the following providers are supported:", + "uploadModelDescription3": "Max file size: {size}", "uploadModelFailedToRetrieveMetadata": "Failed to retrieve metadata. Please check the link and try again.", "uploadModelFromCivitai": "Import a model from Civitai", + "uploadModelGeneric": "Import a model", + "uploadModelHelpFooterText": "Need help finding the URLs? Click on a provider below to see a how-to video.", "uploadModelHelpVideo": "Upload Model Help Video", "uploadModelHowDoIFindThis": "How do I find this?", "uploadSuccess": "Model imported successfully!", diff --git a/src/platform/assets/components/UploadModelDialog.vue b/src/platform/assets/components/UploadModelDialog.vue index 5d1e6cdde..d6be9e97e 100644 --- a/src/platform/assets/components/UploadModelDialog.vue +++ b/src/platform/assets/components/UploadModelDialog.vue @@ -4,7 +4,13 @@ > + @@ -46,14 +52,17 @@ diff --git a/src/platform/assets/components/UploadModelFooter.vue b/src/platform/assets/components/UploadModelFooter.vue index 82f597dd7..bca37c0cd 100644 --- a/src/platform/assets/components/UploadModelFooter.vue +++ b/src/platform/assets/components/UploadModelFooter.vue @@ -1,13 +1,33 @@