using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace XPrintServer.Api.Entities.Vol
{
    public class VolTxt2ImgRequestInfo
    {
        /// <summary>
        /// 算法名称
        /// </summary>
        /// <remarks>
        /// 取固定值为high_aes_general_v30l_zt2i
        /// </remarks>

        [JsonPropertyName("req_key")]
        [Required]
        public string ReqKey { get; set; } = "high_aes_general_v30l_zt2i";


        /// <summary>
        /// 用于生成图像的提示词，中英文均可输入
        /// </summary>
        [JsonPropertyName("prompt")]
        [Required]
        public string Prompt { get; set; } = string.Empty;


        /// <summary>
        /// 开启文本扩写
        /// </summary>
        /// <remarks>
        /// 会针对输入prompt进行扩写优化，如果输入prompt较短建议开启，如果输入prompt较长建议关闭
        /// 默认值：false
        /// </remarks>
        [JsonPropertyName("use_pre_llm")]
        public bool UsePreLlm { get; set; } = false;

        /// <summary>
        /// 随机种子
        /// </summary>
        /// <remarks>
        /// 作为确定扩散初始状态的基础，默认-1（随机）。
        /// 若随机种子为相同正整数且其他参数均一致，则生成图片极大概率效果一致
        /// 默认值：-1
        /// </remarks>
        [JsonPropertyName("seed")]
        public int Seed { get; set; } = -1;

        [JsonPropertyName("scale")]
        /// <summary>
        /// 影响文本描述的程度
        /// </summary>
        /// <remarks>
        /// 默认值：2.5
        /// 取值范围：[1, 10]
        /// </remarks>
        [Range(1, 10)]
        public float Scale { get; set; } = 2.5f;

        /// <summary>
        /// 生成图像的宽
        /// </summary>
        /// <remarks>
        /// 默认值：1328
        /// 取值范围：[512, 2048]
        /// </remarks>
        [JsonPropertyName("width")]
        [Range(512, 2048)]
        public int Width { get; set; } = 1328;

        /// <summary>
        /// 生成图像的高
        /// </summary>
        /// <remarks>
        /// 默认值：1328
        /// 取值范围：[512, 2048]
        /// </remarks>
        [JsonPropertyName("height")]
        [Range(512, 2048)]
        public int Height { get; set; } = 1328;

        /// <summary>
        /// 输出是否返回图片链接
        /// </summary>
        /// <remarks>
        /// 链接有效期为24小时
        /// </remarks>
        [JsonPropertyName("return_url")]
        public bool ReturnUrl { get; set; }

        /// <summary>
        /// 水印信息
        /// </summary>
        [JsonPropertyName("logo_info")]
        public LogoInfo LogoInfo { get; set; } = new LogoInfo();
    }
}
