Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix corrupted outputs/.next_prefix file #3020

Merged
merged 2 commits into from
Mar 24, 2023

Conversation

lstein
Copy link
Collaborator

@lstein lstein commented Mar 24, 2023

  • Since 2.3.2 invokeai stores the next PNG file's numeric prefix in a file named .next_prefix in the outputs directory. This avoids the overhead of doing a directory listing to find out what file number comes next.

  • The code uses advisory locking to prevent corruption of this file in the event that multiple invokeai's try to access it simultaneously, but some users have experienced corruption of the file nevertheless.

  • This PR addresses the problem by detecting a potentially corrupted .next_prefix file and falling back to the directory listing method. A fixed version of the file is then written out.

  • Closes TypeError: expected str, bytes or os.PathLike object, not NoneType #3001

- Since 2.3.2 invokeai stores the next PNG file's numeric prefix in a
  file named `.next_prefix` in the outputs directory. This avoids the
  overhead of doing a directory listing to find out what file number
  comes next.

- The code uses advisory locking to prevent corruption of this file in
  the event that multiple invokeai's try to access it simultaneously,
  but some users have experienced corruption of the file nevertheless.

- This PR addresses the problem by detecting a potentially corrupted
  `.next_prefix` file and falling back to the directory listing method.
  A fixed version of the file is then written out.

- Closes #3001
@lstein lstein enabled auto-merge March 24, 2023 03:12
@lstein lstein merged commit 5f2a6f2 into v2.3 Mar 24, 2023
@lstein lstein deleted the bugfix/fix-corrupted-image-sequence-file branch March 24, 2023 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants