Skip to content

feat(model-manager): add CivitAI LoRA trigger refresh#9138

Draft
AsuraAce wants to merge 2 commits intoinvoke-ai:mainfrom
AsuraAce:codex/civitai-lora-triggers
Draft

feat(model-manager): add CivitAI LoRA trigger refresh#9138
AsuraAce wants to merge 2 commits intoinvoke-ai:mainfrom
AsuraAce:codex/civitai-lora-triggers

Conversation

@AsuraAce
Copy link
Copy Markdown

@AsuraAce AsuraAce commented May 8, 2026

Summary

Feature: add CivitAI metadata support for LoRA trigger phrase refresh and install metadata enrichment.

This PR adds CivitAI as a metadata source alongside Hugging Face for LoRA installs and Model Manager trigger phrase refresh. CivitAI trainedWords are mapped into existing trigger_phrases, while custom user phrases are preserved. The refresh path stores a concrete CivitAI model-version source URL when metadata is resolved, including cases where CivitAI returns no trained words.

The frontend adds a LoRA-only refresh action in the Model Manager trigger phrase panel. Prompt insertion continues to use the existing Add Prompt Trigger UI.

Follow-up noted separately on the PR: consider adding CivitAI API key management in Settings so users do not need to edit YAML/config files manually.

View Screenshots image

Related Issues / Discussions

None linked.

QA Instructions

Validated locally with:

  • uv run --extra test pytest tests\backend\model_manager\model_metadata\test_civitai_metadata_fetch.py tests\app\routers\test_model_manager.py tests\app\services\model_install\test_model_install.py::test_civitai_download_url_metadata_fetch_failure_falls_back_to_direct_download tests\app\services\model_install\test_model_install.py::test_civitai_download_url_metadata_fetch_returns_metadata_files -q
  • uv run --extra test pytest tests\app\services\model_install\test_model_install.py -q
  • uv run --extra test pytest tests\app\routers\test_model_manager.py -q
  • uv run --extra test ruff check invokeai\backend\model_manager\metadata\fetch\civitai.py invokeai\app\api\routers\model_manager.py invokeai\app\services\model_install\model_install_default.py tests\backend\model_manager\model_metadata\test_civitai_metadata_fetch.py tests\app\routers\test_model_manager.py tests\app\services\model_install\test_model_install.py
  • pnpm --dir invokeai\frontend\web lint:tsc

Manual QA target:

  1. Open Model Manager.
  2. Select a LoRA model with a CivitAI source or resolvable model hash.
  3. Use the trigger phrase refresh action.
  4. Confirm trigger phrases are added/restored without removing custom phrases.
  5. Confirm Add Prompt Trigger still lists active LoRA trigger phrases.

Merge Plan

No special merge sequencing required. This PR does not include database migrations or model record schema migrations.

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
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions Bot added api python PRs that change python files backend PRs that change backend files services PRs that change app services frontend PRs that change frontend files python-tests PRs that change python tests labels May 8, 2026
@lstein lstein added the 6.14.x label May 9, 2026
@lstein lstein moved this to 6.14.x Theme: LIBRARY UPDATES in Invoke - Community Roadmap May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.14.x api backend PRs that change backend files frontend PRs that change frontend files python PRs that change python files python-tests PRs that change python tests services PRs that change app services

Projects

Status: 6.14.x Theme: LIBRARY UPDATES

Development

Successfully merging this pull request may close these issues.

3 participants