feat: add configurable image subfolder strategies#8969
Open
Pfannkuchensack wants to merge 7 commits intoinvoke-ai:mainfrom
Open
feat: add configurable image subfolder strategies#8969Pfannkuchensack wants to merge 7 commits intoinvoke-ai:mainfrom
Pfannkuchensack wants to merge 7 commits intoinvoke-ai:mainfrom
Conversation
Add support for organizing output images into subfolders instead of a single flat directory. Four strategies are available via the image_subfolder_strategy config setting: flat (default, current behavior), date (YYYY/MM/DD), type (by image category), and hash (UUID prefix for filesystem performance). The strategy can be changed at any time - existing images keep their paths, only new images use the new strategy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for organizing output images into subfolders instead of a single flat directory. Four strategies are available via the
image_subfolder_strategyconfig setting:flat(default): Current behavior, all images in one directorydate: Organized byYYYY/MM/DDtype: Organized by image category (general,intermediate,mask, etc.)hash: UUID prefix for filesystem performance (~256 evenly distributed subfolders)The strategy can be changed at any time — existing images keep their paths, only new images use the new strategy. This is achieved by storing each image's subfolder in a new
image_subfolderDB column.image_name(DB primary key) remains unchanged — no API or frontend changes neededimage_subfoldercolumn stores the relative path prefiximage_subfolder = ""(backward compatible, stays in root)QA Instructions
image_subfolder_strategy: flat) — verify images are saved tooutputs/images/as beforeimage_subfolder_strategy: dateininvokeai.yaml, restart, generate an image — verify it appears inoutputs/images/YYYY/MM/DD/image_subfolder_strategy: type, generate — verify images land inoutputs/images/general/(orintermediate/for intermediate images)image_subfolder_strategy: hash, generate — verify images land inoutputs/images/XX/(first 2 chars of UUID)flat— verify old subfolder images are still accessible in the galleryMerge Plan
4.0.2to4.0.3automaticallyChecklist
What's Newcopy (if doing a release after this PR)