Browse Source

output sharing by default & invokeai fixes & some torch version updates

pull/629/head
JT 8 months ago
parent
commit
870aa20a80
  1. 6
      CHANGELOG.md
  2. 2
      StabilityMatrix.Avalonia/ViewModels/Dialogs/RecommendedModelsViewModel.cs
  3. 15
      StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageInstallDetailViewModel.cs
  4. 4
      StabilityMatrix.Avalonia/Views/MainWindow.axaml
  5. 5
      StabilityMatrix.Avalonia/Views/MainWindow.axaml.cs
  6. 128
      StabilityMatrix.Avalonia/Views/PackageManager/PackageInstallDetailView.axaml
  7. 3
      StabilityMatrix.Avalonia/Views/PackageManagerPage.axaml
  8. 15
      StabilityMatrix.Core/Models/PackageModification/SetupOutputSharingStep.cs
  9. 5
      StabilityMatrix.Core/Models/Packages/ComfyUI.cs
  10. 57
      StabilityMatrix.Core/Models/Packages/InvokeAI.cs
  11. 8
      StabilityMatrix.Core/Models/Packages/RuinedFooocus.cs
  12. 2
      StabilityMatrix.Core/Python/PyVenvRunner.cs

6
CHANGELOG.md

@ -9,11 +9,17 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
## v2.10.0-preview.1
### Added
- Added OpenArt.AI workflow browser for ComfyUI workflows
- Added Output Sharing toggle in Advanced Options during install flow
### Changed
- Changed to a new image control for pages with many images
- Removed Symlink option for InvokeAI due to changes with InvokeAI v4.0+
- Output sharing is now enabled by default for new installations
- (Internal) Updated to Avalonia 11.0.10
### Fixed
- Improved performance when deleting many images from the Outputs page
- Fixed ComfyUI torch downgrading to 2.1.2 when updating
- Fixed [#529](https://github.com/LykosAI/StabilityMatrix/issues/529) - OneTrainer requesting input during update
- Fixed "Could not find entry point for InvokeAI" error on InvokeAI v4.0+
## v2.10.0-dev.3
### Added

2
StabilityMatrix.Avalonia/ViewModels/Dialogs/RecommendedModelsViewModel.cs

@ -75,7 +75,7 @@ public partial class RecommendedModelsViewModel : ContentDialogViewModelBase
CivitModels
.Connect()
.DeferUntilLoaded()
.Filter(f => f.ModelVersion.BaseModel == "SDXL 1.0")
.Filter(f => f.ModelVersion.BaseModel == "SDXL 1.0" || f.ModelVersion.BaseModel == "Pony")
.Bind(SdxlModels)
.Subscribe();
}

15
StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageInstallDetailViewModel.cs

@ -85,6 +85,9 @@ public partial class PackageInstallDetailViewModel(
[ObservableProperty]
private GitCommit? selectedCommit;
[ObservableProperty]
private bool isOutputSharingEnabled = true;
[ObservableProperty]
private bool canInstall;
@ -97,6 +100,8 @@ public partial class PackageInstallDetailViewModel(
OnInstallNameChanged(InstallName);
CanInstall = false;
SelectedTorchVersion = SelectedPackage.GetRecommendedTorchVersion();
SelectedSharedFolderMethod = SelectedPackage.RecommendedSharedFolderMethod;
@ -224,6 +229,8 @@ public partial class PackageInstallDetailViewModel(
installLocation
);
var setupOutputSharingStep = new SetupOutputSharingStep(SelectedPackage, installLocation);
var package = new InstalledPackage
{
DisplayName = InstallName,
@ -234,7 +241,8 @@ public partial class PackageInstallDetailViewModel(
LaunchCommand = SelectedPackage.LaunchCommand,
LastUpdateCheck = DateTimeOffset.Now,
PreferredTorchVersion = SelectedTorchVersion,
PreferredSharedFolderMethod = SelectedSharedFolderMethod
PreferredSharedFolderMethod = SelectedSharedFolderMethod,
UseSharedOutputFolder = IsOutputSharingEnabled
};
var addInstalledPackageStep = new AddInstalledPackageStep(settingsManager, package);
@ -249,6 +257,11 @@ public partial class PackageInstallDetailViewModel(
addInstalledPackageStep
};
if (IsOutputSharingEnabled)
{
steps.Insert(steps.IndexOf(addInstalledPackageStep), setupOutputSharingStep);
}
var packageName = SelectedPackage.Name;
var runner = new PackageModificationRunner

4
StabilityMatrix.Avalonia/Views/MainWindow.axaml

@ -70,11 +70,13 @@
Grid.RowSpan="2"
Name="NavigationView"
ItemInvoked="NavigationView_OnItemInvoked"
BackRequested="NavigationView_OnBackRequested"
PaneDisplayMode="Left"
IsPaneOpen="False"
OpenPaneLength="{Binding PaneWidth}"
IsSettingsVisible="False"
IsBackEnabled="False"
IsBackEnabled="True"
IsBackButtonVisible="True"
MenuItemsSource="{Binding Pages, Mode=OneWay}"
FooterMenuItemsSource="{Binding FooterPages, Mode=OneWay}"
SelectedItem="{Binding SelectedCategory}">

5
StabilityMatrix.Avalonia/Views/MainWindow.axaml.cs

@ -446,4 +446,9 @@ public partial class MainWindow : AppWindowBase
e.Handled = true;
navigationService.GoBack();
}
private void NavigationView_OnBackRequested(object? sender, NavigationViewBackRequestedEventArgs e)
{
navigationService.GoBack();
}
}

128
StabilityMatrix.Avalonia/Views/PackageManager/PackageInstallDetailView.axaml

@ -16,7 +16,7 @@
x:CompileBindings="True"
d:DataContext="{x:Static designData:DesignData.PackageInstallDetailViewModel}"
x:Class="StabilityMatrix.Avalonia.Views.PackageManager.PackageInstallDetailView">
<Grid ColumnDefinitions="Auto, *"
RowDefinitions="Auto, *">
<controls:BetterAdvancedImage
@ -28,13 +28,13 @@
CornerRadius="8"
Source="{Binding SelectedPackage.PreviewImageUri}">
</controls:BetterAdvancedImage>
<StackPanel Grid.Row="0" Grid.Column="1"
Margin="8"
Orientation="Vertical">
<controls:HyperlinkIconButton NavigateUri="{Binding SelectedPackage.LicenseUrl}"
Content="{Binding SelectedPackage.LicenseType}"/>
Content="{Binding SelectedPackage.LicenseType}" />
<ToggleSwitch OnContent="{x:Static lang:Resources.Label_Releases}"
OffContent="{x:Static lang:Resources.Label_Branches}"
@ -98,71 +98,73 @@
<Run Text="{x:Static lang:Resources.Label_PleaseChooseDifferentName}" />
</TextBlock>
</StackPanel>
<Expander Header="{x:Static lang:Resources.Label_AdvancedOptions}"
FontSize="16"
HorizontalAlignment="Stretch"
Margin="8">
<Grid ColumnDefinitions="*, *, *"
RowDefinitions="Auto, Auto"
Margin="8,0">
<Label Grid.Row="0" Grid.Column="0"
Content="{x:Static lang:Resources.Label_SharedModelFolderStrategy}"
Margin="0,0,0,4" />
<controls1:FAComboBox Grid.Row="1" Grid.Column="0"
ItemsSource="{Binding SelectedPackage.AvailableSharedFolderMethods}"
MinWidth="150"
MinHeight="38"
SelectedItem="{Binding SelectedSharedFolderMethod}">
<controls1:FAComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type models:SharedFolderMethod}">
<TextBlock
Margin="8,4,0,4"
Text="{Binding }" />
</DataTemplate>
</controls1:FAComboBox.ItemTemplate>
</controls1:FAComboBox>
<WrapPanel Margin="8,0">
<StackPanel Orientation="Vertical" Margin="0,4,24,0">
<Label Content="{x:Static lang:Resources.Label_SharedModelStrategyShort}" />
<controls1:FAComboBox ItemsSource="{Binding SelectedPackage.AvailableSharedFolderMethods}"
MinWidth="150"
MinHeight="38"
SelectedItem="{Binding SelectedSharedFolderMethod}">
<controls1:FAComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type models:SharedFolderMethod}">
<TextBlock
Margin="8,4,0,4"
Text="{Binding }" />
</DataTemplate>
</controls1:FAComboBox.ItemTemplate>
</controls1:FAComboBox>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,4,24,0">
<Label Content="{x:Static lang:Resources.Label_PyTorchVersion}"
IsVisible="{Binding ShowTorchVersionOptions}"/>
<controls1:FAComboBox ItemsSource="{Binding SelectedPackage.AvailableTorchVersions}"
MinWidth="150"
MinHeight="38"
IsVisible="{Binding ShowTorchVersionOptions}"
SelectedItem="{Binding SelectedTorchVersion}">
<controls1:FAComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type models:TorchVersion}">
<TextBlock
Margin="8,4,0,4"
Text="{Binding }" />
</DataTemplate>
</controls1:FAComboBox.ItemTemplate>
</controls1:FAComboBox>
</StackPanel>
<Label Grid.Row="0" Grid.Column="1"
Content="{x:Static lang:Resources.Label_PyTorchVersion}"
IsVisible="{Binding ShowTorchVersionOptions}"
Margin="0,0,0,4" />
<controls1:FAComboBox Grid.Row="1" Grid.Column="1"
ItemsSource="{Binding SelectedPackage.AvailableTorchVersions}"
MinWidth="150"
MinHeight="38"
IsVisible="{Binding ShowTorchVersionOptions}"
SelectedItem="{Binding SelectedTorchVersion}">
<controls1:FAComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type models:TorchVersion}">
<TextBlock
Margin="8,4,0,4"
Text="{Binding }" />
</DataTemplate>
</controls1:FAComboBox.ItemTemplate>
</controls1:FAComboBox>
<StackPanel Orientation="Vertical" Margin="0,4,24,0">
<Label Content="{x:Static lang:Resources.Label_Commit}"
IsVisible="{Binding !IsReleaseMode}" />
<controls1:FAComboBox IsVisible="{Binding !IsReleaseMode}"
ItemsSource="{Binding AvailableCommits}"
MinWidth="150"
MinHeight="38"
SelectedItem="{Binding SelectedCommit}">
<controls1:FAComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type database:GitCommit}">
<TextBlock
Margin="8,4,0,4"
Name="NameTextBlock"
Text="{Binding ShortSha}" />
</DataTemplate>
</controls1:FAComboBox.ItemTemplate>
</controls1:FAComboBox>
</StackPanel>
<Label Grid.Row="0" Grid.Column="2"
Content="{x:Static lang:Resources.Label_Commit}"
Margin="0,0,0,4"
IsVisible="{Binding !IsReleaseMode}" />
<controls1:FAComboBox Grid.Row="1" Grid.Column="2"
IsVisible="{Binding !IsReleaseMode}"
ItemsSource="{Binding AvailableCommits}"
MinWidth="150"
MinHeight="38"
SelectedItem="{Binding SelectedCommit}">
<controls1:FAComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type database:GitCommit}">
<TextBlock
Margin="8,4,0,4"
Name="NameTextBlock"
Text="{Binding ShortSha}" />
</DataTemplate>
</controls1:FAComboBox.ItemTemplate>
</controls1:FAComboBox>
</Grid>
<StackPanel Orientation="Vertical" Margin="0,4,24,0"
IsVisible="{Binding !!SelectedPackage.SharedOutputFolders}">
<Label Content="{x:Static lang:Resources.Label_UseSharedOutputFolder}"/>
<ToggleSwitch VerticalAlignment="Center"
VerticalContentAlignment="Center"
IsChecked="{Binding IsOutputSharingEnabled}"/>
</StackPanel>
</WrapPanel>
</Expander>
<Button Classes="success"

3
StabilityMatrix.Avalonia/Views/PackageManagerPage.axaml

@ -220,9 +220,10 @@
</MenuItem>
<Separator />
<MenuItem Header="{x:Static lang:Resources.Action_Uninstall}"
IsEnabled="{Binding !IsRunning}"
Command="{Binding Uninstall}">
<MenuItem.Icon>
<ui:SymbolIcon Symbol="Delete" />
<ui:SymbolIcon Symbol="Delete"/>
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>

15
StabilityMatrix.Core/Models/PackageModification/SetupOutputSharingStep.cs

@ -0,0 +1,15 @@
using StabilityMatrix.Core.Models.Packages;
using StabilityMatrix.Core.Models.Progress;
namespace StabilityMatrix.Core.Models.PackageModification;
public class SetupOutputSharingStep(BasePackage package, string installPath) : IPackageStep
{
public Task ExecuteAsync(IProgress<ProgressReport>? progress = null)
{
package.SetupOutputFolderLinks(installPath);
return Task.CompletedTask;
}
public string ProgressTitle => "Setting up output sharing...";
}

5
StabilityMatrix.Core/Models/Packages/ComfyUI.cs

@ -213,7 +213,7 @@ public class ComfyUI(
_
=> pipArgs
.AddArg("--upgrade")
.WithTorch("~=2.1.0")
.WithTorch()
.WithTorchVision()
.WithTorchExtraIndex(
torchVersion switch
@ -233,9 +233,6 @@ public class ComfyUI(
switch (torchVersion)
{
case TorchVersion.Cuda:
pipArgs = pipArgs.WithXFormers("==0.0.22.post4");
break;
case TorchVersion.Mps:
pipArgs = pipArgs.AddArg("mpmath==1.3.0");
break;

57
StabilityMatrix.Core/Models/Packages/InvokeAI.cs

@ -32,23 +32,14 @@ public class InvokeAI : BaseGitPackage
public override PackageDifficulty InstallerSortOrder => PackageDifficulty.Nightmare;
public override IReadOnlyList<string> ExtraLaunchCommands =>
new[]
{
"invokeai-configure",
"invokeai-merge",
"invokeai-metadata",
"invokeai-model-install",
"invokeai-node-cli",
"invokeai-ti",
"invokeai-update",
};
new[] { "invokeai-db-maintenance", "invokeai-import-images", };
public override Uri PreviewImageUri =>
new("https://raw.githubusercontent.com/invoke-ai/InvokeAI/main/docs/assets/canvas_preview.png");
public override IEnumerable<SharedFolderMethod> AvailableSharedFolderMethods =>
new[] { SharedFolderMethod.Symlink, SharedFolderMethod.None };
public override SharedFolderMethod RecommendedSharedFolderMethod => SharedFolderMethod.Symlink;
new[] { SharedFolderMethod.None };
public override SharedFolderMethod RecommendedSharedFolderMethod => SharedFolderMethod.None;
public override string MainBranch => "main";
@ -127,23 +118,11 @@ public class InvokeAI : BaseGitPackage
Options = ["--allow-origins"]
},
new LaunchOptionDefinition
{
Name = "Always use CPU",
Type = LaunchOptionType.Bool,
Options = ["--always_use_cpu"]
},
new LaunchOptionDefinition
{
Name = "Precision",
Type = LaunchOptionType.Bool,
Options = ["--precision auto", "--precision float16", "--precision float32"]
},
new LaunchOptionDefinition
{
Name = "Aggressively free up GPU memory after each operation",
Type = LaunchOptionType.Bool,
Options = ["--free_gpu_mem"]
},
LaunchOptionDefinition.Extras
];
@ -223,9 +202,9 @@ public class InvokeAI : BaseGitPackage
await venvRunner
.PipInstall(
new PipInstallArgs(args.Any() ? args.ToArray() : Array.Empty<Argument>())
.WithTorch("==2.1.2")
.WithTorchVision("==0.16.2")
.WithXFormers("==0.0.23post1")
.WithTorch("==2.2.1")
.WithTorchVision("==0.17.1")
.WithXFormers("==0.0.25")
.WithTorchExtraIndex("cu121"),
onConsoleOutput
)
@ -262,24 +241,6 @@ public class InvokeAI : BaseGitPackage
.ConfigureAwait(false);
await venvRunner.PipInstall("rich packaging python-dotenv", onConsoleOutput).ConfigureAwait(false);
progress?.Report(new ProgressReport(-1f, "Configuring InvokeAI", isIndeterminate: true));
// need to setup model links before running invokeai-configure so it can do its conversion
await SetupModelFolders(installLocation, selectedSharedFolderMethod).ConfigureAwait(false);
await RunInvokeCommand(
installLocation,
"invokeai-configure",
"--yes --skip-sd-weights",
true,
onConsoleOutput,
spam3: true
)
.ConfigureAwait(false);
await VenvRunner.Process.WaitForExitAsync();
progress?.Report(new ProgressReport(1f, "Done!", isIndeterminate: false));
}
@ -362,12 +323,6 @@ public class InvokeAI : BaseGitPackage
await SetupVenv(installedPackagePath).ConfigureAwait(false);
arguments = command switch
{
"invokeai-configure" => "--yes --skip-sd-weights",
_ => arguments
};
VenvRunner.EnvironmentVariables = GetEnvVars(installedPackagePath);
// fix frontend build missing for people who updated to v3.6 before the fix

8
StabilityMatrix.Core/Models/Packages/RuinedFooocus.cs

@ -124,10 +124,10 @@ public class RuinedFooocus(
await venvRunner
.PipInstall(
new PipInstallArgs()
.WithTorch("==2.0.1")
.WithTorchVision("==0.15.2")
.WithXFormers("==0.0.20")
.WithTorchExtraIndex("cu118")
.WithTorch("==2.1.2")
.WithTorchVision("==0.16.2")
.WithXFormers("==0.0.23.post1")
.WithTorchExtraIndex("cu121")
.WithParsedFromRequirementsTxt(
await requirements.ReadAllTextAsync().ConfigureAwait(false),
excludePattern: "torch"

2
StabilityMatrix.Core/Python/PyVenvRunner.cs

@ -214,7 +214,7 @@ public class PyVenvRunner : IDisposable, IAsyncDisposable
});
SetPyvenvCfg(PyRunner.PythonDir);
RunDetached(args.Prepend("-m pip install"), outputAction);
RunDetached(args.Prepend("-m pip install").Concat("--exists-action s"), outputAction);
await Process.WaitForExitAsync().ConfigureAwait(false);
// Check return code

Loading…
Cancel
Save