Skip to content

Commit 922a68a

Browse files
authored
Merge pull request LykosAI#903 from ionite34/backport/main/pr-902
[dev to main] backport: Fix package images (902)
2 parents 623601e + f92ee13 commit 922a68a

File tree

11 files changed

+111
-25
lines changed

11 files changed

+111
-25
lines changed

Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@
22
<PropertyGroup>
33
<AvaloniaVersion>11.1.4</AvaloniaVersion>
44
</PropertyGroup>
5+
6+
<PropertyGroup>
7+
<!--Some bug with SDK 8.0.403
8+
https://github.com/dotnet/sdk/issues/44026-->
9+
<NoWarn>$(NoWarn);CsWinRT1028</NoWarn>
10+
</PropertyGroup>
511
</Project>

StabilityMatrix.Core/Models/Packages/ComfyUI.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ IPrerequisiteHelper prerequisiteHelper
3737
public override string Blurb => "A powerful and modular stable diffusion GUI and backend";
3838
public override string LaunchCommand => "main.py";
3939

40-
public override Uri PreviewImageUri =>
41-
new("https://github.com/comfyanonymous/ComfyUI/raw/master/comfyui_screenshot.png");
40+
public override Uri PreviewImageUri => new("https://cdn.lykos.ai/sm/packages/comfyui/preview.webp");
4241
public override bool ShouldIgnoreReleases => true;
4342
public override bool IsInferenceCompatible => true;
4443
public override string OutputFolderName => "output";

StabilityMatrix.Core/Models/Packages/KohyaSs.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ IPyRunner runner
2727
public override string LicenseUrl => "https://github.com/bmaltais/kohya_ss/blob/master/LICENSE.md";
2828
public override string LaunchCommand => "kohya_gui.py";
2929

30-
public override Uri PreviewImageUri =>
31-
new(
32-
"https://camo.githubusercontent.com/5154eea62c113d5c04393e51a0d0f76ef25a723aad29d256dcc85ead1961cd41/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f6b35696d713031757655592f302e6a7067"
33-
);
30+
public override Uri PreviewImageUri => new("https://cdn.lykos.ai/sm/packages/kohyass/preview.webp");
3431
public override string OutputFolderName => string.Empty;
3532

3633
public override bool IsCompatible => HardwareHelper.HasNvidiaGpu();

StabilityMatrix.Core/Models/Packages/Mashb1tFooocus.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,5 @@ IPrerequisiteHelper prerequisiteHelper
2323

2424
public override string LicenseUrl => "https://github.com/mashb1t/Fooocus/blob/main/LICENSE";
2525

26-
public override Uri PreviewImageUri =>
27-
new("https://github.com/lllyasviel/Fooocus/assets/19834515/483fb86d-c9a2-4c20-997c-46dafc124f25");
28-
2926
public override bool ShouldIgnoreReleases => false;
3027
}

StabilityMatrix.Core/Models/Packages/Reforge.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ IPrerequisiteHelper prerequisiteHelper
2121
"Stable Diffusion WebUI reForge is a platform on top of Stable Diffusion WebUI (based on Gradio) to make development easier, optimize resource management, speed up inference, and study experimental features.";
2222
public override string LicenseUrl =>
2323
"https://github.com/Panchovix/stable-diffusion-webui-reForge/blob/main/LICENSE.txt";
24-
public override Uri PreviewImageUri =>
25-
new(
26-
"https://github.com/lllyasviel/stable-diffusion-webui-forge/assets/19834515/de1a2d05-344a-44d7-bab8-9ecc0a58a8d3"
27-
);
24+
public override Uri PreviewImageUri => new("https://cdn.lykos.ai/sm/packages/reforge/preview.webp");
2825

2926
public override PackageDifficulty InstallerSortOrder => PackageDifficulty.ReallyRecommended;
3027
}

StabilityMatrix.Core/Models/Packages/SDWebForge.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ IPrerequisiteHelper prerequisiteHelper
2929
public override string LicenseUrl =>
3030
"https://github.com/lllyasviel/stable-diffusion-webui-forge/blob/main/LICENSE.txt";
3131

32-
public override Uri PreviewImageUri =>
33-
new(
34-
"https://github.com/lllyasviel/stable-diffusion-webui-forge/assets/19834515/ca5e05ed-bd86-4ced-8662-f41034648e8c"
35-
);
32+
public override Uri PreviewImageUri => new("https://cdn.lykos.ai/sm/packages/sdwebforge/preview.webp");
3633

3734
public override string MainBranch => "main";
3835
public override bool ShouldIgnoreReleases => true;

StabilityMatrix.Core/Models/Packages/SimpleSDXL.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ IPrerequisiteHelper prerequisiteHelper
2424
public override string Blurb =>
2525
"Enhanced version of Fooocus for SDXL, more suitable for Chinese and Cloud. Supports Flux.";
2626
public override string LicenseUrl => "https://github.com/metercai/SimpleSDXL/blob/SimpleSDXL/LICENSE";
27-
public override Uri PreviewImageUri =>
28-
new("https://github.com/user-attachments/assets/98715a4d-9f4a-4846-ae62-eb8d69793d31");
27+
public override Uri PreviewImageUri => new("https://cdn.lykos.ai/sm/packages/simplesdxl/preview.webp");
2928
public override PackageDifficulty InstallerSortOrder => PackageDifficulty.Expert;
3029
public override IEnumerable<SharedFolderMethod> AvailableSharedFolderMethods =>
3130
[SharedFolderMethod.Configuration, SharedFolderMethod.Symlink, SharedFolderMethod.None];

StabilityMatrix.Core/Models/Packages/VladAutomatic.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ IPrerequisiteHelper prerequisiteHelper
3636
public override string Blurb => "Stable Diffusion implementation with advanced features and modern UI";
3737
public override string LaunchCommand => "launch.py";
3838

39-
public override Uri PreviewImageUri =>
40-
new("https://github.com/vladmandic/automatic/raw/master/html/screenshot-modernui.jpg");
39+
public override Uri PreviewImageUri => new("https://cdn.lykos.ai/sm/packages/vladautomatic/preview.webp");
4140
public override bool ShouldIgnoreReleases => true;
4241

4342
public override SharedFolderMethod RecommendedSharedFolderMethod => SharedFolderMethod.Symlink;

StabilityMatrix.Core/Models/Packages/VoltaML.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ IPrerequisiteHelper prerequisiteHelper
2626
public override string Blurb => "Fast Stable Diffusion with support for AITemplate";
2727
public override string LaunchCommand => "main.py";
2828

29-
public override Uri PreviewImageUri =>
30-
new(
31-
"https://github.com/LykosAI/StabilityMatrix/assets/13956642/d9a908ed-5665-41a5-a380-98458f4679a8"
32-
);
29+
public override Uri PreviewImageUri => new("https://cdn.lykos.ai/sm/packages/voltaml/preview.webp");
3330

3431
public override PackageDifficulty InstallerSortOrder => PackageDifficulty.Simple;
3532

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
using Microsoft.Extensions.DependencyInjection;
2+
using Microsoft.Extensions.DependencyInjection.Extensions;
3+
using NSubstitute;
4+
using StabilityMatrix.Core.Helper;
5+
using StabilityMatrix.Core.Helper.Cache;
6+
using StabilityMatrix.Core.Models.Packages;
7+
using StabilityMatrix.Core.Python;
8+
using StabilityMatrix.Core.Services;
9+
10+
namespace StabilityMatrix.Tests.Models.Packages;
11+
12+
public static class PackageHelper
13+
{
14+
/// <summary>
15+
/// Get all BasePackage implementations in the assembly.
16+
/// </summary>
17+
public static IEnumerable<BasePackage> GetPackages()
18+
{
19+
var services = new ServiceCollection();
20+
services
21+
.AddSingleton(Substitute.For<IGithubApiCache>())
22+
.AddSingleton(Substitute.For<ISettingsManager>())
23+
.AddSingleton(Substitute.For<IDownloadService>())
24+
.AddSingleton(Substitute.For<IPyRunner>())
25+
.AddSingleton(Substitute.For<IPrerequisiteHelper>());
26+
27+
var assembly = typeof(BasePackage).Assembly;
28+
var packageTypes = assembly
29+
.GetTypes()
30+
.Where(t => t.IsSubclassOf(typeof(BasePackage)) && !t.IsAbstract)
31+
.Where(t => t != typeof(DankDiffusion) && t != typeof(UnknownPackage))
32+
.ToList();
33+
34+
// Register all package types
35+
services.TryAddEnumerable(
36+
packageTypes.Select(t => ServiceDescriptor.Singleton(typeof(BasePackage), t))
37+
);
38+
39+
var serviceProvider = services.BuildServiceProvider();
40+
return serviceProvider.GetServices<BasePackage>();
41+
}
42+
}

0 commit comments

Comments
 (0)