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
All checks were successful
SonarQube Analysis / Build and analyze (push) Successful in 1m45s
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user