Add log entry functionality to AIImages. Introduce event description handling in PawnAppearanceData and update prompt generation logic to include event context. Enhance Window_AIImage to display log entries and allow image generation from log events, improving user interaction and character representation.
All checks were successful
SonarQube Analysis / Build and analyze (push) Successful in 1m45s

This commit is contained in:
Leonid Pershin
2025-11-01 14:27:14 +03:00
parent 5c9887c669
commit 59abcb11b8
8 changed files with 468 additions and 9 deletions

View File

@@ -119,6 +119,33 @@ namespace AIImages.Services
return prompt.ToString().Trim().TrimEnd(',');
}
/// <summary>
/// Генерирует позитивный промпт на основе данных о персонаже и события
/// </summary>
public string GeneratePositivePromptWithEvent(
PawnAppearanceData appearanceData,
StableDiffusionSettings settings,
string eventDescription
)
{
if (appearanceData == null)
return "portrait of a person";
// Генерируем базовый промпт
string basePrompt = GeneratePositivePrompt(appearanceData, settings);
// Добавляем описание события, если оно есть
if (!string.IsNullOrEmpty(eventDescription))
{
StringBuilder prompt = new StringBuilder(basePrompt);
prompt.Append(", ");
prompt.Append(eventDescription.ToLower());
return prompt.ToString();
}
return basePrompt;
}
public string GenerateNegativePrompt(StableDiffusionSettings settings)
{
StringBuilder negativePrompt = new StringBuilder();