Implement custom portrait generation: update API, UI, and localization to support user-defined prompts for portraits, replacing half-body option with custom variant.
This commit is contained in:
@@ -5,7 +5,11 @@ namespace HSchool.Server.Game;
|
||||
/// <summary>Turns a person card into a Flux-style English prompt for SwarmUI.</summary>
|
||||
internal static class PortraitPromptBuilder
|
||||
{
|
||||
public static (string Positive, string Negative) Build(PersonCardResponse card, SwarmUiSettings settings, PortraitKind kind)
|
||||
public static (string Positive, string Negative) Build(
|
||||
PersonCardResponse card,
|
||||
SwarmUiSettings settings,
|
||||
PortraitKind kind,
|
||||
string? promptExtra = null)
|
||||
{
|
||||
var preset = settings.PresetFor(kind);
|
||||
var parts = new List<string>();
|
||||
@@ -15,7 +19,14 @@ internal static class PortraitPromptBuilder
|
||||
parts.Add(settings.Positive.Trim());
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(preset.Positive))
|
||||
if (kind == PortraitKind.Custom)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(promptExtra))
|
||||
{
|
||||
parts.Add(promptExtra.Trim());
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(preset.Positive))
|
||||
{
|
||||
parts.Add(preset.Positive.Trim());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user