diff --git a/pkg/service/import/imageContentImport.go b/pkg/service/import/imageContentImport.go index 42dd400..7470368 100644 --- a/pkg/service/import/imageContentImport.go +++ b/pkg/service/import/imageContentImport.go @@ -42,6 +42,7 @@ type excelData struct { Content string //内容 MediaAccountUuids []string MediaAccountNames []string + PhotoDpi string } type publishImageReq struct { ArtistName string //艺人 @@ -197,6 +198,7 @@ func readExcel(excelPath string) ([]excelData, error) { photoRequire := getCellValue(f, sheetName, i, 7) photoUrl := getCellValue(f, sheetName, i, 8) photoNumStr := getCellValue(f, sheetName, i, 9) + photoDpi := getCellValue(f, sheetName, i, 10) var num int if photoUrl == "" { //如果没有关联画作,数量必须有,需求必须有 //需求必须有 @@ -227,6 +229,7 @@ func readExcel(excelPath string) ([]excelData, error) { PhotoUrl: photoUrl, PhotoNum: num, LineNum: i, //行数 + PhotoDpi: photoDpi, } result = append(result, data) diff --git a/pkg/service/import/imageContentProcessor.go b/pkg/service/import/imageContentProcessor.go index d2544fe..862a6d9 100644 --- a/pkg/service/import/imageContentProcessor.go +++ b/pkg/service/import/imageContentProcessor.go @@ -650,9 +650,13 @@ func (p *BatchProcessor) generateImage(req *excelData) (string, error) { prompt += "\n请基于标题和内容生成单张图片,高质量,高分辨率。" prompt += "\n要求不能出现:低质量、残缺、人物正脸、多余的手指、乱码字符和文字、比例不良,场景以国内场景为主" + if req.PhotoDpi == "" { + req.PhotoDpi = "720*1280" + + } result, err := NewAiGenerator().TextToImage( prompt, - "1024*1024", + req.PhotoDpi, 1, ) if err != nil {