Add option to scan loaded folder again

This commit is contained in:
blessedcoolant 2022-12-28 16:07:41 +13:00
parent 942f029a24
commit ad0b366e47
2 changed files with 17 additions and 0 deletions

View File

@ -34,6 +34,7 @@
"checkpointFolder": "Checkpoint Folder",
"clearCheckpointFolder": "Clear Checkpoint Folder",
"findModels": "Find Models",
"scanAgain": "Scan Again",
"modelsFound": "Models Found",
"selectFolder": "Select Folder",
"selected": "Selected",

View File

@ -26,6 +26,7 @@ import type { ReactNode, ChangeEvent } from 'react';
import type { FoundModel } from 'app/invokeai';
import IAIInput from 'common/components/IAIInput';
import { Field, Formik } from 'formik';
import { BiReset } from 'react-icons/bi';
const existingModelsSelector = createSelector([systemSelector], (system) => {
const { model_list } = system;
@ -130,6 +131,10 @@ export default function SearchModels() {
(state: RootState) => state.options.shouldShowExistingModelsInSearch
);
const isProcessing = useAppSelector(
(state: RootState) => state.system.isProcessing
);
const [modelsToAdd, setModelsToAdd] = React.useState<string[]>([]);
const resetSearchModelHandler = () => {
@ -243,6 +248,16 @@ export default function SearchModels() {
>
{searchFolder}
</p>
<IAIIconButton
aria-label={t('modelmanager:scanAgain')}
tooltip={t('modelmanager:scanAgain')}
icon={<BiReset />}
position={'absolute'}
right={16}
fontSize={18}
disabled={isProcessing}
onClick={() => dispatch(searchForModels(searchFolder))}
/>
<IAIIconButton
aria-label={t('modelmanager:clearCheckpointFolder')}
icon={<FaPlus style={{ transform: 'rotate(45deg)' }} />}
@ -277,6 +292,7 @@ export default function SearchModels() {
aria-label={t('modelmanager:findModels')}
tooltip={t('modelmanager:findModels')}
type="submit"
disabled={isProcessing}
/>
</HStack>
</form>