Skip to content

Commit 9dd9fda

Browse files
authored
Merge pull request #1045 from ionite34/hidream-and-filter-toggle
Add option to disable filtering of extra networks & add HiDream suppo…
2 parents cc6be19 + e9ddd4b commit 9dd9fda

File tree

12 files changed

+304
-13
lines changed

12 files changed

+304
-13
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
1111
- Added Accelerated Model Discovery (Beta) (⚡ icon in Civitai Browser) for Insider+ supporters. Utilizes an optimized connection for dramatically faster, more responsive browsing of online model repositories.
1212
- Added Undo/Redo commands to text editor context menus
1313
- Added Prompt Amplifier to Inference - click the magic wand 🪄 in the prompt editor to expand and enrich your ideas. Tailor the vibe with the ‘Feel’ selector and watch as your generations come to life with extra detail, coherence, and flair!
14+
- (pre.2 re-release) Added support for HiDream in Inference - see [ComfyUI Examples](https://comfyanonymous.github.io/ComfyUI_examples/hidream/) for more details
15+
- (pre.2 re-release) Added toggle for filtering Inference Extra Networks by base model
1416
### Changed
1517
- Updated install for kohya_ss to support RTX 5000-series GPUs
1618
- (pre.2 re-release) Merged Inference GGUF workflows into the UNet model loader option (no longer need to choose GGUF separately)

StabilityMatrix.Avalonia/Assets/hf-packages.json

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,33 @@
986986
],
987987
"LicenseType": "Apache 2.0"
988988
},
989+
{
990+
"ModelCategory": "Clip",
991+
"ModelName": "CLIP G (HiDream)",
992+
"RepositoryPath": "Comfy-Org/HiDream-I1_ComfyUI",
993+
"Files": [
994+
"split_files/text_encoders/clip_g_hidream.safetensors"
995+
],
996+
"LicenseType": "MIT"
997+
},
998+
{
999+
"ModelCategory": "Clip",
1000+
"ModelName": "CLIP L (HiDream)",
1001+
"RepositoryPath": "Comfy-Org/HiDream-I1_ComfyUI",
1002+
"Files": [
1003+
"split_files/text_encoders/clip_l_hidream.safetensors"
1004+
],
1005+
"LicenseType": "MIT"
1006+
},
1007+
{
1008+
"ModelCategory": "Clip",
1009+
"ModelName": "Llama 3.1 8b Instruct fp8",
1010+
"RepositoryPath": "Comfy-Org/HiDream-I1_ComfyUI",
1011+
"Files": [
1012+
"split_files/text_encoders/split_files/text_encoders/llama_3.1_8b_instruct_fp8_scaled.safetensors"
1013+
],
1014+
"LicenseType": "Llama3.1"
1015+
},
9891016
{
9901017
"ModelCategory": "Unet",
9911018
"ModelName": "Wan 2.1 I2V 480p bf16",
@@ -1058,6 +1085,60 @@
10581085
],
10591086
"LicenseType": "Apache 2.0"
10601087
},
1088+
{
1089+
"ModelCategory": "Unet",
1090+
"ModelName": "HiDream I1 Dev bf16",
1091+
"RepositoryPath": "Comfy-Org/HiDream-I1_ComfyUI",
1092+
"Files": [
1093+
"split_files/diffusion_models/hidream_i1_dev_bf16.safetensors"
1094+
],
1095+
"LicenseType": "MIT"
1096+
},
1097+
{
1098+
"ModelCategory": "Unet",
1099+
"ModelName": "HiDream I1 Dev fp8",
1100+
"RepositoryPath": "Comfy-Org/HiDream-I1_ComfyUI",
1101+
"Files": [
1102+
"split_files/diffusion_models/hidream_i1_dev_fp8.safetensors"
1103+
],
1104+
"LicenseType": "MIT"
1105+
},
1106+
{
1107+
"ModelCategory": "Unet",
1108+
"ModelName": "HiDream I1 Fast bf16",
1109+
"RepositoryPath": "Comfy-Org/HiDream-I1_ComfyUI",
1110+
"Files": [
1111+
"split_files/diffusion_models/hidream_i1_fast_bf16.safetensors"
1112+
],
1113+
"LicenseType": "MIT"
1114+
},
1115+
{
1116+
"ModelCategory": "Unet",
1117+
"ModelName": "HiDream I1 Fast fp8",
1118+
"RepositoryPath": "Comfy-Org/HiDream-I1_ComfyUI",
1119+
"Files": [
1120+
"split_files/diffusion_models/hidream_i1_fast_fp8.safetensors"
1121+
],
1122+
"LicenseType": "MIT"
1123+
},
1124+
{
1125+
"ModelCategory": "Unet",
1126+
"ModelName": "HiDream I1 Full fp16",
1127+
"RepositoryPath": "Comfy-Org/HiDream-I1_ComfyUI",
1128+
"Files": [
1129+
"split_files/diffusion_models/hidream_i1_full_fp16.safetensors"
1130+
],
1131+
"LicenseType": "MIT"
1132+
},
1133+
{
1134+
"ModelCategory": "Unet",
1135+
"ModelName": "HiDream I1 Full fp8",
1136+
"RepositoryPath": "Comfy-Org/HiDream-I1_ComfyUI",
1137+
"Files": [
1138+
"split_files/diffusion_models/hidream_i1_full_fp8.safetensors"
1139+
],
1140+
"LicenseType": "MIT"
1141+
},
10611142
{
10621143
"ModelCategory": "Vae",
10631144
"ModelName": "Flux.1 VAE",
@@ -1075,5 +1156,14 @@
10751156
"split_files/vae/wan_2.1_vae.safetensors"
10761157
],
10771158
"LicenseType": "Apache 2.0"
1159+
},
1160+
{
1161+
"ModelCategory": "Vae",
1162+
"ModelName": "HiDream I1 VAE",
1163+
"RepositoryPath": "Comfy-Org/HiDream-I1_ComfyUI",
1164+
"Files": [
1165+
"split_files/vae/ae.safetensors"
1166+
],
1167+
"LicenseType": "MIT"
10781168
}
10791169
]

StabilityMatrix.Avalonia/Controls/Inference/ModelCard.axaml

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<sg:SpacedGrid
4848
ColumnDefinitions="Auto,*,Auto"
4949
ColumnSpacing="8"
50-
RowDefinitions="*,*,*,*,*,*,*,*,*,*,*"
50+
RowDefinitions="*,*,*,*,*,*,*,*,*,*,*,*,*"
5151
RowSpacing="0">
5252
<!-- Model -->
5353
<TextBlock
@@ -317,9 +317,15 @@
317317
Grid.Column="0"
318318
Margin="0,8,0,0"
319319
VerticalAlignment="Center"
320-
IsVisible="{Binding IsSd3Clip}"
321320
Text="Encoder 3"
322-
TextAlignment="Left" />
321+
TextAlignment="Left">
322+
<TextBlock.IsVisible>
323+
<MultiBinding Converter="{x:Static BoolConverters.Or}">
324+
<Binding Path="IsSd3Clip" />
325+
<Binding Path="IsHiDreamClip" />
326+
</MultiBinding>
327+
</TextBlock.IsVisible>
328+
</TextBlock>
323329

324330
<controls:BetterDownloadableComboBox
325331
Grid.Row="9"
@@ -328,14 +334,62 @@
328334
Margin="0,8,0,0"
329335
Padding="8,6,4,6"
330336
HorizontalAlignment="Stretch"
331-
IsVisible="{Binding IsSd3Clip}"
332337
ItemsSource="{Binding ClientManager.ClipModels}"
333338
SelectedItem="{Binding SelectedClip3}"
339+
Theme="{StaticResource BetterComboBoxHybridModelTheme}">
340+
<controls:BetterDownloadableComboBox.IsVisible>
341+
<MultiBinding Converter="{x:Static BoolConverters.Or}">
342+
<Binding Path="IsSd3Clip" />
343+
<Binding Path="IsHiDreamClip" />
344+
</MultiBinding>
345+
</controls:BetterDownloadableComboBox.IsVisible>
346+
</controls:BetterDownloadableComboBox>
347+
348+
<!-- CLIP 4 -->
349+
<TextBlock
350+
Grid.Row="10"
351+
Grid.Column="0"
352+
Margin="0,8,0,0"
353+
VerticalAlignment="Center"
354+
IsVisible="{Binding IsHiDreamClip}"
355+
Text="Encoder 4"
356+
TextAlignment="Left" />
357+
358+
<controls:BetterDownloadableComboBox
359+
Grid.Row="10"
360+
Grid.Column="1"
361+
Grid.ColumnSpan="2"
362+
Margin="0,8,0,0"
363+
Padding="8,6,4,6"
364+
HorizontalAlignment="Stretch"
365+
IsVisible="{Binding IsHiDreamClip}"
366+
ItemsSource="{Binding ClientManager.ClipModels}"
367+
SelectedItem="{Binding SelectedClip4}"
334368
Theme="{StaticResource BetterComboBoxHybridModelTheme}" />
335369

370+
<TextBlock
371+
Grid.Row="11"
372+
Grid.Column="0"
373+
Margin="0,8,0,0"
374+
VerticalAlignment="Center"
375+
IsVisible="{Binding IsHiDreamClip}"
376+
Text="Shift" />
377+
<ui:NumberBox
378+
Grid.Row="11"
379+
Grid.Column="1"
380+
Grid.ColumnSpan="2"
381+
Margin="0,8,0,0"
382+
HorizontalAlignment="Stretch"
383+
IsVisible="{Binding IsHiDreamClip}"
384+
SelectionHighlightColor="Transparent"
385+
SimpleNumberFormat="F2"
386+
SmallChange="0.25"
387+
SpinButtonPlacementMode="Inline"
388+
Value="{Binding Shift}" />
389+
336390
<!-- Extra Networks -->
337391
<Panel
338-
Grid.Row="10"
392+
Grid.Row="12"
339393
Grid.Column="0"
340394
Grid.ColumnSpan="3"
341395
IsVisible="{Binding IsExtraNetworksEnabled}">

StabilityMatrix.Avalonia/ViewModels/CheckpointBrowser/HuggingFacePageViewModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ private async Task ImportSelected()
156156
$"https://huggingface.co/{viewModel.Item.RepositoryPath}/resolve/main/{file}?download=true";
157157
var sharedFolderType = viewModel.Item.ModelCategory.ConvertTo<SharedFolderType>();
158158
var fileName = Path.GetFileName(file);
159+
160+
if (
161+
fileName.Equals("ae.safetensors", StringComparison.OrdinalIgnoreCase)
162+
&& viewModel.Item.ModelName == "HiDream I1 VAE"
163+
)
164+
{
165+
fileName = "hidream_vae.safetensors";
166+
}
167+
159168
var downloadPath = new FilePath(
160169
Path.Combine(
161170
Design.IsDesignMode ? string.Empty : settingsManager.ModelsDirectory,
@@ -164,6 +173,7 @@ private async Task ImportSelected()
164173
fileName
165174
)
166175
);
176+
167177
downloadPath.Directory?.Create();
168178
var download = trackedDownloadService.NewDownload(url, downloadPath);
169179
download.ProgressUpdate += DownloadOnProgressUpdate;

StabilityMatrix.Avalonia/ViewModels/HuggingFacePage/HuggingfaceItemViewModel.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ public partial class HuggingfaceItemViewModel : ViewModelBase
2929
ModelsDir,
3030
Item.ModelCategory.ConvertTo<SharedFolderType>().ToString(),
3131
Item.Subfolder ?? string.Empty,
32-
Path.GetFileName(Item.Files[0])
32+
Path.GetFileName(Item.Files[0]).Equals("ae.safetensors")
33+
&& Item.ModelName.Equals("HiDream I1 VAE")
34+
? "hidream_vae.safetensors"
35+
: Path.GetFileName(Item.Files[0])
3336
)
3437
);
3538

StabilityMatrix.Avalonia/ViewModels/Inference/ExtraNetworkCardViewModel.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
using StabilityMatrix.Core.Attributes;
1414
using StabilityMatrix.Core.Extensions;
1515
using StabilityMatrix.Core.Models;
16+
using StabilityMatrix.Core.Services;
17+
1618
#pragma warning disable CS0657 // Not a valid attribute location for this declaration
1719

1820
namespace StabilityMatrix.Avalonia.ViewModels.Inference;
@@ -22,6 +24,7 @@ namespace StabilityMatrix.Avalonia.ViewModels.Inference;
2224
[RegisterTransient<ExtraNetworkCardViewModel>]
2325
public partial class ExtraNetworkCardViewModel : DisposableLoadableViewModelBase
2426
{
27+
private readonly ISettingsManager settingsManager;
2528
public const string ModuleKey = "ExtraNetwork";
2629

2730
/// <summary>
@@ -60,8 +63,9 @@ public partial class ExtraNetworkCardViewModel : DisposableLoadableViewModelBase
6063
public readonly SourceCache<HybridModelFile, string> LoraModelsSource = new(p => p.GetId());
6164

6265
/// <inheritdoc/>
63-
public ExtraNetworkCardViewModel(IInferenceClientManager clientManager)
66+
public ExtraNetworkCardViewModel(IInferenceClientManager clientManager, ISettingsManager settingsManager)
6467
{
68+
this.settingsManager = settingsManager;
6569
ClientManager = clientManager;
6670

6771
var filterPredicate = this.WhenPropertyChanged(vm => vm.SelectedBaseModel)
@@ -85,6 +89,13 @@ public ExtraNetworkCardViewModel(IInferenceClientManager clientManager)
8589
.Subscribe()
8690
);
8791

92+
AddDisposable(
93+
settingsManager.RegisterPropertyChangedHandler(
94+
s => s.FilterExtraNetworksByBaseModel,
95+
_ => LoraModelsSource.Refresh()
96+
)
97+
);
98+
8899
LoraModelsSource.EditDiff(clientManager.LoraModels);
89100
}
90101

@@ -138,6 +149,9 @@ private void CopyTriggerWords()
138149

139150
private bool FilterCompatibleLoras(HybridModelFile? lora)
140151
{
152+
if (!settingsManager.Settings.FilterExtraNetworksByBaseModel)
153+
return true;
154+
141155
return SelectedBaseModel is null
142156
|| lora?.Local?.ConnectedModelInfo == null
143157
|| SelectedBaseModel.Local?.ConnectedModelInfo == null

0 commit comments

Comments
 (0)