Enhance AIImages mod with settings support and improved UI for image generation. Update localized strings in English and Russian for better clarity. Refactor code for better organization and maintainability.
This commit is contained in:
50
Source/AIImages/Models/GenerationRequest.cs
Normal file
50
Source/AIImages/Models/GenerationRequest.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
namespace AIImages.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Запрос на генерацию изображения
|
||||
/// </summary>
|
||||
public class GenerationRequest
|
||||
{
|
||||
public string Prompt { get; set; }
|
||||
public string NegativePrompt { get; set; }
|
||||
public int Steps { get; set; }
|
||||
public float CfgScale { get; set; }
|
||||
public int Width { get; set; }
|
||||
public int Height { get; set; }
|
||||
public string Sampler { get; set; }
|
||||
public int Seed { get; set; }
|
||||
public string Model { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Результат генерации изображения
|
||||
/// </summary>
|
||||
public class GenerationResult
|
||||
{
|
||||
public bool Success { get; set; }
|
||||
public byte[] ImageData { get; set; }
|
||||
public string ErrorMessage { get; set; }
|
||||
public string SavedPath { get; set; }
|
||||
public GenerationRequest Request { get; set; }
|
||||
|
||||
public static GenerationResult Failure(string error)
|
||||
{
|
||||
return new GenerationResult { Success = false, ErrorMessage = error };
|
||||
}
|
||||
|
||||
public static GenerationResult SuccessResult(
|
||||
byte[] imageData,
|
||||
string savedPath,
|
||||
GenerationRequest request
|
||||
)
|
||||
{
|
||||
return new GenerationResult
|
||||
{
|
||||
Success = true,
|
||||
ImageData = imageData,
|
||||
SavedPath = savedPath,
|
||||
Request = request,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user