Refactor AIImages mod to improve UI layout and scrolling functionality in the character information display. Update prompt generation logic to enhance gender and age representation. Adjust content height calculations for better visual consistency. Update AIImages.dll to reflect these changes.
This commit is contained in:
@@ -59,14 +59,19 @@ namespace AIImages.Services
|
||||
prompt.Append(", ");
|
||||
}
|
||||
|
||||
// 3. Тип кадра - автоматически добавляем "portrait" для генерации персонажей
|
||||
prompt.Append("portrait, head and shoulders of ");
|
||||
// 3. Тип кадра
|
||||
prompt.Append("portrait, ");
|
||||
|
||||
// 4. Базовое описание (возраст и пол)
|
||||
prompt.Append(GetAgeAndGenderDescription(appearanceData));
|
||||
// 4. Пол персонажа (в формате anime/SD теги)
|
||||
string genderTag = appearanceData.Gender == Gender.Female ? "1girl" : "1boy";
|
||||
prompt.Append(genderTag);
|
||||
prompt.Append(", ");
|
||||
|
||||
// 5. Тип тела
|
||||
// 5. Точный возраст
|
||||
prompt.Append($"{appearanceData.Age} y.o.");
|
||||
prompt.Append(", ");
|
||||
|
||||
// 6. Тип тела
|
||||
string bodyType = GetBodyTypeDescription(appearanceData.BodyType);
|
||||
if (!string.IsNullOrEmpty(bodyType))
|
||||
{
|
||||
@@ -74,14 +79,14 @@ namespace AIImages.Services
|
||||
prompt.Append(", ");
|
||||
}
|
||||
|
||||
// 6. Цвет кожи
|
||||
// 7. Цвет кожи
|
||||
string skinTone = ColorDescriptionService.GetSkinToneDescription(
|
||||
appearanceData.SkinColor
|
||||
);
|
||||
prompt.Append(skinTone);
|
||||
prompt.Append(", ");
|
||||
|
||||
// 7. Волосы
|
||||
// 8. Волосы
|
||||
string hairDescription = GetHairDescription(appearanceData);
|
||||
if (!string.IsNullOrEmpty(hairDescription))
|
||||
{
|
||||
@@ -89,7 +94,7 @@ namespace AIImages.Services
|
||||
prompt.Append(", ");
|
||||
}
|
||||
|
||||
// 8. Настроение и выражение на основе черт характера
|
||||
// 9. Настроение и выражение на основе черт характера
|
||||
string moodDescription = GetMoodFromTraits(appearanceData.Traits);
|
||||
if (!string.IsNullOrEmpty(moodDescription))
|
||||
{
|
||||
@@ -97,7 +102,7 @@ namespace AIImages.Services
|
||||
prompt.Append(", ");
|
||||
}
|
||||
|
||||
// 9. Одежда
|
||||
// 10. Одежда
|
||||
string apparelDescription = GetApparelDescription(appearanceData.Apparel);
|
||||
if (!string.IsNullOrEmpty(apparelDescription))
|
||||
{
|
||||
@@ -105,7 +110,7 @@ namespace AIImages.Services
|
||||
prompt.Append(", ");
|
||||
}
|
||||
|
||||
// 10. Качественные теги
|
||||
// 11. Качественные теги
|
||||
prompt.Append(GetQualityTags(settings.ArtStyleDefName));
|
||||
|
||||
return prompt.ToString().Trim().TrimEnd(',');
|
||||
@@ -179,27 +184,6 @@ namespace AIImages.Services
|
||||
return description.ToString();
|
||||
}
|
||||
|
||||
private string GetAgeAndGenderDescription(PawnAppearanceData data)
|
||||
{
|
||||
string ageGroup = data.Age switch
|
||||
{
|
||||
< 18 => "young",
|
||||
< 25 => "young adult",
|
||||
< 35 => "adult",
|
||||
< 50 => "middle-aged",
|
||||
< 65 => "mature",
|
||||
_ => "elderly",
|
||||
};
|
||||
|
||||
string genderLabel = data.Gender switch
|
||||
{
|
||||
Gender.Male => "man",
|
||||
Gender.Female => "woman",
|
||||
_ => "person",
|
||||
};
|
||||
return $"{ageGroup} {genderLabel}";
|
||||
}
|
||||
|
||||
private string GetBodyTypeDescription(string bodyType)
|
||||
{
|
||||
if (string.IsNullOrEmpty(bodyType))
|
||||
|
||||
Reference in New Issue
Block a user