Skip to content

Commit a713d8d

Browse files
mose-x.zmkevinlin09
authored andcommitted
Add the promptExtend and watermark parameters to the ImageSynthesisParam and VideoSynthesisParam
1 parent 9f1628e commit a713d8d

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

samples/ImageSynthesisUsage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public static void synCall() throws ApiException, NoApiKeyException {
3535
.model("wan2.2-t2i-flash")
3636
.prompt("一直森林中的白色的猫")
3737
.n(1)
38-
.parameter("prompt_extend", false)
39-
.parameter("watermark", true)
38+
.promptExtend(false)
39+
.watermark(true)
4040
.build();
4141

4242
ImageSynthesisResult result = is.syncCall(param);

src/main/java/com/alibaba/dashscope/aigc/imagesynthesis/ImageSynthesisParam.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public class ImageSynthesisParam extends HalfDuplexServiceParam {
4949
/** The extra parameters. */
5050
@GsonExclude @Singular protected Map<String, Object> extraInputs;
5151

52+
@Builder.Default private Boolean promptExtend = null;
53+
54+
@Builder.Default private Boolean watermark = null;
55+
5256
@Override
5357
public JsonObject getInput() {
5458
JsonObject jsonObject = new JsonObject();
@@ -105,6 +109,12 @@ public Map<String, Object> getParameters() {
105109
if (style != null) {
106110
params.put(STYLE, style);
107111
}
112+
if (promptExtend != null) {
113+
params.put(PROMPT_EXTEND, promptExtend);
114+
}
115+
if (watermark != null) {
116+
params.put(WATERMARK, watermark);
117+
}
108118

109119
params.putAll(super.getParameters());
110120
return params;

src/main/java/com/alibaba/dashscope/aigc/videosynthesis/VideoSynthesisParam.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ public class VideoSynthesisParam extends HalfDuplexServiceParam {
7373
/** The resolution of the generated video */
7474
@Builder.Default private String resolution = null;
7575

76+
@Builder.Default private Boolean promptExtend = null;
77+
78+
@Builder.Default private Boolean watermark = null;
79+
7680
/** The inputs of the model. */
7781
@Override
7882
public JsonObject getInput() {
@@ -143,6 +147,12 @@ public Map<String, Object> getParameters() {
143147
if (seed != null) {
144148
params.put(SEED, seed);
145149
}
150+
if (promptExtend != null) {
151+
params.put(PROMPT_EXTEND, promptExtend);
152+
}
153+
if (watermark != null) {
154+
params.put(WATERMARK, watermark);
155+
}
146156
params.putAll(super.getParameters());
147157
return params;
148158
}

src/main/java/com/alibaba/dashscope/utils/ApiKeywords.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,8 @@ public class ApiKeywords {
175175
public static final String RESOLUTION = "resolution";
176176

177177
public static final String WITH_AUDIO = "with_audio";
178+
179+
public static final String PROMPT_EXTEND = "prompt_extend";
180+
181+
public static final String WATERMARK = "watermark";
178182
}

0 commit comments

Comments
 (0)