Implement progress monitoring for image generation in AIImages mod, enhancing user experience with real-time updates. Add localized strings for new features in English and Russian. Refactor UI components for better organization and clarity. Update AIImages.dll to reflect these changes.
This commit is contained in:
@@ -63,7 +63,14 @@ namespace AIImages.Services
|
||||
|
||||
StringBuilder prompt = new StringBuilder();
|
||||
|
||||
// 1. Художественный стиль
|
||||
// 1. Базовый пользовательский промпт (если указан) - идет первым
|
||||
if (!string.IsNullOrEmpty(settings.PositivePrompt))
|
||||
{
|
||||
prompt.Append(settings.PositivePrompt);
|
||||
prompt.Append(", ");
|
||||
}
|
||||
|
||||
// 2. Художественный стиль
|
||||
if (
|
||||
ArtStylePrompts.TryGetValue(settings.ArtStyle, out string stylePrompt)
|
||||
&& !string.IsNullOrEmpty(stylePrompt)
|
||||
@@ -73,14 +80,14 @@ namespace AIImages.Services
|
||||
prompt.Append(", ");
|
||||
}
|
||||
|
||||
// 2. Тип кадра - автоматически добавляем "portrait" для генерации персонажей
|
||||
// 3. Тип кадра - автоматически добавляем "portrait" для генерации персонажей
|
||||
prompt.Append("portrait, head and shoulders of ");
|
||||
|
||||
// 3. Базовое описание (возраст и пол)
|
||||
// 4. Базовое описание (возраст и пол)
|
||||
prompt.Append(GetAgeAndGenderDescription(appearanceData));
|
||||
prompt.Append(", ");
|
||||
|
||||
// 4. Тип тела
|
||||
// 5. Тип тела
|
||||
string bodyType = GetBodyTypeDescription(appearanceData.BodyType);
|
||||
if (!string.IsNullOrEmpty(bodyType))
|
||||
{
|
||||
@@ -88,14 +95,14 @@ namespace AIImages.Services
|
||||
prompt.Append(", ");
|
||||
}
|
||||
|
||||
// 5. Цвет кожи
|
||||
// 6. Цвет кожи
|
||||
string skinTone = ColorDescriptionService.GetSkinToneDescription(
|
||||
appearanceData.SkinColor
|
||||
);
|
||||
prompt.Append(skinTone);
|
||||
prompt.Append(", ");
|
||||
|
||||
// 6. Волосы
|
||||
// 7. Волосы
|
||||
string hairDescription = GetHairDescription(appearanceData);
|
||||
if (!string.IsNullOrEmpty(hairDescription))
|
||||
{
|
||||
@@ -103,7 +110,7 @@ namespace AIImages.Services
|
||||
prompt.Append(", ");
|
||||
}
|
||||
|
||||
// 7. Настроение и выражение на основе черт характера
|
||||
// 8. Настроение и выражение на основе черт характера
|
||||
string moodDescription = GetMoodFromTraits(appearanceData.Traits);
|
||||
if (!string.IsNullOrEmpty(moodDescription))
|
||||
{
|
||||
@@ -111,7 +118,7 @@ namespace AIImages.Services
|
||||
prompt.Append(", ");
|
||||
}
|
||||
|
||||
// 8. Одежда
|
||||
// 9. Одежда
|
||||
string apparelDescription = GetApparelDescription(appearanceData.Apparel);
|
||||
if (!string.IsNullOrEmpty(apparelDescription))
|
||||
{
|
||||
@@ -119,13 +126,6 @@ namespace AIImages.Services
|
||||
prompt.Append(", ");
|
||||
}
|
||||
|
||||
// 9. Базовый пользовательский промпт (если указан)
|
||||
if (!string.IsNullOrEmpty(settings.PositivePrompt))
|
||||
{
|
||||
prompt.Append(settings.PositivePrompt);
|
||||
prompt.Append(", ");
|
||||
}
|
||||
|
||||
// 10. Качественные теги
|
||||
prompt.Append(GetQualityTags(settings.ArtStyle));
|
||||
|
||||
@@ -136,7 +136,14 @@ namespace AIImages.Services
|
||||
{
|
||||
StringBuilder negativePrompt = new StringBuilder();
|
||||
|
||||
// Базовые негативные промпты
|
||||
// 1. Пользовательский негативный промпт (если указан) - идет первым
|
||||
if (!string.IsNullOrEmpty(settings.NegativePrompt))
|
||||
{
|
||||
negativePrompt.Append(settings.NegativePrompt);
|
||||
negativePrompt.Append(", ");
|
||||
}
|
||||
|
||||
// 2. Базовые негативные промпты
|
||||
negativePrompt.Append(
|
||||
"ugly, deformed, low quality, blurry, bad anatomy, worst quality, "
|
||||
);
|
||||
@@ -144,7 +151,7 @@ namespace AIImages.Services
|
||||
"mutated, disfigured, bad proportions, extra limbs, missing limbs, "
|
||||
);
|
||||
|
||||
// Специфичные для стиля негативы
|
||||
// 3. Специфичные для стиля негативы
|
||||
switch (settings.ArtStyle)
|
||||
{
|
||||
case ArtStyle.Realistic:
|
||||
@@ -159,12 +166,6 @@ namespace AIImages.Services
|
||||
break;
|
||||
}
|
||||
|
||||
// Пользовательский негативный промпт
|
||||
if (!string.IsNullOrEmpty(settings.NegativePrompt))
|
||||
{
|
||||
negativePrompt.Append(settings.NegativePrompt);
|
||||
}
|
||||
|
||||
return negativePrompt.ToString().Trim().TrimEnd(',');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user