mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-31 09:30:05 +08:00
【增加】增加通义万相
This commit is contained in:
parent
4c21ae32fe
commit
b6fead81f2
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"local": {
|
"local": {
|
||||||
"baseUrl": "http://127.0.0.1:48080/admin-api",
|
"baseUrl": "http://127.0.0.1:48080/admin-api",
|
||||||
"token": "test1",
|
"token": "Bearer 1c2ce60de96a4fb0bf5bea9604099a3d",
|
||||||
"adminTenentId": "1",
|
"adminTenentId": "1",
|
||||||
|
|
||||||
"appApi": "http://127.0.0.1:48080/app-api",
|
"appApi": "http://127.0.0.1:48080/app-api",
|
||||||
|
@ -23,6 +23,7 @@ import cn.iocoder.yudao.module.ai.dal.mysql.image.AiImageMapper;
|
|||||||
import cn.iocoder.yudao.module.ai.enums.image.AiImageStatusEnum;
|
import cn.iocoder.yudao.module.ai.enums.image.AiImageStatusEnum;
|
||||||
import cn.iocoder.yudao.module.ai.service.model.AiApiKeyService;
|
import cn.iocoder.yudao.module.ai.service.model.AiApiKeyService;
|
||||||
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
||||||
|
import com.alibaba.cloud.ai.tongyi.image.TongYiImagesOptions;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.ai.image.ImageModel;
|
import org.springframework.ai.image.ImageModel;
|
||||||
@ -136,6 +137,11 @@ public class AiImageServiceImpl implements AiImageService {
|
|||||||
.withStylePreset(String.valueOf(draw.getOptions().get("stylePreset")))
|
.withStylePreset(String.valueOf(draw.getOptions().get("stylePreset")))
|
||||||
.withClipGuidancePreset(String.valueOf(draw.getOptions().get("clipGuidancePreset")))
|
.withClipGuidancePreset(String.valueOf(draw.getOptions().get("clipGuidancePreset")))
|
||||||
.build();
|
.build();
|
||||||
|
} else if (ObjUtil.equal(draw.getPlatform(), AiPlatformEnum.TONG_YI_WAN_XIANG.getPlatform())) {
|
||||||
|
return TongYiImagesOptions.builder()
|
||||||
|
.withModel(draw.getModel()).withN(Integer.valueOf(draw.getOptions().get("n")))
|
||||||
|
.withHeight(draw.getHeight()).withWidth(draw.getWidth())
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
throw new IllegalArgumentException("不支持的 AI 平台:" + draw.getPlatform());
|
throw new IllegalArgumentException("不支持的 AI 平台:" + draw.getPlatform());
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,8 @@ public enum AiPlatformEnum {
|
|||||||
STABLE_DIFFUSION("StableDiffusion", "StableDiffusion"), // Stability AI
|
STABLE_DIFFUSION("StableDiffusion", "StableDiffusion"), // Stability AI
|
||||||
MIDJOURNEY("Midjourney", "Midjourney"), // Midjourney
|
MIDJOURNEY("Midjourney", "Midjourney"), // Midjourney
|
||||||
SUNO("Suno", "Suno"), // Suno AI
|
SUNO("Suno", "Suno"), // Suno AI
|
||||||
|
TONG_YI_WAN_XIANG("TongYiWanXiang", "通义万相"), // Suno AI
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user