Solon v3.5.1

image - 也可以生成视频

</> markdown

虽然是叫图像模型,其实也可以生成视频。

1、使用示例

String apiUrl = "https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis";
ImageModel imageModel = ImageModel.of(apiUrl)
        .apiKey(apiKey)
        .model("wan2.2-i2v-plus")
        .headerSet("X-DashScope-Async", "enable")
        .build();

ImageResponse resp = imageModel.prompt(ImagePrompt.ofKeyValues(
                "prompt", "一只猫在草地上奔跑",
                "img_url", "https://cdn.translate.alibaba.com/r/wanx-demo-1.png")
        )
        .options(o -> o.optionAdd("resolution", "480P")
                .optionAdd("prompt_extend", true))
        .call();

log.warn("{}", resp.getImage().getUrl());