diff --git a/invokeai/frontend/web/public/locales/en.json b/invokeai/frontend/web/public/locales/en.json index 4a2e1d30d3..d287882967 100644 --- a/invokeai/frontend/web/public/locales/en.json +++ b/invokeai/frontend/web/public/locales/en.json @@ -763,7 +763,8 @@ "height": "Height", "heightValidationMsg": "Default height of your model.", "huggingFace": "Hugging Face", - "huggingFaceRepoID": "HuggingFace Repo ID", + "huggingFacePlaceholder": "owner/model-name", + "huggingFaceRepoID": "Hugging Face Repo ID", "ignoreMismatch": "Ignore Mismatches Between Selected Models", "imageEncoderModelId": "Image Encoder Model ID", "importModels": "Import Models", @@ -846,6 +847,7 @@ "scanFolder": "Scan folder", "scanAgain": "Scan Again", "scanForModels": "Scan For Models", + "scanPlaceholder": "Path to a local folder", "scanResults": "Scan Results", "search": "Search", "selectAll": "Select All", @@ -856,6 +858,7 @@ "settings": "Settings", "showExisting": "Show Existing", "sigmoid": "Sigmoid", + "simpleModelPlaceholder": "URL or path to a local file", "simpleModelDesc": "Provide a path to a local Diffusers model, local checkpoint / safetensors model a HuggingFace Repo ID, or a checkpoint/diffusers model URL.", "source": "Source", "statusConverting": "Converting", diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/HuggingFaceFolder/HuggingFaceForm.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/HuggingFaceFolder/HuggingFaceForm.tsx index 78313a8863..dd2817102e 100644 --- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/HuggingFaceFolder/HuggingFaceForm.tsx +++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/HuggingFaceFolder/HuggingFaceForm.tsx @@ -19,34 +19,37 @@ export const HuggingFaceForm = () => { const [_getHuggingFaceModels, { isLoading, data }] = useLazyGetHuggingFaceModelsQuery(); const [installModel] = useInstallModelMutation(); - const handleInstallModel = useCallback((source: string) => { - installModel({ source }) - .unwrap() - .then((_) => { - dispatch( - addToast( - makeToast({ - title: t('toast.modelAddedSimple'), - status: 'success', - }) - ) - ); - }) - .catch((error) => { - if (error) { + const handleInstallModel = useCallback( + (source: string) => { + installModel({ source }) + .unwrap() + .then((_) => { dispatch( addToast( makeToast({ - title: `${error.data.detail} `, - status: 'error', + title: t('toast.modelAddedSimple'), + status: 'success', }) ) ); - } - }); - }, [installModel, dispatch, t]); + }) + .catch((error) => { + if (error) { + dispatch( + addToast( + makeToast({ + title: `${error.data.detail} `, + status: 'error', + }) + ) + ); + } + }); + }, + [installModel, dispatch, t] + ); - const scanFolder = useCallback(async () => { + const getModels = useCallback(async () => { _getHuggingFaceModels(huggingFaceRepo) .then((response) => { if (response.data?.some((result) => result.endsWith('model_index.json'))) { @@ -64,7 +67,7 @@ export const HuggingFaceForm = () => { setErrorMessage(error.data.detail); } }); - }, [_getHuggingFaceModels, huggingFaceRepo]); + }, [_getHuggingFaceModels, handleInstallModel, huggingFaceRepo]); const handleSetHuggingFaceRepo: ChangeEventHandler = useCallback((e) => { setHuggingFaceRepo(e.target.value); @@ -78,10 +81,14 @@ export const HuggingFaceForm = () => { {t('modelManager.huggingFaceRepoID')} - + - diff --git a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/InstallModelForm.tsx b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/InstallModelForm.tsx index 1b8a665c8d..6f04444e37 100644 --- a/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/InstallModelForm.tsx +++ b/invokeai/frontend/web/src/features/modelManagerV2/subpanels/AddModelPanel/InstallModelForm.tsx @@ -68,7 +68,7 @@ export const InstallModelForm = () => { {t('modelManager.modelLocation')} - +