mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-01-14 07:48:00 -05:00
When installing a model, the previous, graceful logic would increment a suffix on the destination path until found a free path for the model. But because model file installation and record creation are not in a transaction, we could end up moving the file successfully and fail to create the record: - User attempts to install an already-installed model - Attempt to move the downloaded model from download tempdir to destination path - The path already exists - Add `_1` or similar to the path until we find a path that is free - Move the model - Create the model record - FK constraint violation bc we already have a model w/ that name, but the model file has already been moved into the invokeai dir. Closes #8416