Feature: Add Tag System for user made Workflows by Pfannkuchensack · Pull Request #8673 · invoke-ai/InvokeAI
Summary
This PR adds dynamic tag filtering for user workflows in the Workflow Library. Previously, only the "Browse Workflows" view (default workflows) had tag filtering with a fixed set of categories. Now, "Your Workflows" also supports tag filtering, with tags dynamically loaded from the user's actual workflow collection.
Changes:
Backend:
- Added new
GET /api/v1/workflows/tagsendpoint that returns all unique tags from workflows - Added
get_all_tags()method toWorkflowRecordsStorageBaseandSqliteWorkflowRecordsStorage - Tags are parsed from comma-separated strings stored in workflows
Frontend:
- Added
useGetAllTagsQueryhook for the new tags endpoint - Added
WorkflowTagscache tag for proper invalidation - Modified
WorkflowLibrarySideNavto show dynamic tags for "Your Workflows" view and static categories for "Browse Workflows" - Updated
WorkflowListto apply tag filtering for bothyoursanddefaultsviews - Added "Your Workflows" button with tag reset functionality (matching "Browse Workflows" behavior)
Related Issues / Discussions
Request from a discord user
QA Instructions
- Create several user workflows with different tags (comma-separated, e.g., "portrait, SDXL, upscaling")
- Open the Workflow Library
- Click "Your Workflows" - you should see all unique tags from your workflows listed with counts
- Select one or more tags - the workflow list should filter accordingly
- Verify the reset button appears and works when tags are selected
- Switch to "Browse Workflows" - verify the static tag categories still work as before
- Create/update/delete a workflow with tags - verify the tag list updates
Merge Plan
No special merge plan required. This is an additive feature with no breaking changes.
Checklist
- The PR has a short but descriptive title, suitable for a changelog
- Tests added / updated (if applicable)
- ❗Changes to a redux slice have a corresponding migration (no slice changes, only added new API endpoint)
- Documentation added / updated (if applicable)
- Updated
What's Newcopy (if doing a release after this PR)