namespace HSchool.Content;
/// One LoRA or embedding a scene def may add to a portrait. Empty name is ignored.
public sealed class PromptLoraRef
{
public string Name { get; init; } = "";
public float Weight { get; init; } = 1f;
}
///
/// Optional portrait-prompt fragment on a thing, room, yard or precipitation. Missing or empty
/// means the def is silent — a chair does not name itself in the prompt.
///
public sealed class PromptContribution
{
public string Positive { get; init; } = "";
public string Negative { get; init; } = "";
public float Weight { get; init; } = 1f;
public IReadOnlyList PositiveLoras { get; init; } = [];
public IReadOnlyList NegativeLoras { get; init; } = [];
public IReadOnlyList PositiveEmbeddings { get; init; } = [];
public IReadOnlyList NegativeEmbeddings { get; init; } = [];
public bool IsSilent =>
string.IsNullOrWhiteSpace(Positive)
&& string.IsNullOrWhiteSpace(Negative)
&& !HasNamed(PositiveLoras)
&& !HasNamed(NegativeLoras)
&& !HasNamed(PositiveEmbeddings)
&& !HasNamed(NegativeEmbeddings);
private static bool HasNamed(IReadOnlyList entries)
{
foreach (var entry in entries)
{
if (!string.IsNullOrWhiteSpace(entry.Name))
{
return true;
}
}
return false;
}
}
/// Clear / rain / snow fragments on a climate preset. Outdoor portraits pick one.
public sealed class ClimatePromptSet
{
public PromptContribution? Clear { get; init; }
public PromptContribution? Rain { get; init; }
public PromptContribution? Snow { get; init; }
}