mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-25 08:25:07 +08:00
【修改todo】增加 sd 各种参数
This commit is contained in:
@ -123,9 +123,16 @@ public class AiImageServiceImpl implements AiImageService {
|
||||
.withResponseFormat("b64_json")
|
||||
.build();
|
||||
} else if (ObjUtil.equal(draw.getPlatform(), AiPlatformEnum.STABLE_DIFFUSION.getPlatform())) {
|
||||
// https://platform.stability.ai/docs/api-reference#tag/SDXL-and-SD1.6/operation/textToImage
|
||||
// https://platform.stability.ai/docs/api-reference#tag/Text-to-Image/operation/textToImage
|
||||
return StabilityAiImageOptions.builder().withModel(draw.getModel())
|
||||
.withHeight(draw.getHeight()).withWidth(draw.getWidth()) // TODO @范:各种参数的接入
|
||||
.withHeight(draw.getHeight()).withWidth(draw.getWidth())
|
||||
.withSeed(Long.valueOf(draw.getOptions().get("seed")))
|
||||
.withCfgScale(Float.valueOf(draw.getOptions().get("scale")))
|
||||
.withSteps(Integer.valueOf(draw.getOptions().get("steps")))
|
||||
.withSampler(String.valueOf(draw.getOptions().get("sampler")))
|
||||
.withStylePreset(String.valueOf(draw.getOptions().get("stylePreset")))
|
||||
.withClipGuidancePreset(String.valueOf(draw.getOptions().get("clipGuidancePreset")))
|
||||
.build();
|
||||
}
|
||||
throw new IllegalArgumentException("不支持的 AI 平台:" + draw.getPlatform());
|
||||
|
Reference in New Issue
Block a user