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/tags endpoint that returns all unique tags from workflows
  • Added get_all_tags() method to WorkflowRecordsStorageBase and SqliteWorkflowRecordsStorage
  • Tags are parsed from comma-separated strings stored in workflows

Frontend:

  • Added useGetAllTagsQuery hook for the new tags endpoint
  • Added WorkflowTags cache tag for proper invalidation
  • Modified WorkflowLibrarySideNav to show dynamic tags for "Your Workflows" view and static categories for "Browse Workflows"
  • Updated WorkflowList to apply tag filtering for both yours and defaults views
  • Added "Your Workflows" button with tag reset functionality (matching "Browse Workflows" behavior)

Related Issues / Discussions

Request from a discord user

QA Instructions

  1. Create several user workflows with different tags (comma-separated, e.g., "portrait, SDXL, upscaling")
  2. Open the Workflow Library
  3. Click "Your Workflows" - you should see all unique tags from your workflows listed with counts
  4. Select one or more tags - the workflow list should filter accordingly
  5. Verify the reset button appears and works when tags are selected
  6. Switch to "Browse Workflows" - verify the static tag categories still work as before
  7. 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 New copy (if doing a release after this PR)