diff --git a/.aiexclude b/.aiexclude new file mode 100644 index 00000000..559ee63b --- /dev/null +++ b/.aiexclude @@ -0,0 +1,30 @@ +# Docs +LICENSE +CHANGELOG.md + +# Legacy +StabilityMatrix/ + +# Tests +*.verified.* + +# Misc projects +StabilityMatrix.Native/ +StabilityMatrix.Native.*/ +StabilityMatrix.Avalonia.Diagnostics/ +StabilityMatrix.Avalonia.Diagnostics/ +StabilityMatrix.UITests/ + +# Vendored +Avalonia.Gif/ + +# Configs +*.editorconfig +*.DotSettings + +# Assets +*.svg +StabilityMatrix.Avalonia/Assets/Fonts/ +StabilityMatrix.Avalonia/Assets/linux-x64/ +StabilityMatrix.Avalonia/Assets/macos-arm64/ +StabilityMatrix.Avalonia/Assets/win-x64/ diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 2234f083..0e71c12c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "husky": { - "version": "0.6.0", + "version": "0.7.2", "commands": [ "husky" ], diff --git a/.husky/task-runner.json b/.husky/task-runner.json index c8c0d739..e7b83c92 100644 --- a/.husky/task-runner.json +++ b/.husky/task-runner.json @@ -19,6 +19,12 @@ "group": "generate-openapi", "command": "dotnet", "args": ["refitter", "--settings-file", "./StabilityMatrix.Core/Api/LykosAuthApi/.refitter"] + }, + { + "name": "Run refitter for PromptGenApi", + "group": "generate-promptgen-openapi", + "command": "dotnet", + "args": ["refitter", "--settings-file", "./StabilityMatrix.Core/Api/PromptGen/.refitter"] } ] } diff --git a/Avalonia.Gif/GifImage.cs b/Avalonia.Gif/GifImage.cs index 0ce8dca8..6d7b069a 100644 --- a/Avalonia.Gif/GifImage.cs +++ b/Avalonia.Gif/GifImage.cs @@ -18,30 +18,28 @@ public class GifImage : Control string >("SourceUriRaw"); - public static readonly StyledProperty SourceUriProperty = AvaloniaProperty.Register( - "SourceUri" - ); + public static readonly StyledProperty SourceUriProperty = AvaloniaProperty.Register< + GifImage, + Uri + >("SourceUri"); public static readonly StyledProperty SourceStreamProperty = AvaloniaProperty.Register< GifImage, Stream >("SourceStream"); - public static readonly StyledProperty IterationCountProperty = AvaloniaProperty.Register< - GifImage, - IterationCount - >("IterationCount", IterationCount.Infinite); + public static readonly StyledProperty IterationCountProperty = + AvaloniaProperty.Register("IterationCount", IterationCount.Infinite); private IGifInstance? _gifInstance; - public static readonly StyledProperty StretchDirectionProperty = AvaloniaProperty.Register< - GifImage, - StretchDirection - >("StretchDirection"); + public static readonly StyledProperty StretchDirectionProperty = + AvaloniaProperty.Register("StretchDirection"); - public static readonly StyledProperty StretchProperty = AvaloniaProperty.Register( - "Stretch" - ); + public static readonly StyledProperty StretchProperty = AvaloniaProperty.Register< + GifImage, + Stretch + >("Stretch"); private CompositionCustomVisual? _customVisual; @@ -288,10 +286,19 @@ e.NewValue is null private void UpdateGifInstance(object source) { _gifInstance?.Dispose(); - _gifInstance = new WebpInstance(source); - // _gifInstance = new GifInstance(source); - _gifInstance.IterationCount = IterationCount; - _customVisual?.SendHandlerMessage(_gifInstance); + + try + { + _gifInstance = new WebpInstance(source); + // _gifInstance = new GifInstance(source); + + _gifInstance.IterationCount = IterationCount; + _customVisual?.SendHandlerMessage(_gifInstance); + } + catch (Exception e) + { + Logger.Sink?.Log(LogEventLevel.Warning, "GifImage Update Source ", this, e.ToString()); + } } } } diff --git a/Avalonia.Gif/GifInstance.cs b/Avalonia.Gif/GifInstance.cs index 05b6b25e..ea2c33fd 100644 --- a/Avalonia.Gif/GifInstance.cs +++ b/Avalonia.Gif/GifInstance.cs @@ -8,6 +8,7 @@ using Avalonia.Gif.Decoding; using Avalonia.Media.Imaging; using Avalonia.Platform; +using SkiaSharp; namespace Avalonia.Gif { @@ -60,12 +61,20 @@ public GifInstance(Stream currentStream) _gifDecoder.Header.Dimensions.Height ); - _targetBitmap = new WriteableBitmap( - pixSize, - new Vector(96, 96), - PixelFormat.Bgra8888, - AlphaFormat.Opaque - ); + // Different on os: https://github.com/mono/SkiaSharp/issues/1492#issuecomment-689015409 + // ReSharper disable once SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault + var format = SKImageInfo.PlatformColorType switch + { + SKColorType.Bgra8888 => PixelFormat.Bgra8888, + SKColorType.Rgba8888 => PixelFormat.Rgba8888, + _ + => throw new NotSupportedException( + $"Unsupported color type: {SKImageInfo.PlatformColorType}" + ) + }; + + _targetBitmap = new WriteableBitmap(pixSize, new Vector(96, 96), format, AlphaFormat.Opaque); + GifPixelSize = pixSize; _totalTime = TimeSpan.Zero; diff --git a/Avalonia.Gif/WebpInstance.cs b/Avalonia.Gif/WebpInstance.cs index 8ac596f3..4777a4e0 100644 --- a/Avalonia.Gif/WebpInstance.cs +++ b/Avalonia.Gif/WebpInstance.cs @@ -54,12 +54,17 @@ public WebpInstance(Stream currentStream) var pixSize = new PixelSize(_codec.Info.Width, _codec.Info.Height); - _targetBitmap = new WriteableBitmap( - pixSize, - new Vector(96, 96), - PixelFormat.Bgra8888, - AlphaFormat.Opaque - ); + // Different on os: https://github.com/mono/SkiaSharp/issues/1492#issuecomment-689015409 + // ReSharper disable once SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault + var format = SKImageInfo.PlatformColorType switch + { + SKColorType.Bgra8888 => PixelFormat.Bgra8888, + SKColorType.Rgba8888 => PixelFormat.Rgba8888, + _ => throw new NotSupportedException($"Unsupported color type: {SKImageInfo.PlatformColorType}") + }; + + _targetBitmap = new WriteableBitmap(pixSize, new Vector(96, 96), format, AlphaFormat.Opaque); + GifPixelSize = pixSize; _totalTime = TimeSpan.Zero; @@ -121,9 +126,18 @@ private static Stream GetStreamFromUri(Uri uri) if (!uriString.StartsWith("resm") && !uriString.StartsWith("avares")) { - return new FileStream(uriString, FileMode.Open, FileAccess.Read); + // Local file + using var fs = new FileStream(uriString, FileMode.Open, FileAccess.Read); + + // Copy to memory stream then return + var memoryStream = new MemoryStream(); + fs.CopyTo(memoryStream); + memoryStream.Seek(0, SeekOrigin.Begin); + + return memoryStream; } + // Internal Avalonia resources return AssetLoader.Open(uri); } diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c7d9346..27454c4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,233 @@ All notable changes to Stability Matrix will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). - + +## v2.14.0 +### Added +#### New Packages & Integrations +- Added new package - [Stable Diffusion WebUI AMDGPU Forge](https://github.com/lshqqytiger/stable-diffusion-webui-amdgpu-forge) +- Added new package - [Stable Diffusion WebUI Forge - Classic](https://github.com/Haoming02/sd-webui-forge-classic) +- Added new Package Command (in the 3-dots menu) for installing Triton & SageAttention in ComfyUI +#### Inference Features +- Added Prompt Amplifier to Inference - click the magic wand 🪄 in the prompt editor to expand and enrich your ideas. Tailor the vibe with the ‘Feel’ selector and watch as your generations come to life with extra detail, coherence, and flair! +- Added support for HiDream in Inference - see [ComfyUI Examples](https://comfyanonymous.github.io/ComfyUI_examples/hidream/) for more details +- Added toggle for filtering Inference Extra Networks by base model +- Added Rescale CFG addon to Inference +- Added Swap Dimensions button between the width/height input in Inference +- Added Ctrl+Tab/Ctrl+Shift+Tab shortcuts for navigating between Inference tabs +- Added Align Your Steps scheduler to Inference +- Added wildcards to Inference prompts, e.g. `{blue|green|red}` will randomly select one of the colors +- Added Wan 2.1 Text to Video and Text to Image project types for Inference +- Added new autocomplete tag source to Inference - [Danbooru/e621 merged tags](https://civitai.com/models/950325?modelVersionId=1419692) +- Added Abstract Syntax Tree (AST) parsing for Inference prompts. This provides a more robust internal understanding of prompt structure, paving the way for future enhancements. +- Added hotkey (`Ctrl+Up`/`Ctrl+Down`) in Inference prompt editors to adjust the weight emphasis of the token under the caret or the currently selected text. + - This automatically wraps the token/selection in parentheses `()` if it's not already weighted. + - It modifies existing weights within parentheses or adds weights if none exist (e.g. `(word:1.1)`). + - Handles selection spanning multiple tokens intelligently. +- Added Plasma Noise addon to Inference for text to image workflows +#### Model Management & Discovery +- Added Accelerated Model Discovery (Beta) (⚡ icon in Civitai Browser) for Insider+ supporters. Utilizes an optimized connection for dramatically faster, more responsive browsing of online model repositories. +- Added OpenModelDB tab to the Model Browser +- Added Wan 2.1 files to the HuggingFace model browser +#### User Interface & Experience (UI/UX) +- Added Undo/Redo commands to text editor context menus +#### Internal / Developer Changes +- (Internal) Introduced unified strategy pattern (`IConfigSharingStrategy`) to for handling different config file formats (JSON, YAML, FDS). + - Added support for configuring nested paths in JSON and YAML files (e.g. `paths.models.vae`) via dot-notation in `SharedFolderLayoutRule.ConfigDocumentPaths`. + - Packages can now use the `SharedFolderLayout` property to define a `ConfigFileType` and `ConfigSharingOptions` (like `RootKey`), without needing to implement custom configuration logic. + +### Changed +#### Inference Features +- Improved the quality of Inference inpainting by upgrading the workflow behind the scenes. The workflow remains the same for you — just better results! +- FaceDetailers in Inference will now inherit the primary sampler/scheduler/etc. by default. You can still manually set these by enabling the options via the ⚙️ button on the FaceDetailer card +- Slightly rearranged the FaceDetailer card layout due to the above change +- Inference "Extra Networks" selector now filters extra networks based on the selected base model +- Merged Inference GGUF workflows into the UNet model loader option (no longer need to choose GGUF separately) +#### Model Management & Discovery +- Changed the names of some of the shared model folders to better reflect their contents +- Improved Checkpoint Manager memory usage (thanks to @FireGeek for the profiling assistance!) +- Performance optimizations for Checkpoint Manager (progress indicators now fully uses Compiled Bindings) +#### Package Management & Compatibility +- Upgraded HIP SDK installs to 6.2.4 for ComfyUI-Zluda and AMDGPU-Forge +- Updated install for kohya_ss to support RTX 5000-series GPUs +#### User Interface & Experience (UI/UX) +- Improved window state handling +- Updated some date strings to take into account the user's locale +#### Localization +- Updated Japanese, Brazilian Portuguese, Chinese, and Russian translations +#### Internal / Developer Changes +- (Internal) Upgraded FluentAvalonia to 2.3.0 +- (Internal) Refactored configuration-based shared folder logic: Centralized handling into `SharedFoldersConfigHelper` and format-specific strategies, removing custom file I/O logic from individual package classes for improved consistency and maintainability. + - Migrated packages ComfyUI (incl. Zluda), VladAutomatic (SD.Next), Sdfx, and StableSwarm to use the unified system for configuration and symlink based sharing. + +### Fixed +#### Installation, Compatibility & Core Functionality +- Fixed RTX 5000-series GPU detection in certain cases +- Fixed Package Updates and Change Version not using stored PyTorch index and instead using the default recommended index. +- Fixed ComfyUI-Zluda not being recognized as an option for Inference or SwarmUI (for real this time) +- Fixed errors from invalid pip specifiers in requirements files +#### User Interface & Experience (UI/UX) +- Fixed Image Viewer animation loader keeping file handles open, which resolves 2 different issues (OSes are fun): + - (macOS) Fixed `FileNotFoundException` crash when navigating to Inference tab after deleting a Webp animation file previously opened in the Image Viewer Dialog. + - (Windows) Fixed Webp animation files unable to be deleted without closing the app first. +- Fixed Image Viewer `FileNotFoundException` on fetching image size, if navigating to a deleted image file. +- (macOS) Fixed Webp / Gif animations RGB colors flipped. +- Fixed window disappearing on macOS when the saved window size is very small +- Fixed large white boxes appearing when tooltips are visible on macOS/Linux +- Fixed package images sometimes showing as blank due to concurrent image caching. Requests to same image resources are now de-duplicated +- Reduced memory usage from `ShowDisabledTooltipExtension` +#### Inference & Workflows +- Fixed some cases of missing custom nodes in SwarmUI +- Fixed Inference ControlNet Preprocessors using incorrect resolution and increased maximum of smallest dimension to 16384 +- Fixed Inference Extra Networks card not allowing for more than one model at a time +#### Model Management & Discovery +- Fixed missing base model options in the Metadata Editor +- Fixed some crashes when using Accelerated Model Discovery +### Supporters +#### Visionaries +Our heartfelt gratitude goes out to our amazing Visionary-tier Patrons: **Waterclouds**, **Corey T**, **bluepopsicle**, **Bob S**, **Akiro_Senkai**, and **Ibixat**! Your exceptional support is fundamental to the ongoing development and success of Stability Matrix. We are immensely grateful for your partnership and belief in the project! 🙏 +#### Pioneers +We also want to give a huge thank you to our dedicated Pioneer-tier Patrons: **tankfox**, **Mr. Unknown**, **Szir777**, **Tigon**, **NowFallenAngel**, **Al Gorithm**, and welcome to our newest Pioneer, **Noah M.**! Your consistent support and enthusiasm keep the momentum going. Thank you all for being such an important part of our community! ✨ + +## v2.14.0-pre.2 +### Added +- Added new package - [Stable Diffusion WebUI Forge - Classic](https://github.com/Haoming02/sd-webui-forge-classic) +- Added Accelerated Model Discovery (Beta) (⚡ icon in Civitai Browser) for Insider+ supporters. Utilizes an optimized connection for dramatically faster, more responsive browsing of online model repositories. +- Added Undo/Redo commands to text editor context menus +- Added Prompt Amplifier to Inference - click the magic wand 🪄 in the prompt editor to expand and enrich your ideas. Tailor the vibe with the ‘Feel’ selector and watch as your generations come to life with extra detail, coherence, and flair! +- (pre.2 re-release) Added support for HiDream in Inference - see [ComfyUI Examples](https://comfyanonymous.github.io/ComfyUI_examples/hidream/) for more details +- (pre.2 re-release) Added toggle for filtering Inference Extra Networks by base model +### Changed +- Updated install for kohya_ss to support RTX 5000-series GPUs +- (pre.2 re-release) Merged Inference GGUF workflows into the UNet model loader option (no longer need to choose GGUF separately) +- (pre.2 re-release) Updated some date strings to take into account the user's locale +- (pre.2 re-release) Fixed some crashes when using Accelerated Model Discovery +- (pre.2 re-release) Performance optimizations for Checkpoint Manager (progress indicators now fully uses Compiled Bindings) +### Fixed +- Fixed Inference ControlNet Preprocessors using incorrect resolution and increased maximum of smallest dimension to 16384 +- Fixed Triton/Sage install option showing for incompatible GPUs +- Fixed errors from invalid pip specifiers in requirements files +- Fixed package images sometimes showing as blank due to concurrent image caching. Requests to same image resources are now de-duplicated +- (pre.2 re-release) Fixed Inference Extra Networks card not allowing for more than one model at a time +- (pre.2 re-release) Reduced memory usage from `ShowDisabledTooltipExtension` +### Supporters +#### Visionaries +- Big shout-out to our Visionary-tier patrons: Waterclouds, Corey T, bluepopsicle, and Bob S! Your steadfast support keeps Stability Matrix moving forward, and we couldn’t do it without you. 🚀 Thank you! + +## v2.14.0-pre.1 +### Added +- Added new Package Command (in the 3-dots menu) for installing Triton & SageAttention in ComfyUI +- Added Abstract Syntax Tree (AST) parsing for Inference prompts. This provides a more robust internal understanding of prompt structure, paving the way for future enhancements. +- Added hotkey (`Ctrl+Up`/`Ctrl+Down`) in Inference prompt editors to adjust the weight emphasis of the token under the caret or the currently selected text. + - This automatically wraps the token/selection in parentheses `()` if it's not already weighted. + - It modifies existing weights within parentheses or adds weights if none exist (e.g. `(word:1.1)`). + - Handles selection spanning multiple tokens intelligently. +- Added Plasma Noise addon to Inference for text to image workflows +- (Internal) Introduced unified strategy pattern (`IConfigSharingStrategy`) to for handling different config file formats (JSON, YAML, FDS). + - Added support for configuring nested paths in JSON and YAML files (e.g. `paths.models.vae`) via dot-notation in `SharedFolderLayoutRule.ConfigDocumentPaths`. + - Packages can now use the `SharedFolderLayout` property to define a `ConfigFileType` and `ConfigSharingOptions` (like `RootKey`), without needing to implement custom configuration logic. +### Changed +- Changed the names of some of the shared model folders to better reflect their contents +- Improved window state handling +- Improved Checkpoint Manager memory usage (thanks to @FireGeek for the profiling assistance!) +- Upgraded HIP SDK installs to 6.2.4 for ComfyUI-Zluda and AMDGPU-Forge +- (Internal) Upgraded FluentAvalonia to 2.3.0 +- (Internal) Refactored configuration-based shared folder logic: Centralized handling into `SharedFoldersConfigHelper` and format-specific strategies, removing custom file I/O logic from individual package classes for improved consistency and maintainability. + - Migrated packages ComfyUI (incl. Zluda), VladAutomatic (SD.Next), Sdfx, and StableSwarm to use the unified system for configuration and symlink based sharing. +### Fixed +- Fixed RTX 5000-series GPU detection in certain cases +- Fixed Image Viewer animation loader keeping file handles open, which resolves 2 different issues (OSes are fun): + - (macOS) Fixed `FileNotFoundException` crash when navigating to Inference tab after deleting a Webp animation file previously opened in the Image Viewer Dialog. + - (Windows) Fixed Webp animation files unable to be deleted without closing the app first. +- Fixed Image Viewer `FileNotFoundException` on fetching image size, if navigating to a deleted image file. +- (macOS) Fixed Webp / Gif animations RGB colors flipped. +- Fixed Package Updates and Change Version not using stored PyTorch index and instead using the default recommended index. +- Fixed some cases of missing custom nodes in SwarmUI +- Fixed window disappearing on macOS when the saved window size is very small +- Fixed ComfyUI-Zluda not being recognized as an option for Inference or SwarmUI (for real this time) +- Fixed missing base model options in the Metadata Editor +- Fixed large white boxes appearing when tooltips are visible on macOS/Linux +### Supporters +#### Visionaries +- A special shout-out to our fantastic Visionary-tier Patreon supporters: Waterclouds, Corey T, and our newest Visionaries, bluepopsicle and Bob S! Your continued generosity powers the future of Stability Matrix—thank you so much! + +## v2.14.0-dev.3 +### Added +- Added Wan 2.1 Text to Video and Text to Image project types for Inference +- Added Wan 2.1 files to the HuggingFace model browser +- Added new package - [Stable Diffusion WebUI AMDGPU Forge](https://github.com/lshqqytiger/stable-diffusion-webui-amdgpu-forge) +- Added support for RTX 5000-series GPUs in ComfyUI, Forge, and reForge +- Added "Rebuild .NET Project" command to SwarmUI installs - available via the 3-dots menu -> Package Commands -> Rebuild .NET Project +- Added new autocomplete tag source to Inference - [Danbooru/e621 merged tags](https://civitai.com/models/950325?modelVersionId=1419692) +### Changed +- Upgraded ComfyUI CUDA torch to 12.6 +- Upgraded Lykos account connection to use OAuth 2.0 device flow +- (Internal) Updated Avalonia to 11.2.5 +### Fixed +- Fixed [#1128](https://github.com/LykosAI/StabilityMatrix/issues/1128) - overwriting models when downloading multiple with the same name +- Fixed ROCm torch indexes for ComfyUI & Forge +- Fixed model browser sometimes downloading to `ModelsLora` or `ModelsStableDiffusion` folders instead of the correct folder +- Fixed incorrect Unet folder path for ComfyUI users on Linux/macOS +- Fixed [#1157](https://github.com/LykosAI/StabilityMatrix/issues/1157) - crash when broken symlinks exist in model directories +- Fixed [#1154](https://github.com/LykosAI/StabilityMatrix/issues/1154) - increased width for package name on the package cards +- Fixed ComfyUI-Zluda not being recognized as an option for Inference or SwarmUI +- Fixed SwarmUI showing Python options in the 3-dots menu +- Fixed SD.Next install failures in certain cases when using Zluda +### Supporters +#### Visionaries +- Many thanks to our amazing Visionary-tier Patreon supporters, **Waterclouds**, **TheTekknician**, and **Corey T**! Your unwavering support is very much appreciated! + +## v2.14.0-dev.2 +### Added +- Added Align Your Steps scheduler to Inference +- Added wildcards to Inference prompts, e.g. `{blue|green|red}` will randomly select one of the colors +- Added Safetensor Metadata viewer to the Checkpoint Manager context menu - thanks to @genteure! +### Changed +- Updated the Civitai Model Browser base model selector to match the new Checkpoint Manager filter UI +- FaceDetailers in Inference will now inherit the primary sampler/scheduler/etc. by default. You can still manually set these by enabling the options via the ⚙️ button on the FaceDetailer card +- Slightly rearranged the FaceDetailer card layout due to the above change +- "Remove symbolic links on shutdown" option now also removes links from Output Sharing +- Inference "Extra Networks" selector now filters extra networks based on the selected base model +- Updated Japanese, Brazilian Portuguese, Chinese, and Russian translations +### Fixed +- Fixed crash when dragging & dropping images in Inference (hopefully) +- Fixed HiresFix Inference addon not inheriting sampler/scheduler properly +- Fixed some plus (+) buttons getting cut off in the Inference UI +- Fixed CFG Rescale addon interfering with refiner model in Inference +- Fixed [#1083](https://github.com/LykosAI/StabilityMatrix/issues/1083) - "Show Nested Models" incorrectly displaying models from some non-nested folders +- Fixed issue with InvokeAI model sharing when the host address is set to 0.0.0.0 +- Fixed issue when parsing index URLs in Python Dependencies Override menu +- Fixed ComfyUI-Zluda not respecting pip user overrides +- Fixed issue with Checkpoint Manager not displaying any models +- (dev.2 re-release) Fixed autocomplete not showing in certain cases when using wildcards +- (dev.2 re-release) Fixed package restart button not working +- (dev.2 re-release) Fixed [#1120](https://github.com/LykosAI/StabilityMatrix/issues/1120) - crash when right clicking in the console after restarting a package +### Supporters +#### Visionaries +- A huge thank you to our incredible Visionary-tier Patreon supporters, **Waterclouds**, **TheTekknician**, and our newest Visionary, **Corey**! Your generous support is greatly appreciated! + +## v2.14.0-dev.1 +### Added +- Added Rescale CFG addon to Inference +- Added Swap Dimensions button between the width/height input in Inference +- Added Ctrl+Tab/Ctrl+Shift+Tab shortcuts for navigating between Inference tabs +- Added OpenModelDB tab to the Model Browser +### Changed +- Improved the quality of Inference inpainting by upgrading the workflow behind the scenes. The workflow remains the same for you — just better results! +- Redesigned the Checkpoint Manager Filter flyout to include more options and improve the layout +- "Clear All" button will now remain at the top of the Downloads list regardless of scroll position - thanks to @Genteure! +- Improved image metadata parsing - thanks to @Genteure! +### Fixed +- Fixed Inference image selector card buttons taking up the whole height of the card +- Fixed Inference mask editor failing to paint to the right-most edge on large images +- Fixed Inference mask editor not showing the entire image in certain circumstances +- Fixed an issue where certain sampler/scheduler combos would not get saved in image metadata - thanks to @yansigit! +- Fixed [#1078](https://github.com/LykosAI/StabilityMatrix/issues/1078) - "Call from invalid thread" error after one-click install finishes +- Fixed [#1080](https://github.com/LykosAI/StabilityMatrix/issues/1080) - Some models not displayed in Checkpoint Manager +### Supporters +#### Visionaries +- Many thanks to our incredible Visionary-tier Patreon supporters, **Waterclouds** and **TheTekknician**! Your support helps us continue to improve Stability Matrix! + ## v2.13.4 ### Added - Added support for RTX 5000-series GPUs in ComfyUI, Forge, and reForge diff --git a/Directory.Build.props b/Directory.Build.props index bde27a37..2d898637 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,6 +5,7 @@ enable true true + CS0108 diff --git a/Directory.Packages.props b/Directory.Packages.props index f2f2e7d3..0a827eb4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,5 +1,9 @@ + + + + @@ -64,6 +68,7 @@ + @@ -105,7 +110,7 @@ - + diff --git a/README.md b/README.md index acafbc9a..a245b402 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ [fluxgym]: https://github.com/cocktailpeanut/fluxgym [cogvideo]: https://github.com/THUDM/CogVideo [cogstudio]: https://github.com/pinokiofactory/cogstudio +[amdforge]: https://github.com/lshqqytiger/stable-diffusion-webui-amdgpu-forge [civitai]: https://civitai.com/ [huggingface]: https://huggingface.co/ @@ -50,7 +51,7 @@ Multi-Platform Package Manager and Inference UI for Stable Diffusion ### 🖱️ One click install and update for Stable Diffusion Web UI Packages - Supports: - - [Stable Diffusion WebUI reForge][reforge], [Stable Diffusion WebUI Forge][forge], [Automatic 1111][auto1111], [Automatic 1111 DirectML][auto1111-directml], [SD Web UI-UX][webui-ux], [SD.Next][sdnext] + - [Stable Diffusion WebUI reForge][reforge], [Stable Diffusion WebUI Forge][forge], [Stable Diffusion WebUI AMDGPU Forge][amdforge] [Automatic 1111][auto1111], [Automatic 1111 DirectML][auto1111-directml], [SD Web UI-UX][webui-ux], [SD.Next][sdnext] - [Fooocus][fooocus], [Fooocus MRE][fooocus-mre], [Fooocus ControlNet SDXL][fooocus-controlnet], [Ruined Fooocus][ruined-fooocus], [Fooocus - mashb1t's 1-Up Edition][fooocus-mashb1t], [SimpleSDXL][simplesdxl] - [ComfyUI][comfy] - [StableSwarmUI][stable-swarm] diff --git a/StabilityMatrix.Avalonia/App.axaml b/StabilityMatrix.Avalonia/App.axaml index bbe5bbd2..b3c215bc 100644 --- a/StabilityMatrix.Avalonia/App.axaml +++ b/StabilityMatrix.Avalonia/App.axaml @@ -5,6 +5,7 @@ xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:labs="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls" xmlns:local="using:StabilityMatrix.Avalonia" + xmlns:styles="clr-namespace:StabilityMatrix.Avalonia.Styles" xmlns:styling="clr-namespace:FluentAvalonia.Styling;assembly=FluentAvalonia" Name="Stability Matrix" RequestedThemeVariant="Dark"> @@ -24,13 +25,12 @@ - - - + + @@ -45,6 +45,7 @@ + + + + + \ No newline at end of file diff --git a/StabilityMatrix.Avalonia/Controls/Inference/PlasmaNoiseCard.axaml.cs b/StabilityMatrix.Avalonia/Controls/Inference/PlasmaNoiseCard.axaml.cs new file mode 100644 index 00000000..bb713649 --- /dev/null +++ b/StabilityMatrix.Avalonia/Controls/Inference/PlasmaNoiseCard.axaml.cs @@ -0,0 +1,6 @@ +using Injectio.Attributes; + +namespace StabilityMatrix.Avalonia.Controls; + +[RegisterTransient] +public partial class PlasmaNoiseCard : TemplatedControlBase { } diff --git a/StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml b/StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml index 1e8359da..df5f2646 100644 --- a/StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml +++ b/StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml @@ -1,15 +1,17 @@  @@ -21,9 +23,11 @@ - + - + - - + IsOpen="{Binding IsHelpButtonTeachingTipOpen, Mode=TwoWay}" + Target="{Binding #PART_HelpButton}" /> - + + + + + + + + + + + + + + + + + + + + + + #ff822d + #ff822d + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StabilityMatrix.Avalonia/Styles/ControlThemes/LabelStyles.Dark.axaml b/StabilityMatrix.Avalonia/Styles/ControlThemes/LabelStyles.Dark.axaml new file mode 100644 index 00000000..9150bf4f --- /dev/null +++ b/StabilityMatrix.Avalonia/Styles/ControlThemes/LabelStyles.Dark.axaml @@ -0,0 +1,148 @@ + + + + 0.3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StabilityMatrix.Avalonia/Styles/ControlThemes/LabelStyles.axaml b/StabilityMatrix.Avalonia/Styles/ControlThemes/LabelStyles.axaml new file mode 100644 index 00000000..c05c4ca9 --- /dev/null +++ b/StabilityMatrix.Avalonia/Styles/ControlThemes/LabelStyles.axaml @@ -0,0 +1,421 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 8 2 + 8 4 + 20 + 24 + 12 + 3 + 9999 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StabilityMatrix.Avalonia/Styles/ControlThemes/_index.axaml b/StabilityMatrix.Avalonia/Styles/ControlThemes/_index.axaml new file mode 100644 index 00000000..723dceaf --- /dev/null +++ b/StabilityMatrix.Avalonia/Styles/ControlThemes/_index.axaml @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/StabilityMatrix.Avalonia/Styles/SemiStyles.axaml b/StabilityMatrix.Avalonia/Styles/SemiStyles.axaml new file mode 100644 index 00000000..efcc7a3e --- /dev/null +++ b/StabilityMatrix.Avalonia/Styles/SemiStyles.axaml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StabilityMatrix.Avalonia/Styles/SemiStyles.axaml.cs b/StabilityMatrix.Avalonia/Styles/SemiStyles.axaml.cs new file mode 100644 index 00000000..b68b045f --- /dev/null +++ b/StabilityMatrix.Avalonia/Styles/SemiStyles.axaml.cs @@ -0,0 +1,12 @@ +using System; +using Avalonia.Markup.Xaml; + +namespace StabilityMatrix.Avalonia.Styles; + +public partial class SemiStyles : global::Avalonia.Styling.Styles +{ + public SemiStyles(IServiceProvider? provider = null) + { + AvaloniaXamlLoader.Load(provider, this); + } +} diff --git a/StabilityMatrix.Avalonia/Styles/ToggleButtonStyles.axaml b/StabilityMatrix.Avalonia/Styles/ToggleButtonStyles.axaml index 9956dafb..5713b774 100644 --- a/StabilityMatrix.Avalonia/Styles/ToggleButtonStyles.axaml +++ b/StabilityMatrix.Avalonia/Styles/ToggleButtonStyles.axaml @@ -1,23 +1,59 @@ - + - - - - - - - - - + + + + + + + + + - + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + - - + + - - + + + + + + + + + + ToolTip.Tip="{Binding Tooltip}"> @@ -469,7 +489,7 @@ Command="{Binding CopyModelUrlCommand}" IconSource="Clipboard" IsVisible="{Binding CheckpointFile.HasConnectedModel}" - Text="Copy Link to Clipboard" /> + Text="{x:Static lang:Resources.Label_CopyLinkToClipboard}" /> - + - + + + + + + + + + + + + + + + + + + - + + + + + @@ -501,19 +561,62 @@ Grid.Column="3" Margin="4,8,4,0" Content="{x:Static lang:Resources.Label_BaseModel}" /> - - - - - - - + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + VerticalContentAlignment="Center" + BorderBrush="{DynamicResource ComboBoxBorderBrush}" + BorderThickness="1"> + + + + + + + + + + + + + + + { + AcceleratorButtonTeachingTip.IsOpen ^= true; + }; } private void ScrollViewer_OnScrollChanged(object? sender, ScrollChangedEventArgs e) diff --git a/StabilityMatrix.Avalonia/Views/Dialogs/ModelMetadataEditorDialog.axaml b/StabilityMatrix.Avalonia/Views/Dialogs/ModelMetadataEditorDialog.axaml index b6bdf985..902b27a8 100644 --- a/StabilityMatrix.Avalonia/Views/Dialogs/ModelMetadataEditorDialog.axaml +++ b/StabilityMatrix.Avalonia/Views/Dialogs/ModelMetadataEditorDialog.axaml @@ -1,103 +1,189 @@ - + - + - - + + - - + + - - - - + + - - + - - + + - - + + - - + + - - + + + + + - + - - + + - - - + + + - diff --git a/StabilityMatrix.Avalonia/Views/Dialogs/OpenModelDbModelDetailsDialog.axaml b/StabilityMatrix.Avalonia/Views/Dialogs/OpenModelDbModelDetailsDialog.axaml new file mode 100644 index 00000000..6b6b9ff9 --- /dev/null +++ b/StabilityMatrix.Avalonia/Views/Dialogs/OpenModelDbModelDetailsDialog.axaml @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + diff --git a/StabilityMatrix.Avalonia/Views/InferencePage.axaml.cs b/StabilityMatrix.Avalonia/Views/InferencePage.axaml.cs index 1885146d..0a6dc099 100644 --- a/StabilityMatrix.Avalonia/Views/InferencePage.axaml.cs +++ b/StabilityMatrix.Avalonia/Views/InferencePage.axaml.cs @@ -61,4 +61,14 @@ private void AddTabMenu_ImgToVideo_OnClick(object? sender, RoutedEventArgs e) { (DataContext as InferenceViewModel)!.AddTabCommand.Execute(InferenceProjectType.ImageToVideo); } + + private void AddTabMenu_WanTextToVideo_OnClick(object? sender, RoutedEventArgs e) + { + (DataContext as InferenceViewModel)!.AddTabCommand.Execute(InferenceProjectType.WanTextToVideo); + } + + private void AddTabMenu_WanImgToVideo_OnClick(object? sender, RoutedEventArgs e) + { + (DataContext as InferenceViewModel)!.AddTabCommand.Execute(InferenceProjectType.WanImageToVideo); + } } diff --git a/StabilityMatrix.Avalonia/Views/MainWindow.axaml.cs b/StabilityMatrix.Avalonia/Views/MainWindow.axaml.cs index b4f42964..a8289454 100644 --- a/StabilityMatrix.Avalonia/Views/MainWindow.axaml.cs +++ b/StabilityMatrix.Avalonia/Views/MainWindow.axaml.cs @@ -108,8 +108,8 @@ settingsManager.Settings.WindowSettings is { } windowSettings ) { Position = new PixelPoint(windowSettings.X, windowSettings.Y); - Width = windowSettings.Width; - Height = windowSettings.Height; + Width = Math.Max(300, windowSettings.Width); + Height = Math.Max(300, windowSettings.Height); WindowState = windowSettings.IsMaximized ? WindowState.Maximized : WindowState.Normal; } else @@ -178,13 +178,21 @@ private void StartupInitialize( settingsManager.Transaction( s => { - s.WindowSettings = new WindowSettings( - newSize.Width, - newSize.Height, - validWindowPosition ? Position.X : 0, - validWindowPosition ? Position.Y : 0, - WindowState == WindowState.Maximized - ); + var isMaximized = WindowState == WindowState.Maximized; + if (isMaximized && s.WindowSettings != null) + { + s.WindowSettings = s.WindowSettings with { IsMaximized = true }; + } + else + { + s.WindowSettings = new WindowSettings( + newSize.Width, + newSize.Height, + validWindowPosition ? Position.X : 0, + validWindowPosition ? Position.Y : 0, + WindowState == WindowState.Maximized + ); + } }, ignoreMissingLibraryDir: true ); @@ -201,13 +209,23 @@ private void StartupInitialize( settingsManager.Transaction( s => { - s.WindowSettings = new WindowSettings( - Width, - Height, - position.X, - position.Y, - WindowState == WindowState.Maximized - ); + var isMaximized = WindowState == WindowState.Maximized; + var validWindowPosition = Screens.All.Any(screen => screen.Bounds.Contains(position)); + + if (isMaximized && s.WindowSettings != null) + { + s.WindowSettings = s.WindowSettings with { IsMaximized = true }; + } + else + { + s.WindowSettings = new WindowSettings( + Width, + Height, + validWindowPosition ? position.X : 0, + validWindowPosition ? position.Y : 0, + WindowState == WindowState.Maximized + ); + } }, ignoreMissingLibraryDir: true ); diff --git a/StabilityMatrix.Avalonia/Views/OpenModelDbBrowserPage.axaml b/StabilityMatrix.Avalonia/Views/OpenModelDbBrowserPage.axaml new file mode 100644 index 00000000..300fd612 --- /dev/null +++ b/StabilityMatrix.Avalonia/Views/OpenModelDbBrowserPage.axaml @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StabilityMatrix.Avalonia/Views/OpenModelDbBrowserPage.axaml.cs b/StabilityMatrix.Avalonia/Views/OpenModelDbBrowserPage.axaml.cs new file mode 100644 index 00000000..89256184 --- /dev/null +++ b/StabilityMatrix.Avalonia/Views/OpenModelDbBrowserPage.axaml.cs @@ -0,0 +1,42 @@ +using Injectio.Attributes; +using StabilityMatrix.Avalonia.Controls; +using StabilityMatrix.Avalonia.ViewModels.Settings; +using StabilityMatrix.Core.Attributes; + +namespace StabilityMatrix.Avalonia.Views; + +[RegisterSingleton] +public partial class OpenModelDbBrowserPage : UserControlBase +{ + public OpenModelDbBrowserPage() + { + InitializeComponent(); + } + /*private readonly ISettingsManager settingsManager; + + public OpenModelDbBrowserPage(ISettingsManager settingsManager) + { + this.settingsManager = settingsManager; + InitializeComponent(); + } + + private void ScrollViewer_OnScrollChanged(object? sender, ScrollChangedEventArgs e) + { + if (sender is not ScrollViewer scrollViewer) + return; + + if (scrollViewer.Offset.Y == 0) + return; + + var isAtEnd = Math.Abs(scrollViewer.Offset.Y - scrollViewer.ScrollBarMaximum.Y) < 1f; + + if ( + isAtEnd + && settingsManager.Settings.IsWorkflowInfiniteScrollEnabled + && DataContext is IInfinitelyScroll scroll + ) + { + scroll.LoadNextPageAsync().SafeFireAndForget(); + } + }*/ +} diff --git a/StabilityMatrix.Avalonia/Views/PackageManager/MainPackageManagerView.axaml b/StabilityMatrix.Avalonia/Views/PackageManager/MainPackageManagerView.axaml index a76e893f..2f734bd5 100644 --- a/StabilityMatrix.Avalonia/Views/PackageManager/MainPackageManagerView.axaml +++ b/StabilityMatrix.Avalonia/Views/PackageManager/MainPackageManagerView.axaml @@ -6,11 +6,9 @@ xmlns:converters="clr-namespace:StabilityMatrix.Avalonia.Converters" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:designData="clr-namespace:StabilityMatrix.Avalonia.DesignData" - xmlns:generic="clr-namespace:System.Collections.Generic;assembly=System.Runtime" xmlns:icons="clr-namespace:Projektanker.Icons.Avalonia;assembly=Projektanker.Icons.Avalonia" xmlns:input="clr-namespace:FluentAvalonia.UI.Input;assembly=FluentAvalonia" xmlns:lang="clr-namespace:StabilityMatrix.Avalonia.Languages" - xmlns:markupExtensions="clr-namespace:StabilityMatrix.Avalonia.MarkupExtensions" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core" xmlns:packageManager="clr-namespace:StabilityMatrix.Avalonia.ViewModels.PackageManager" @@ -335,10 +333,10 @@