mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
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?
This commit is contained in:
@@ -19,18 +19,16 @@ export default function ScanAdvancedAddModels() {
|
||||
const [advancedAddMode, setAdvancedAddMode] =
|
||||
useState<ManualAddMode>('diffusers');
|
||||
|
||||
const [isCheckpoint, setIsCheckpoint] = useState(
|
||||
advancedAddScanModel &&
|
||||
['.ckpt', '.safetensors', '.pth', '.pt'].some((ext) =>
|
||||
advancedAddScanModel.endsWith(ext)
|
||||
)
|
||||
);
|
||||
const [isCheckpoint, setIsCheckpoint] = useState<boolean>(false);
|
||||
|
||||
useEffect(() => {
|
||||
isCheckpoint
|
||||
advancedAddScanModel &&
|
||||
['.ckpt', '.safetensors', '.pth', '.pt'].some((ext) =>
|
||||
advancedAddScanModel.endsWith(ext)
|
||||
)
|
||||
? setAdvancedAddMode('checkpoint')
|
||||
: setAdvancedAddMode('diffusers');
|
||||
}, [setAdvancedAddMode, isCheckpoint]);
|
||||
}, [advancedAddScanModel, setAdvancedAddMode]);
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user