Skip to content

Commit c5b5195

Browse files
fix: Model Manager scan Auto Add not detecting checkpoint correctly (#3810)
## What type of PR is this? (check all applicable) - [ ] Refactor - [ ] Feature - [ ] Bug Fix - [ ] Optimization - [ ] Documentation Update ## Have you discussed this change with the InvokeAI team? - [ ] Yes - [ ] No, because: ## Description ## Related Tickets & Documents <!-- For pull requests that relate or close an issue, please include them below. For example having the text: "closes #1234" would connect the current pull request to issue 1234. And when we merge the pull request, Github will automatically close the issue. --> - Related Issue # - Closes # ## QA Instructions, Screenshots, Recordings <!-- Please provide steps on how to test changes, any hardware or software specifications as well as any other pertinent information. --> ## Added/updated tests? - [ ] Yes - [ ] No : _please replace this line with details on why tests have not been included_ ## [optional] Are there any post deployment tasks we need to perform?
2 parents f7de000 + d661bf8 commit c5b5195

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/AddModelsPanel/ScanAdvancedAddModels.tsx

+6-8
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,16 @@ export default function ScanAdvancedAddModels() {
1919
const [advancedAddMode, setAdvancedAddMode] =
2020
useState<ManualAddMode>('diffusers');
2121

22-
const [isCheckpoint, setIsCheckpoint] = useState(
23-
advancedAddScanModel &&
24-
['.ckpt', '.safetensors', '.pth', '.pt'].some((ext) =>
25-
advancedAddScanModel.endsWith(ext)
26-
)
27-
);
22+
const [isCheckpoint, setIsCheckpoint] = useState<boolean>(false);
2823

2924
useEffect(() => {
30-
isCheckpoint
25+
advancedAddScanModel &&
26+
['.ckpt', '.safetensors', '.pth', '.pt'].some((ext) =>
27+
advancedAddScanModel.endsWith(ext)
28+
)
3129
? setAdvancedAddMode('checkpoint')
3230
: setAdvancedAddMode('diffusers');
33-
}, [setAdvancedAddMode, isCheckpoint]);
31+
}, [advancedAddScanModel, setAdvancedAddMode]);
3432

3533
const dispatch = useAppDispatch();
3634

0 commit comments

Comments
 (0)