Skip to content

Commit

Permalink
Merge pull request #165 from LykosAI/main
Browse files Browse the repository at this point in the history
  • Loading branch information
ionite34 authored Oct 5, 2023
2 parents dd52d91 + e798a7c commit 380ffe7
Show file tree
Hide file tree
Showing 333 changed files with 27,511 additions and 1,011 deletions.
7 changes: 5 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
root = true
root = true

[*.cs]
max_line_length = 100
max_line_length = 120
csharp_style_var_for_built_in_types = true
dotnet_sort_system_directives_first = true

# ReSharper properties
resharper_csharp_max_line_length = 120
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "weekly"
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ jobs:
-o out -c Release -r ${{ env.platform-id }}
-p:Version=$env:RELEASE_VERSION
-p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
-p:PublishReadyToRun=true
-p:SentryOrg=${{ secrets.SENTRY_ORG }} -p:SentryProject=${{ secrets.SENTRY_PROJECT }}
-p:SentryUploadSymbols=true -p:SentryUploadSources=true
Expand Down Expand Up @@ -197,4 +198,4 @@ jobs:
tag_name: v${{ github.event.inputs.version }}
body: ${{ steps.release_notes.outputs.release_notes }}
draft: ${{ github.event.inputs.github-release-draft == 'true' }}
prerelease: ${{ github.event.inputs.github-release-prerelease == 'true' }}
prerelease: ${{ github.event.inputs.github-release-prerelease == 'true' }}
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ 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.5.0
### Added
- Added Inference, a built-in native Stable Diffusion interface, powered by ComfyUI
- Added option to change the Shared Folder method for packages using the three-dots menu on the Packages page
- Added the ability to Favorite models in the Model Browser
- Added "Favorites" sort option to the Model Browser
- Added notification flyout for new available updates. Dismiss to hide until the next update version.
### Changed
- Model Browser page size is now 20 instead of 14
- Update changelog now only shows the difference between the current version and the latest version
### Fixed
- Fixed [#141](https://github.com/LykosAI/StabilityMatrix/issues/141) - Search not working when sorting by Installed on Model Browser
- Fixed SD.Next not showing "Open Web UI" button when finished loading
- Fixed model index startup errors when `./Models` contains unknown custom folder names
- Fixed ストップ button being cut off in Japanese translation
- Fixed update progress freezing in some cases
- Fixed light theme being default in first time setup window
- Fixed shared folder links not recreating fully when partially missing

## v2.4.6
### Added
- LDSR / ADetailer shared folder links for Automatic1111 Package
Expand Down
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
[voltaml]: https://github.com/VoltaML/voltaML-fast-stable-diffusion
[invokeai]: https://github.com/invoke-ai/InvokeAI
[fooocus]: https://github.com/lllyasviel/Fooocus
[fooocus_mre]: https://github.com/MoonRide303/Fooocus-MRE
[fooocus-mre]: https://github.com/MoonRide303/Fooocus-MRE

[civitai]: https://civitai.com/

Multi-Platform Package Manager for Stable Diffusion

### ✨ New in 2.5 - [Inference](#inference), a built-in Stable Diffusion interface powered by ComfyUI

### 🖱️ One click install and update for Stable Diffusion Web UI Packages
- Supports [Automatic 1111][auto1111], [Comfy UI][comfy], [SD.Next (Vladmandic)][sdnext], [VoltaML][voltaml], [InvokeAI][invokeai], [Fooocus][fooocus], and [Fooocus MRE][fooocus_mre]
- Supports [Automatic 1111][auto1111], [Comfy UI][comfy], [SD.Next (Vladmandic)][sdnext], [VoltaML][voltaml], [InvokeAI][invokeai], [Fooocus][fooocus], and [Fooocus MRE][fooocus-mre]
- Embedded Git and Python dependencies, with no need for either to be globally installed
- Fully portable - move Stability Matrix's Data Directory to a new drive or computer at any time

Expand All @@ -36,7 +38,7 @@ Multi-Platform Package Manager for Stable Diffusion
- Automatically imports to the associated model folder depending on the model type
- Downloads relevant metadata files and preview image

![header](https://github.com/LykosAI/StabilityMatrix/assets/13956642/a9c5f925-8561-49ba-855b-1b7bf57d7c0d)
![header](https://cdn.lykos.ai/static/sm-banner-rounded.webp)

[![Release](https://img.shields.io/github/v/release/LykosAI/StabilityMatrix?label=Latest%20Release&link=https%3A%2F%2Fgithub.com%2FLykosAI%2FStabilityMatrix%2Freleases%2Flatest)][release]

Expand All @@ -46,6 +48,18 @@ Multi-Platform Package Manager for Stable Diffusion

> macOS builds are currently pending: [#45][download-macos]
### Inference - A reimagined built-in Stable Diffusion experience
- Powerful auto-completion and syntax highlighting using a formal language grammar
- Workspaces open in tabs that save and load from `.smproj` project files

![](https://cdn.lykos.ai/static/sm-banner-inference-rounded.webp)

- Customizable dockable and float panels
- Generated images contain Inference Project, ComfyUI Nodes, and A1111-compatible metadata
- Drag and drop gallery images or files to load states

![](https://cdn.lykos.ai/static/sc-inference-drag-load-2.gif)

### Searchable launch options
<p align="center">
<img style="width: 80%; height: 80%" src="https://github.com/LykosAI/StabilityMatrix/assets/13956642/75456866-9d95-47c6-8c0a-fdc19443ee02" alt=""/>
Expand All @@ -61,13 +75,16 @@ Multi-Platform Package Manager for Stable Diffusion

### Shared model directory for all your packages
- Import local models by simple drag and drop
- Option to find CivitAI metadata and preview thumbnails for new local imports
- Toggle visibility of categories like LoRA, VAE, CLIP, etc.
- Option to automatically find CivitAI metadata and preview thumbnails for new local imports

<p align="center">
<img style="width: 80%; height: 80%" src="https://github.com/LykosAI/StabilityMatrix/assets/13956642/d42d1c53-67a4-45a0-b009-21400d44e17e" alt=""/>
</p>

- Find connected metadata for existing models
<p align="center">
<img style="width: 80%; height: 80%" src="https://cdn.lykos.ai/static/sc-checkpoints-find-connected.gif" alt=""/>
</p>

## Localization
Stability Matrix is now available in the following languages, thanks to our community contributors:
Expand All @@ -76,6 +93,8 @@ Stability Matrix is now available in the following languages, thanks to our comm
- kgmkm_mkgm
- 🇨🇳 中文(简体,繁体)
- jimlovewine
- 🇮🇹 Italiano
- Marco Capelli

If you would like to contribute a translation, please create an issue or contact us on Discord. Include an email where we'll send an invite to our [POEditor](https://poeditor.com/) project.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ protected override void Write(LogEventInfo logEvent)
Color = _config!.Colors[logLevel],
}
);

Debug.WriteLine(
$"--- [{logLevel.ToString()[..3]}] {message} - {logEvent.Exception?.Message ?? "no error"}"
);
}

#endregion
Expand Down
2 changes: 1 addition & 1 deletion StabilityMatrix.Avalonia.pupnet.conf
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ DotnetProjectPath = StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj
# '-p:DebugType=None -p:DebugSymbols=false -p:PublishSingleFile=true -p:PublishReadyToRun=true
# -p:PublishTrimmed=true -p:TrimMode=link'. Note. This value may use macro variables. Use 'pupnet --help macro'
# for reference. See: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish
DotnetPublishArgs = -p:Version=${APP_VERSION} -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false --self-contained
DotnetPublishArgs = -p:Version=${APP_VERSION} -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false --self-contained

# Post-publish (or standalone build) command on Linux (ignored on Windows). It is called after dotnet
# publish, but before the final output is built. This could, for example, be a script which copies
Expand Down
108 changes: 108 additions & 0 deletions StabilityMatrix.Avalonia/Animations/ItemsRepeaterArrangeAnimation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Rendering.Composition;
using Avalonia.Rendering.Composition.Animations;

namespace StabilityMatrix.Avalonia.Animations;

public class ItemsRepeaterArrangeAnimation : AvaloniaObject
{
public static readonly AttachedProperty<bool> EnableItemsArrangeAnimationProperty =
AvaloniaProperty.RegisterAttached<ItemsRepeater, bool>(
"EnableItemsArrangeAnimation",
typeof(ItemsRepeaterArrangeAnimation)
);

static ItemsRepeaterArrangeAnimation()
{
EnableItemsArrangeAnimationProperty.Changed.AddClassHandler<ItemsRepeater>(
OnEnableItemsArrangeAnimationChanged
);
}

private static void OnEnableItemsArrangeAnimationChanged(
ItemsRepeater itemsRepeater,
AvaloniaPropertyChangedEventArgs eventArgs
)
{
if (eventArgs.NewValue is true)
{
itemsRepeater.ElementPrepared += OnElementPrepared;
itemsRepeater.ElementIndexChanged += OnElementIndexChanged;
}
else
{
// itemsRepeater.Opened -= OnOpened;
}
}

private static void CreateAnimation(Visual item)
{
var compositionVisual =
ElementComposition.GetElementVisual(item) ?? throw new NullReferenceException();

if (compositionVisual.ImplicitAnimations is { } animations && animations.HasKey("Offset"))
{
return;
}

var compositor = compositionVisual.Compositor;

var offsetAnimation = compositor.CreateVector3KeyFrameAnimation();
offsetAnimation.Target = "Offset";
// Using the "this.FinalValue" to indicate the last value of the Offset property
offsetAnimation.InsertExpressionKeyFrame(1.0f, "this.FinalValue");
offsetAnimation.Duration = TimeSpan.FromMilliseconds(150);

// Create a new implicit animation collection and bind the offset animation
var implicitAnimationCollection = compositor.CreateImplicitAnimationCollection();
implicitAnimationCollection["Offset"] = offsetAnimation;
compositionVisual.ImplicitAnimations = implicitAnimationCollection;
}

private static void OnElementPrepared(object? sender, ItemsRepeaterElementPreparedEventArgs e)
{
if (
sender is not ItemsRepeater itemsRepeater
|| !GetEnableItemsArrangeAnimation(itemsRepeater)
)
return;

CreateAnimation(itemsRepeater);
}

private static void OnElementIndexChanged(
object? sender,
ItemsRepeaterElementIndexChangedEventArgs e
)
{
if (
sender is not ItemsRepeater itemsRepeater
|| !GetEnableItemsArrangeAnimation(itemsRepeater)
)
return;

CreateAnimation(itemsRepeater);
}

/*private static void OnOpened(object sender, EventArgs e)
{
if (sender is not WindowBase windowBase || !GetEnableScaleShowAnimation(windowBase))
return;
// Here we explicitly animate the "Scale" property
// The implementation is the same as `Offset` at the beginning, but just with the Scale property
windowBase.StartWindowScaleAnimation();
}*/

public static bool GetEnableItemsArrangeAnimation(ItemsRepeater element)
{
return element.GetValue(EnableItemsArrangeAnimationProperty);
}

public static void SetEnableItemsArrangeAnimation(ItemsRepeater element, bool value)
{
element.SetValue(EnableItemsArrangeAnimationProperty, value);
}
}
37 changes: 35 additions & 2 deletions StabilityMatrix.Avalonia/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="StabilityMatrix.Avalonia.App"
xmlns:local="using:StabilityMatrix.Avalonia"
xmlns:idcr="using:Dock.Avalonia.Controls.Recycling"
xmlns:styling="clr-namespace:FluentAvalonia.Styling;assembly=FluentAvalonia"

RequestedThemeVariant="Default">
RequestedThemeVariant="Dark">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->

<Application.DataTemplates>
Expand All @@ -15,21 +15,54 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="Styles/ThemeColors.axaml"/>
<ResourceInclude Source="Styles/ThemeMaterials.axaml"/>
<ResourceInclude Source="Styles/Card.axaml"/>
<ResourceInclude Source="Controls/CodeCompletion/CompletionListThemes.axaml"/>
<ResourceInclude Source="Styles/ContextMenuStyles.axaml"/>
<ResourceInclude Source="Controls/EditorFlyouts.axaml"/>
</ResourceDictionary.MergedDictionaries>

<idcr:ControlRecycling x:Key="ControlRecyclingKey" />
<x:Double x:Key="ContentDialogMaxWidth">700</x:Double>

<SolidColorBrush x:Key="ToolTipBackground" Color="#1E1F22"/>
<SolidColorBrush x:Key="ToolTipForeground" Color="#9FBDC3"/>
<FontFamily x:Key="NotoSansJP">avares://StabilityMatrix.Avalonia/Assets/Fonts/NotoSansJP#Noto Sans JP</FontFamily>
</ResourceDictionary>
</Application.Resources>

<Application.Styles>
<styling:FluentAvaloniaTheme PreferUserAccentColor="True" UseSystemFontOnWindows="True"
TextVerticalAlignmentOverrideBehavior="Disabled"/>
<StyleInclude Source="avares://Dock.Avalonia/Themes/DockFluentTheme.axaml" />
<StyleInclude Source="avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml"/>
<StyleInclude Source="avares://AsyncImageLoader.Avalonia/AdvancedImage.axaml" />
<StyleInclude Source="Styles/ProgressRing.axaml"/>
<StyleInclude Source="Styles/ButtonStyles.axaml"/>
<StyleInclude Source="Styles/SplitButtonStyles.axaml"/>
<StyleInclude Source="Styles/ToggleButtonStyles.axaml"/>
<StyleInclude Source="Styles/DockStyles.axaml"/>
<StyleInclude Source="Styles/BorderStyles.axaml"/>
<StyleInclude Source="Controls/SeedCard.axaml"/>
<StyleInclude Source="Controls/SamplerCard.axaml"/>
<StyleInclude Source="Controls/ImageGalleryCard.axaml"/>
<StyleInclude Source="Controls/PromptCard.axaml"/>
<StyleInclude Source="Controls/StackCard.axaml"/>
<StyleInclude Source="Controls/UpscalerCard.axaml"/>
<StyleInclude Source="Controls/StackExpander.axaml"/>
<StyleInclude Source="Controls/ModelCard.axaml"/>
<StyleInclude Source="Controls/BatchSizeCard.axaml"/>
<StyleInclude Source="Controls/AdvancedImageBox.axaml"/>
<StyleInclude Source="Controls/FrameCarousel.axaml"/>
<StyleInclude Source="Controls/CodeCompletion/CompletionWindow.axaml"/>
<StyleInclude Source="Controls/SelectImageCard.axaml"/>
<StyleInclude Source="Controls/ImageFolderCard.axaml"/>
<StyleInclude Source="Controls/SharpenCard.axaml"/>
<StyleInclude Source="Controls/FreeUCard.axaml"/>
<StyleInclude Source="Controls/Paginator.axaml"/>

<Style Selector="DockControl">
<Setter Property="(DockProperties.ControlRecycling)" Value="{StaticResource ControlRecyclingKey}" />
</Style>
</Application.Styles>
</Application>
Loading

0 comments on commit 380ffe7

Please sign in to comment.