|
29 | 29 | using StabilityMatrix.Avalonia.ViewModels.PackageManager; |
30 | 30 | using StabilityMatrix.Avalonia.ViewModels.Progress; |
31 | 31 | using StabilityMatrix.Avalonia.ViewModels.Settings; |
| 32 | +using StabilityMatrix.Avalonia.Views.Dialogs; |
32 | 33 | using StabilityMatrix.Core.Api; |
33 | 34 | using StabilityMatrix.Core.Database; |
34 | 35 | using StabilityMatrix.Core.Extensions; |
|
37 | 38 | using StabilityMatrix.Core.Helper.Factory; |
38 | 39 | using StabilityMatrix.Core.Models; |
39 | 40 | using StabilityMatrix.Core.Models.Api; |
| 41 | +using StabilityMatrix.Core.Models.Api.CivitTRPC; |
40 | 42 | using StabilityMatrix.Core.Models.Api.Comfy; |
41 | 43 | using StabilityMatrix.Core.Models.Api.OpenArt; |
42 | 44 | using StabilityMatrix.Core.Models.Api.OpenModelsDb; |
@@ -734,6 +736,91 @@ public static UpdateSettingsViewModel UpdateSettingsViewModel |
734 | 736 | public static CheckpointBrowserViewModel CheckpointBrowserViewModel => |
735 | 737 | Services.GetRequiredService<CheckpointBrowserViewModel>(); |
736 | 738 |
|
| 739 | + public static CivitDetailsPageViewModel CivitDetailsPageViewModel => |
| 740 | + DialogFactory.Get<CivitDetailsPageViewModel>(vm => |
| 741 | + { |
| 742 | + vm.CivitModel = new CivitModel |
| 743 | + { |
| 744 | + Name = "BB95 Furry Mix", |
| 745 | + Description = "A furry mix of BB95", |
| 746 | + Stats = new CivitModelStats |
| 747 | + { |
| 748 | + Rating = 3.5, |
| 749 | + RatingCount = 24, |
| 750 | + ThumbsUpCount = 1337, |
| 751 | + DownloadCount = 100_000, |
| 752 | + }, |
| 753 | + Tags = ["base model", "furry", "animals", "photorealistic", "highly detailed", "yiff"], |
| 754 | + ModelVersions = |
| 755 | + [ |
| 756 | + new CivitModelVersion |
| 757 | + { |
| 758 | + Name = "v1.2.2-Inpainting", |
| 759 | + PublishedAt = DateTimeOffset.Now, |
| 760 | + Images = |
| 761 | + [ |
| 762 | + new CivitImage |
| 763 | + { |
| 764 | + Url = |
| 765 | + "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/244bc929-9bbc-44b2-8a26-7622a1669f4a/original=true,quality=90/00123-3430906941-1girl,%20hatsune%20miku,%20white%20pupils,%20power%20elements,%20microphone,%20vibrant%20blue%20color%20palette,%20abstract,abstract%20background,%20dreamli.jpeg", |
| 766 | + }, |
| 767 | + new CivitImage |
| 768 | + { |
| 769 | + Url = |
| 770 | + "https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/aa671302-496f-4dcc-839a-b75a70a7665e/original=true,quality=90/00136-4204868169-1girl,%20solo,%20long%20hair,%20city,%20boots,%20hands%20in%20pockets,%20coat,%20blonde%20hair,%20sky,%20planet,%20night,%20knee%20boots,%20building,%20star%20_(sky_).jpeg", |
| 771 | + }, |
| 772 | + ], |
| 773 | + Files = |
| 774 | + [ |
| 775 | + new CivitFile |
| 776 | + { |
| 777 | + Name = "bb95-v100-uwu-reallylongfilename-v1234576802.safetensors", |
| 778 | + Type = CivitFileType.Model, |
| 779 | + Metadata = new CivitFileMetadata |
| 780 | + { |
| 781 | + Format = CivitModelFormat.SafeTensor, |
| 782 | + Fp = "fp16", |
| 783 | + Size = "pruned", |
| 784 | + }, |
| 785 | + }, |
| 786 | + new CivitFile |
| 787 | + { |
| 788 | + Name = "bb95-v100-uwu-reallylongfilename-v1234576802-fp32.safetensors", |
| 789 | + Type = CivitFileType.Model, |
| 790 | + Metadata = new CivitFileMetadata |
| 791 | + { |
| 792 | + Format = CivitModelFormat.SafeTensor, |
| 793 | + Fp = "fp32", |
| 794 | + Size = "full", |
| 795 | + }, |
| 796 | + Hashes = new CivitFileHashes |
| 797 | + { |
| 798 | + BLAKE3 = |
| 799 | + "A7383E54F2E4570678B0F18545B2EB8FD95325DA76CCBA8467DBDBD481CF6B99", |
| 800 | + SHA256 = |
| 801 | + "BDB59BAC77D94AE7A55FF893170F9554C3F349E48A1B73C0C17C0B7C6F4D41A2", |
| 802 | + }, |
| 803 | + }, |
| 804 | + ], |
| 805 | + }, |
| 806 | + new CivitModelVersion { Name = "v1.2.0", PublishedAt = DateTimeOffset.Now.AddDays(-3) }, |
| 807 | + new CivitModelVersion { Name = "v1.1.0", PublishedAt = DateTimeOffset.Now.AddDays(-3) }, |
| 808 | + new CivitModelVersion { Name = "v1.0.0", PublishedAt = DateTimeOffset.Now.AddDays(-3) }, |
| 809 | + new CivitModelVersion { Name = "v0.9.0", PublishedAt = DateTimeOffset.Now.AddDays(-3) }, |
| 810 | + new CivitModelVersion { Name = "v0.8.0", PublishedAt = DateTimeOffset.Now.AddDays(-3) }, |
| 811 | + new CivitModelVersion { Name = "v0.7.0", PublishedAt = DateTimeOffset.Now.AddDays(-3) }, |
| 812 | + new CivitModelVersion { Name = "v0.6.0", PublishedAt = DateTimeOffset.Now.AddDays(-3) }, |
| 813 | + new CivitModelVersion { Name = "v0.5.0", PublishedAt = DateTimeOffset.Now.AddDays(-3) }, |
| 814 | + new CivitModelVersion { Name = "v0.4.0", PublishedAt = DateTimeOffset.Now.AddDays(-3) }, |
| 815 | + ], |
| 816 | + Creator = new CivitCreator |
| 817 | + { |
| 818 | + Image = "https://gravatar.com/avatar/fe74084ae8a081dc2283f5bde4736756ad?f=y&d=retro", |
| 819 | + Username = "creator-1", |
| 820 | + }, |
| 821 | + }; |
| 822 | + }); |
| 823 | + |
737 | 824 | public static SelectModelVersionViewModel SelectModelVersionViewModel => |
738 | 825 | DialogFactory.Get<SelectModelVersionViewModel>(vm => |
739 | 826 | { |
@@ -1215,6 +1302,43 @@ public static CompletionList SampleCompletionList |
1215 | 1302 | vm.FileNameText = "TextToImage_00041.png"; |
1216 | 1303 | vm.FileSizeText = "2.4 MB"; |
1217 | 1304 | vm.ImageSizeText = "1280 x 1792"; |
| 1305 | + |
| 1306 | + vm.CivitImageMetadata = new CivitImageGenerationDataResponse |
| 1307 | + { |
| 1308 | + Metadata = new CivitImageMetadata |
| 1309 | + { |
| 1310 | + Prompt = |
| 1311 | + "closeup photp of a red haired anthro wolf female,\n holding an apple, wearing medieval drees is eating a apple, wolf ears, wolf tail with white tip\n,anthro,furry", |
| 1312 | + NegativePrompt = "Bad quality , watermark", |
| 1313 | + CfgScale = 2.5d, |
| 1314 | + Steps = 30, |
| 1315 | + Sampler = "DPM++ SDE", |
| 1316 | + Seed = 255842256659122, |
| 1317 | + Model = "RatatoskrIllustriousV2.3", |
| 1318 | + Height = 1152, |
| 1319 | + Width = 768, |
| 1320 | + Scheduler = "normal", |
| 1321 | + }, |
| 1322 | + Resources = |
| 1323 | + [ |
| 1324 | + new CivitImageResource |
| 1325 | + { |
| 1326 | + ModelName = "noobAI XL (NAI-XL) really long name example with even more words", |
| 1327 | + ModelId = 1337, |
| 1328 | + VersionId = 1234, |
| 1329 | + VersionName = "Epsilon-pred 1.1-Version", |
| 1330 | + ModelType = "Checkpoint", |
| 1331 | + }, |
| 1332 | + ], |
| 1333 | + }; |
| 1334 | + |
| 1335 | + vm.CivitImageMetadata.OtherMetadata = new Dictionary<string, string> |
| 1336 | + { |
| 1337 | + ["CFG"] = "2.5", |
| 1338 | + ["Steps"] = "30", |
| 1339 | + ["Sampler"] = "DPM++ SDE", |
| 1340 | + ["Seed"] = "255842256659122", |
| 1341 | + }; |
1218 | 1342 | }); |
1219 | 1343 |
|
1220 | 1344 | public static DownloadResourceViewModel DownloadResourceViewModel => |
@@ -1268,6 +1392,42 @@ public static CompletionList SampleCompletionList |
1268 | 1392 | .ToArray(); |
1269 | 1393 | }); |
1270 | 1394 |
|
| 1395 | + public static ConfirmBulkDownloadDialogViewModel ConfirmBulkDownloadDialogViewModel => |
| 1396 | + DialogFactory.Get<ConfirmBulkDownloadDialogViewModel>(vm => |
| 1397 | + { |
| 1398 | + vm.Model = new CivitModel |
| 1399 | + { |
| 1400 | + Name = "Test Model", |
| 1401 | + ModelVersions = Enumerable |
| 1402 | + .Range(1, 64) |
| 1403 | + .Select(i => new CivitModelVersion |
| 1404 | + { |
| 1405 | + Name = $"Version {i}", |
| 1406 | + Files = |
| 1407 | + [ |
| 1408 | + new CivitFile |
| 1409 | + { |
| 1410 | + Name = $"test-file-{i}.safetensors", |
| 1411 | + Type = CivitFileType.Model, |
| 1412 | + Metadata = new CivitFileMetadata |
| 1413 | + { |
| 1414 | + Format = CivitModelFormat.SafeTensor, |
| 1415 | + Fp = "fp16", |
| 1416 | + Size = "pruned", |
| 1417 | + }, |
| 1418 | + SizeKb = new Random().Next(1, 10) * 1024 * 1024, |
| 1419 | + }, |
| 1420 | + ], |
| 1421 | + }) |
| 1422 | + .ToList(), |
| 1423 | + }; |
| 1424 | + |
| 1425 | + vm.FpTypePreference = CivitModelFpType.fp16; |
| 1426 | + vm.IncludeVae = true; |
| 1427 | + |
| 1428 | + return vm; |
| 1429 | + }); |
| 1430 | + |
1271 | 1431 | public static SponsorshipPromptViewModel SponsorshipPromptViewModel => |
1272 | 1432 | DialogFactory.Get<SponsorshipPromptViewModel>(vm => { }); |
1273 | 1433 |
|
|
0 commit comments