Feat:(mm) model settings export metadata thumbnail#9188
Open
Pfannkuchensack wants to merge 4 commits into
Open
Feat:(mm) model settings export metadata thumbnail#9188Pfannkuchensack wants to merge 4 commits into
Pfannkuchensack wants to merge 4 commits into
Conversation
Export now includes name, description, source_url, and the cover image (encoded as a base64 data URL) alongside the existing default_settings, trigger_phrases, and cpu_only fields. On import, these are applied via the existing model update and image upload endpoints. This makes the exported file suitable for curating, sharing, or restoring a model's full configuration — not just its load-time settings.
Extract the pure logic (sanitizeFilename, isSafeUrl, isImageDataUrl, dataUrlToFile, buildExportData, fetchImageAsDataUrl, validateImportData) from the export/import button components into a shared modelSettingsIO module so it can be exercised directly. Add 32 unit tests covering happy paths, validation rejections (unsafe URLs, non-image cover_image, type mismatches), and edge cases like empty strings and base64 round-trips.
Add a short section to the user-facing models concept page covering the Export Settings / Import Settings buttons: what gets included in the JSON file (metadata, source URL, cover image as base64, default settings / trigger phrases / cpu_only), the use cases (backup, sharing, restore), and a caution that importing overwrites the target model's existing values.
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
Export now includes
name,description,source_url, and the cover image (encoded as a base64 data URL) alongside the existingdefault_settings,trigger_phrases, andcpu_onlyfields. On import, these are applied via the existing model update and image upload endpoints. This makes the exported file suitable for curating, sharing, or restoring a model's full configuration — not just its load-time settings.Related Issues / Discussions
Follow-up to #8872 (model settings export/import) and #8997 (editable
source_urlfield).QA Instructions
name,description,source_url, and acover_imagefield starting withdata:image/...;base64,.default_settings/trigger_phrases/cpu_onlystill apply correctly.http(s)://value insource_url→ import should reject with "Invalid settings file".cover_image→ import should reject with "Invalid settings file".cpu_only) → those fields appear in the "skipped" warning toast; everything else applies.Merge Plan
No special merge considerations — purely additive frontend changes, no backend / DB / schema changes. The export format remains backwards compatible: older files without the new fields still import correctly, and older clients reading newer files will just ignore the unknown keys.
Checklist
What's Newcopy (if doing a release after this PR)