Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.4.0 Update #117

Merged
merged 41 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b9cb81e
install/update/versioning refactor & new install dialog layout wip
mohnjiles Aug 27, 2023
bb378c7
added advanced options section & release mode toggle
mohnjiles Aug 27, 2023
bb686a5
Added SharedFolderMethod & TorchVersion options to Advanced Install O…
mohnjiles Aug 31, 2023
ad0e9a8
Merge branch 'main' of https://github.com/ionite34/StabilityMatrix in…
mohnjiles Aug 31, 2023
2edf037
Update VladAutomatic.cs to add missing usings
mohnjiles Aug 31, 2023
fbdb15e
Fix unit tests
mohnjiles Aug 31, 2023
e0462b5
formatting
mohnjiles Aug 31, 2023
07a6357
Merge branch 'main' into install-refactor
mohnjiles Aug 31, 2023
9d25c0b
Merge branch 'main' of https://github.com/ionite34/StabilityMatrix in…
mohnjiles Sep 4, 2023
b164408
Merge branch 'install-refactor' of https://github.com/ionite34/Stabil…
mohnjiles Sep 4, 2023
712ce97
Fix LogViewer AddLogViewer not using correct instance
ionite34 Sep 4, 2023
dbc22de
Remove double debugger logging in DataStoreLoggerTarget
ionite34 Sep 4, 2023
c3c13e2
Merge pull request #234 from ionite34/fix-logviewer
ionite34 Sep 5, 2023
a2d8035
Merge branch 'main' of https://github.com/ionite34/StabilityMatrix in…
mohnjiles Sep 7, 2023
aefef59
finished up install stuff, added to download/progressmanager, restore…
mohnjiles Sep 7, 2023
28dd518
Forgot the stupid task file
mohnjiles Sep 7, 2023
3f53bc1
Fix merge weirdness
mohnjiles Sep 7, 2023
2d6fa76
add back csharpierrc
mohnjiles Sep 7, 2023
ce85dc1
Remove package name lookup thing
mohnjiles Sep 7, 2023
ff240ca
Remove PackageModificationDialogViewModel & call Console.StartUpdates
mohnjiles Sep 8, 2023
16299d4
Use conditional logger for ConsoleViewModel
ionite34 Sep 8, 2023
523e575
Fix text display & change line offset for scrollToBottomRequested in …
mohnjiles Sep 8, 2023
b5cb6d6
Fixed weird shared progress event
mohnjiles Sep 8, 2023
f5bb6ab
Merge pull request #230 from ionite34/install-refactor
mohnjiles Sep 8, 2023
a56cfb0
Fix some missing paths & launch args & added Foooocus-MRE
mohnjiles Sep 9, 2023
106d2c8
chagenlog
mohnjiles Sep 9, 2023
578e4d7
Add autolaunch option for A1111 also
mohnjiles Sep 9, 2023
4e9348c
Fix host -> server-name arg
mohnjiles Sep 9, 2023
1e8bcdb
Merge pull request #235 from ionite34/bug-fixes-and-mre
mohnjiles Sep 9, 2023
370ed5a
Send page number in request for Installed models
mohnjiles Sep 9, 2023
3ecb3cd
Merge pull request #236 from ionite34/fix-installed-model-search
mohnjiles Sep 9, 2023
c1f924f
Moved more xaml strings to Resources for localization & fix connected…
mohnjiles Sep 10, 2023
1458797
Merge pull request #237 from ionite34/more-resource-strings
mohnjiles Sep 11, 2023
9b59793
Add toggle for "Show Model Images" on checkpoints page & add "find co…
mohnjiles Sep 11, 2023
7df57cf
Remove finally block
mohnjiles Sep 11, 2023
be3c6b9
WIP updated checkpoint folder algorithm
mohnjiles Sep 11, 2023
d5a19f5
Improve Indexing performance
ionite34 Sep 11, 2023
f9957f4
Updated sorts & filters & changelog
mohnjiles Sep 11, 2023
633cf04
Remove extra sort
mohnjiles Sep 11, 2023
9a71855
Merge pull request #238 from ionite34/show-model-images
mohnjiles Sep 11, 2023
c3b9de3
Merge branch 'main' into main
ionite34 Sep 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,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' }}
2 changes: 1 addition & 1 deletion .husky/task-runner.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"name": "Run xamlstyler",
"group": "pre-commit",
"command": "dotnet",
"args": [ "xstyler", "${staged}" ],
"args": [ "xstyler", "-f", "${staged}" ],
"include": [ "**/*.axaml" ]
}
]
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ 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.4.0
### Added
- New installable Package - [Fooocus-MRE](https://github.com/MoonRide303/Fooocus-MRE)
- Added toggle to show connected model images in the Checkpoints tab
- Added "Find Connected Metadata" option to the context menu of Checkpoint Folders in the Checkpoints tab to connect models that don't have any metadata
### Changed
- Revamped package installer
- Added "advanced options" section for commit, shared folder method, and pytorch options
- Can be run in the background
- Shows progress in the Downloads tab
- Even more performance improvements for loading and searching the Checkpoints page
### Fixed
- Fixed [#97](https://github.com/LykosAI/StabilityMatrix/issues/97) - Codeformer folder should now get linked correctly
- Fixed [#106](https://github.com/LykosAI/StabilityMatrix/issues/106) - ComfyUI should now install correctly on Windows machines with an AMD GPU using DirectML
- Fixed [#107](https://github.com/LykosAI/StabilityMatrix/issues/107) - Added `--autolaunch` option to SD.Next
- Fixed [#110](https://github.com/LykosAI/StabilityMatrix/issues/110) - Model Browser should properly navigate to the next page of Installed models
- Installed tag on model browser should now show for connected models imported via drag & drop

## v2.3.4
### Fixed
- Fixed [#108](https://github.com/LykosAI/StabilityMatrix/issues/108) - (Linux) Fixed permission error on updates [#103](https://github.com/LykosAI/StabilityMatrix/pull/103)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ namespace StabilityMatrix.Avalonia.Diagnostics.LogViewer.Controls;

public partial class LogViewerControl : UserControl
{
public LogViewerControl()
=> InitializeComponent();
public LogViewerControl() => InitializeComponent();

private ILogDataStoreImpl? vm;
private LogModel? item;

protected override void OnDataContextChanged(EventArgs e)
{
base.OnDataContextChanged(e);

if (DataContext is null)
return;

Expand Down Expand Up @@ -45,8 +44,9 @@ protected void OnLayoutUpdated(object? sender, EventArgs e)
protected override void OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs e)
{
base.OnDetachedFromLogicalTree(e);

if (vm is null) return;

if (vm is null)
return;
vm.DataStore.Entries.CollectionChanged -= OnCollectionChanged;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ public object Convert(object? value, Type targetType, object? parameter, Culture
return new SolidColorBrush((Color)(parameter ?? Colors.Black));

var sysDrawColor = (SysDrawColor)value!;
return new SolidColorBrush(Color.FromArgb(
sysDrawColor.A,
sysDrawColor.R,
sysDrawColor.G,
sysDrawColor.B));
return new SolidColorBrush(
Color.FromArgb(sysDrawColor.A, sysDrawColor.R, sysDrawColor.G, sysDrawColor.B)
);
}

public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
=> throw new NotImplementedException();
public object ConvertBack(
object? value,
Type targetType,
object? parameter,
CultureInfo culture
) => throw new NotImplementedException();
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ public object Convert(object? value, Type targetType, object? parameter, Culture
}

// If not implemented, an error is thrown
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
=> new EventId(0, value?.ToString() ?? string.Empty);
public object ConvertBack(
object? value,
Type targetType,
object? parameter,
CultureInfo culture
) => new EventId(0, value?.ToString() ?? string.Empty);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ namespace StabilityMatrix.Avalonia.Diagnostics.LogViewer.Core.Extensions;

public static class LoggerExtensions
{
public static void Emit(this ILogger logger, EventId eventId,
LogLevel logLevel, string message, Exception? exception = null, params object?[] args)
public static void Emit(
this ILogger logger,
EventId eventId,
LogLevel logLevel,
string message,
Exception? exception = null,
params object?[] args
)
{
if (logger is null)
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,28 @@ namespace StabilityMatrix.Avalonia.Diagnostics.LogViewer.Core.Logging;
public class DataStoreLoggerConfiguration
{
#region Properties

public EventId EventId { get; set; }

public Dictionary<LogLevel, LogEntryColor> Colors { get; } = new()
{
[LogLevel.Trace] = new LogEntryColor
{
Foreground = Color.DarkGray
},
[LogLevel.Debug] = new LogEntryColor
{
Foreground = Color.Gray
},
[LogLevel.Information] = new LogEntryColor
{
Foreground = Color.WhiteSmoke,
},
[LogLevel.Warning] = new LogEntryColor
{
Foreground = Color.Orange
},
[LogLevel.Error] = new LogEntryColor
{
Foreground = Color.White,
Background = Color.OrangeRed
},
[LogLevel.Critical] = new LogEntryColor
{
Foreground = Color.White,
Background = Color.Red
},
[LogLevel.None] = new LogEntryColor
public Dictionary<LogLevel, LogEntryColor> Colors { get; } =
new()
{
Foreground = Color.Magenta
}
};
[LogLevel.Trace] = new LogEntryColor { Foreground = Color.DarkGray },
[LogLevel.Debug] = new LogEntryColor { Foreground = Color.Gray },
[LogLevel.Information] = new LogEntryColor { Foreground = Color.WhiteSmoke, },
[LogLevel.Warning] = new LogEntryColor { Foreground = Color.Orange },
[LogLevel.Error] = new LogEntryColor
{
Foreground = Color.White,
Background = Color.OrangeRed
},
[LogLevel.Critical] = new LogEntryColor
{
Foreground = Color.White,
Background = Color.Red
},
[LogLevel.None] = new LogEntryColor { Foreground = Color.Magenta }
};

#endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
public interface ILogDataStoreImpl
{
public ILogDataStore DataStore { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace StabilityMatrix.Avalonia.Diagnostics.LogViewer.Core.Logging;
public class LogDataStore : ILogDataStore
{
public static LogDataStore Instance { get; } = new();

#region Fields

private static readonly SemaphoreSlim _semaphore = new(initialCount: 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ namespace StabilityMatrix.Avalonia.Diagnostics.LogViewer.Core.Logging;

public class LogEntryColor
{
public LogEntryColor()
{
}
public LogEntryColor() { }

public LogEntryColor(Color foreground, Color background)
{
Expand All @@ -16,5 +14,4 @@ public LogEntryColor(Color foreground, Color background)

public Color Foreground { get; set; } = Color.Black;
public Color Background { get; set; } = Color.Transparent;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ public class LogModel
public EventId EventId { get; set; }

public object? State { get; set; }

public string? LoggerName { get; set; }

public string? CallerClassName { get; set; }

public string? CallerMemberName { get; set; }

public string? Exception { get; set; }
Expand All @@ -26,8 +26,6 @@ public class LogModel

#endregion

public string LoggerDisplayName =>
LoggerName?
.Split('.', StringSplitOptions.RemoveEmptyEntries)
.LastOrDefault() ?? "";
public string LoggerDisplayName =>
LoggerName?.Split('.', StringSplitOptions.RemoveEmptyEntries).LastOrDefault() ?? "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ public LogViewerControlViewModel(ILogDataStore dataStore)
public ILogDataStore DataStore { get; set; }

#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ namespace StabilityMatrix.Avalonia.Diagnostics.LogViewer.Core.ViewModels;

public class ObservableObject : INotifyPropertyChanged
{
protected bool Set<TValue>(ref TValue field, TValue newValue, [CallerMemberName] string? propertyName = null)
protected bool Set<TValue>(
ref TValue field,
TValue newValue,
[CallerMemberName] string? propertyName = null
)
{
if (EqualityComparer<TValue>.Default.Equals(field, newValue)) return false;
if (EqualityComparer<TValue>.Default.Equals(field, newValue))
return false;
field = newValue;
OnPropertyChanged(propertyName);

Expand All @@ -16,6 +21,6 @@ protected bool Set<TValue>(ref TValue field, TValue newValue, [CallerMemberName]

public event PropertyChangedEventHandler? PropertyChanged;

protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null) =>
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
namespace StabilityMatrix.Avalonia.Diagnostics.LogViewer.Core.ViewModels;

public class ViewModel : ObservableObject { /* skip */ }
public class ViewModel
: ObservableObject { /* skip */
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,27 @@ protected override void Write(LogEventInfo logEvent)
}

// add log entry
_dataStore?.AddEntry(new LogModel
{
Timestamp = DateTime.UtcNow,
LogLevel = logLevel,
// do we override the default EventId if it exists?
EventId = eventId.Id == 0 && (_config?.EventId.Id ?? 0) != 0 ? _config!.EventId : eventId,
State = message,
LoggerName = logEvent.LoggerName,
CallerClassName = logEvent.CallerClassName,
CallerMemberName = logEvent.CallerMemberName,
Exception = logEvent.Exception?.Message ?? (logLevel == MsLogLevel.Error ? message : ""),
Color = _config!.Colors[logLevel],
});

Debug.WriteLine($"--- [{logLevel.ToString()[..3]}] {message} - {logEvent.Exception?.Message ?? "no error"}");
_dataStore?.AddEntry(
new LogModel
{
Timestamp = DateTime.UtcNow,
LogLevel = logLevel,
// do we override the default EventId if it exists?
EventId =
eventId.Id == 0 && (_config?.EventId.Id ?? 0) != 0 ? _config!.EventId : eventId,
State = message,
LoggerName = logEvent.LoggerName,
CallerClassName = logEvent.CallerClassName,
CallerMemberName = logEvent.CallerMemberName,
Exception =
logEvent.Exception?.Message ?? (logLevel == MsLogLevel.Error ? message : ""),
Color = _config!.Colors[logLevel],
}
);

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

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,36 @@ public static class ServicesExtension
{
public static IServiceCollection AddLogViewer(this IServiceCollection services)
{
services.AddSingleton<ILogDataStore, LogDataStore>();
services.AddSingleton<ILogDataStore>(Core.Logging.LogDataStore.Instance);
services.AddSingleton<LogViewerControlViewModel>();

return services;
}

public static IServiceCollection AddLogViewer(
this IServiceCollection services,
Action<DataStoreLoggerConfiguration> configure)
this IServiceCollection services,
Action<DataStoreLoggerConfiguration> configure
)
{
services.AddSingleton<ILogDataStore>(Core.Logging.LogDataStore.Instance);
services.AddSingleton<LogViewerControlViewModel>();
services.Configure(configure);

return services;
}

public static ILoggingBuilder AddNLogTargets(this ILoggingBuilder builder, IConfiguration config)

public static ILoggingBuilder AddNLogTargets(
this ILoggingBuilder builder,
IConfiguration config
)
{
LogManager
.Setup()
// Register custom Target
.SetupExtensions(extensionBuilder =>
extensionBuilder.RegisterTarget<DataStoreLoggerTarget>("DataStoreLogger"));
.SetupExtensions(
extensionBuilder =>
extensionBuilder.RegisterTarget<DataStoreLoggerTarget>("DataStoreLogger")
);

/*builder
.ClearProviders()
Expand All @@ -56,7 +62,11 @@ public static ILoggingBuilder AddNLogTargets(this ILoggingBuilder builder, IConf
return builder;
}

public static ILoggingBuilder AddNLogTargets(this ILoggingBuilder builder, IConfiguration config, Action<DataStoreLoggerConfiguration> configure)
public static ILoggingBuilder AddNLogTargets(
this ILoggingBuilder builder,
IConfiguration config,
Action<DataStoreLoggerConfiguration> configure
)
{
builder.AddNLogTargets(config);
builder.Services.Configure(configure);
Expand Down
Loading