Skip to content

swiftui: write image records per docs/image-metadata.md and show them in the preview - #132

Merged
ling0322 merged 1 commit into
mainfrom
swiftui-image-record
Oct 16, 2026
Merged

ling0322 merged 1 commit into
mainfrom
swiftui-image-record

Conversation

@ling0322

Copy link
Copy Markdown
Owner

The macOS app now writes each picture's JSON record in the docs/image-metadata.md format (environment / request / result, new ImageRecord), reads it and the old Record back, and shows it in a column of the preview window. libwaifu gains waifu_version_json and waifu_engine_device, and the model manager's catalog JSON a versioned_name, for the fields only the libraries know. The preview's FitWindow is removed: the window opens at 1000×700 and resizes freely.

Also in the app

  • The big picture dims and shows an expand sign under the mouse, so it reads as clickable.
  • "Reuse these settings" restores the device the record names (not while a job runs; the device list is one Session.devices, used by DeviceCard too).
  • Speech and conversion keep the old Record; the format only covers pictures.

Notes

  • device is spelled as the doc spells it (cuda-cpu-offload, so metal-disk-offload), and is the device the engine resolved: auto is never written.
  • img2img writes inputs.start_from as the file it was read from; a pasted picture is copied to output/inputs/ first so there is a path to name.
  • The preview reads the record before its first frame; reading it after made the column arrive late and the picture jump. Letterboxing in the preview is accepted: shaping the window to the picture took more code than it was worth.
  • Not done: the PNG tEXt chunks, the library writing the record itself, CLI / webui / WPF.

Tests

./build/unittest, cargo test (waifu, waifu-modelmanager, waifu-cli), cargo build -p waifu-tools and swift test pass; cargo fmt --all is clean. New: ImageRecordTests (layout, null revision, read back) and WaifuKit tests for the version, the resolved device and versionedName. No model test suite covers the files touched.

🤖 Generated with Claude Code

…in the preview

The macOS app writes each picture's JSON record as docs/image-metadata.md lays it out
(environment / request / result), reads both it and the old Record back, and shows it in a
column of the preview window. libwaifu gains waifu_version_json and waifu_engine_device, and
the model manager's catalog a versioned_name, for the fields only they know.

Also: the big picture dims and shows an expand sign under the mouse; "Reuse these settings"
restores the device; the preview opens at 1000x700 and resizes freely, and FitWindow is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ling0322
ling0322 merged commit 9bf3853 into main Oct 16, 2026
2 of 3 checks passed
@ling0322
ling0322 deleted the swiftui-image-record branch October 24, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant