buzsh / SwiftDiffusion

SwiftUI Stable Diffusion implementation using CoreML and PyTorch
GNU General Public License v3.0
149 stars 3 forks source link

refactor: SwiftData ModelContext dependencies #79

Closed buzsh closed 4 months ago

buzsh commented 4 months ago

Important

Incompatibility notice: v0.1-beta.0 b1000 and earlier

Due to changes in the SwiftData model schema, this update will be incompatible with existing databases from v0.1-beta.0 (b1000) and earlier. In the future, I'll implement migration schemes for larger model transitions; however, given that the application is in active development, this would take too much time to do for each independent model transition.

previews - light

### Changes - Lots and lots and lots of stability improvements - Seriously, lots - Improved main thread priority processes - Reduced main thread processes to essential tasks - Improved background, asynchronous logic - Most processes should no longer stall on main - Still refactoring `@MainActor` logic for essential model interfaces - Fix rendering, lag issues on window active - Fix stutter issues with PyTorch processes - Fix invalid sampling method key in JSON payload - Improved local database model management - Non-optionals, non-deletables: `rootFolder`, `workspaceFolder` - `.parent` relationship attributes - `@relationship(deleteRule: .cascade)` - Improved SidebarItem management - Centralize SidebarModel logic - Fix item deletion logic in context - Additional handling logic for deletion (recursive delete ImageInfo, PromptModel, cache, etc.) - Improved Folder management - Centralize SidebarModel logic - Fix folder deletion logic in context - Recursive handling for embedded folders, items (queued for deletion) - Reworked Parse Generation Data logic from pasteboard - Asynchronous checks for valid tags - Parsing creates a new workspace item now instead of interfacing with PromptView directly - Improved copy, move logic - Add persisting "New Prompt", "New Folder" below each section - Fix Checkpoint Manager issues - Fix nil sheet view causing unclosable window - Fix deletion, presentation direct from model items - Alphabetical ordering of checkpoints - Fix LoRA menu appearing on load - Fix DetailView image double-split issue - Deselect selectedImage on default startup - Local Database improvements - Started deprecating initial setup style - `@Model item:` `@Attribute deterministicTag: Bool` → `@Attribute parent: Node` - `isWorkspaceItem` is now determined by `workspaceFolder.contains` - ie. `item.isWorkspaceItem` → `workspaceFolder.contains { item }` - `modelContext.delete(item: someItem)` → `parentFolder.remove(someItem)` - Fix macOS deployment target - Improved typesafe symbol management - Improved Civit.ai parsing logic - Prioritize hash model comparison - Non-mapped object interfacing - Separate utility class for PastableService interface - And lots more!