Merge branch 'review/off-queue-portraits'
This commit is contained in:
@@ -13,6 +13,7 @@ public class SwarmUiSettingsStoreTests
|
||||
Assert.Equal("child", profile.PresetId);
|
||||
Assert.Equal(SwarmUiModelDefinition.DreamShaperId, profile.Model);
|
||||
Assert.Equal(4, profile.Steps);
|
||||
Assert.Equal(2, profile.CfgScale);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -24,6 +25,54 @@ public class SwarmUiSettingsStoreTests
|
||||
Assert.Equal("default", profile.PresetId);
|
||||
Assert.Equal(SwarmUiModelDefinition.BabesId, profile.Model);
|
||||
Assert.Equal(7, profile.Steps);
|
||||
Assert.Equal(1.5, profile.CfgScale);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Resolve_WithoutOverride_TakesStepsAndCfgFromModel()
|
||||
{
|
||||
var config = new SwarmUiConfigFile
|
||||
{
|
||||
Models =
|
||||
[
|
||||
new SwarmUiModelDefinition { Id = "m.safetensors", Steps = 9, CfgScale = 2.25 },
|
||||
],
|
||||
Presets =
|
||||
[
|
||||
new SwarmUiPresetDefinition
|
||||
{
|
||||
Id = "default",
|
||||
Label = "Default",
|
||||
Model = "m.safetensors",
|
||||
Avatar = new SwarmUiKindPreset { Width = 512, Height = 512 },
|
||||
Custom = new SwarmUiKindPreset { Width = 512, Height = 512 },
|
||||
FullBody = new SwarmUiKindPreset { Width = 512, Height = 512 },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
var profile = config.Resolve(20, PortraitKind.Avatar);
|
||||
|
||||
Assert.Equal(9, profile.Steps);
|
||||
Assert.Equal(2.25, profile.CfgScale);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ToProfile_JoinsModelAndPresetNegative()
|
||||
{
|
||||
var model = new SwarmUiModelDefinition { Id = "m.safetensors", Negative = "model-neg" };
|
||||
var preset = new SwarmUiPresetDefinition
|
||||
{
|
||||
Id = "default",
|
||||
Label = "Default",
|
||||
Model = "m.safetensors",
|
||||
Negative = "preset-neg",
|
||||
Avatar = new SwarmUiKindPreset { Width = 512, Height = 512 },
|
||||
};
|
||||
|
||||
var profile = preset.ToProfile(PortraitKind.Avatar, model);
|
||||
|
||||
Assert.Equal("model-neg, preset-neg", profile.Negative);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user