Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ The official Java library for accessing ModelArk on Volcengine and BytePlus. It
<dependency>
<groupId>com.volcengine</groupId>
<artifactId>ark-runtime</artifactId>
<version>0.5.0</version>
<version>0.6.0</version>
</dependency>
```

### Gradle

```groovy
implementation 'com.volcengine:ark-runtime:0.5.0'
implementation 'com.volcengine:ark-runtime:0.6.0'
```

## Choose Volcengine or BytePlus
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.0
0.6.0
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.volcengine</groupId>
<artifactId>ark-runtime</artifactId>
<version>0.5.0</version>
<version>0.6.0</version>
<packaging>jar</packaging>

<name>ark-runtime</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
// SPDX-License-Identifier: Apache-2.0

/*
* Ark Image Generation API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


package com.volcengine.ark.runtime.models.images;


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
* Background of the generated image.
*/
public enum Background {

OPAQUE("opaque"),

TRANSPARENT("transparent");

private String value;

Background(String value) {
this.value = value;
}

@JsonValue
public String getValue() {
return value;
}

@Override
public String toString() {
return String.valueOf(value);
}

@JsonCreator
public static Background fromValue(String value) {
for (Background b : Background.values()) {
if (b.value.equalsIgnoreCase(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
CreateImageGenerationRequest.JSON_PROPERTY_OPTIMIZE_PROMPT_OPTIONS,
CreateImageGenerationRequest.JSON_PROPERTY_TOOLS,
CreateImageGenerationRequest.JSON_PROPERTY_OUTPUT_FORMAT,
CreateImageGenerationRequest.JSON_PROPERTY_BACKGROUND,
CreateImageGenerationRequest.JSON_PROPERTY_LAYER_DECOMPOSITION
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0")
Expand All @@ -51,12 +52,12 @@ public class CreateImageGenerationRequest {
private String model;

public static final String JSON_PROPERTY_PROMPT = "prompt";
@javax.annotation.Nonnull
@javax.annotation.Nullable
private String prompt;

public static final String JSON_PROPERTY_IMAGE = "image";
@javax.annotation.Nullable
private List<String> image;
private CreateImageGenerationRequestImage image;

public static final String JSON_PROPERTY_STREAM = "stream";
@javax.annotation.Nullable
Expand Down Expand Up @@ -106,6 +107,10 @@ public class CreateImageGenerationRequest {
@javax.annotation.Nullable
private OutputFormat outputFormat;

public static final String JSON_PROPERTY_BACKGROUND = "background";
@javax.annotation.Nullable
private Background background;

public static final String JSON_PROPERTY_LAYER_DECOMPOSITION = "layer_decomposition";
@javax.annotation.Nullable
private Boolean layerDecomposition;
Expand Down Expand Up @@ -138,61 +143,53 @@ public void setModel(@javax.annotation.Nonnull String model) {
this.model = model;
}

public CreateImageGenerationRequest prompt(@javax.annotation.Nonnull String prompt) {
public CreateImageGenerationRequest prompt(@javax.annotation.Nullable String prompt) {

this.prompt = prompt;
return this;
}

/**
* Text prompt describing the desired image.
* Text prompt describing the desired image. Required for standard generation; may be omitted for automatic layer decomposition when &#x60;layer_decomposition&#x3D;true&#x60;.
* @return prompt
*/
@javax.annotation.Nonnull
@JsonProperty(value = JSON_PROPERTY_PROMPT, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@javax.annotation.Nullable
@JsonProperty(value = JSON_PROPERTY_PROMPT, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public String getPrompt() {
return prompt;
}


@JsonProperty(value = JSON_PROPERTY_PROMPT, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setPrompt(@javax.annotation.Nonnull String prompt) {
@JsonProperty(value = JSON_PROPERTY_PROMPT, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setPrompt(@javax.annotation.Nullable String prompt) {
this.prompt = prompt;
}

public CreateImageGenerationRequest image(@javax.annotation.Nullable List<String> image) {
public CreateImageGenerationRequest image(@javax.annotation.Nullable CreateImageGenerationRequestImage image) {

this.image = image;
return this;
}

public CreateImageGenerationRequest addImageItem(String imageItem) {
if (this.image == null) {
this.image = new ArrayList<>();
}
this.image.add(imageItem);
return this;
}

/**
* Reference / edit images. Each entry is a URL or a &#x60;data:&#x60; URI.
* Get image
* @return image
*/
@javax.annotation.Nullable
@JsonProperty(value = JSON_PROPERTY_IMAGE, required = false)
@JsonInclude(value = JsonInclude.Include.NON_EMPTY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public List<String> getImage() {
public CreateImageGenerationRequestImage getImage() {
return image;
}


@JsonProperty(value = JSON_PROPERTY_IMAGE, required = false)
@JsonInclude(value = JsonInclude.Include.NON_EMPTY)
public void setImage(@javax.annotation.Nullable List<String> image) {
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setImage(@javax.annotation.Nullable CreateImageGenerationRequestImage image) {
this.image = image;
}

Expand Down Expand Up @@ -504,6 +501,31 @@ public void setOutputFormat(@javax.annotation.Nullable OutputFormat outputFormat
this.outputFormat = outputFormat;
}

public CreateImageGenerationRequest background(@javax.annotation.Nullable Background background) {

this.background = background;
return this;
}

/**
* Output background. Defaults to &#x60;opaque&#x60;. &#x60;transparent&#x60; requires exactly one PNG reference image with an alpha channel and PNG output.
* @return background
*/
@javax.annotation.Nullable
@JsonProperty(value = JSON_PROPERTY_BACKGROUND, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public Background getBackground() {
return background;
}


@JsonProperty(value = JSON_PROPERTY_BACKGROUND, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setBackground(@javax.annotation.Nullable Background background) {
this.background = background;
}

public CreateImageGenerationRequest layerDecomposition(@javax.annotation.Nullable Boolean layerDecomposition) {

this.layerDecomposition = layerDecomposition;
Expand Down Expand Up @@ -554,12 +576,13 @@ public boolean equals(Object o) {
Objects.equals(this.optimizePromptOptions, createImageGenerationRequest.optimizePromptOptions) &&
Objects.equals(this.tools, createImageGenerationRequest.tools) &&
Objects.equals(this.outputFormat, createImageGenerationRequest.outputFormat) &&
Objects.equals(this.background, createImageGenerationRequest.background) &&
Objects.equals(this.layerDecomposition, createImageGenerationRequest.layerDecomposition);
}

@Override
public int hashCode() {
return Objects.hash(model, prompt, image, stream, responseFormat, seed, guidanceScale, imageGuidanceScale, size, watermark, sequentialImageGeneration, sequentialImageGenerationOptions, optimizePromptOptions, tools, outputFormat, layerDecomposition);
return Objects.hash(model, prompt, image, stream, responseFormat, seed, guidanceScale, imageGuidanceScale, size, watermark, sequentialImageGeneration, sequentialImageGenerationOptions, optimizePromptOptions, tools, outputFormat, background, layerDecomposition);
}

@Override
Expand All @@ -581,6 +604,7 @@ public String toString() {
sb.append(" optimizePromptOptions: ").append(toIndentedString(optimizePromptOptions)).append("\n");
sb.append(" tools: ").append(toIndentedString(tools)).append("\n");
sb.append(" outputFormat: ").append(toIndentedString(outputFormat)).append("\n");
sb.append(" background: ").append(toIndentedString(background)).append("\n");
sb.append(" layerDecomposition: ").append(toIndentedString(layerDecomposition)).append("\n");
sb.append("}");
return sb.toString();
Expand Down Expand Up @@ -614,7 +638,7 @@ public CreateImageGenerationRequest.Builder prompt(String prompt) {
this.instance.prompt = prompt;
return this;
}
public CreateImageGenerationRequest.Builder image(List<String> image) {
public CreateImageGenerationRequest.Builder image(CreateImageGenerationRequestImage image) {
this.instance.image = image;
return this;
}
Expand Down Expand Up @@ -666,6 +690,10 @@ public CreateImageGenerationRequest.Builder outputFormat(OutputFormat outputForm
this.instance.outputFormat = outputFormat;
return this;
}
public CreateImageGenerationRequest.Builder background(Background background) {
this.instance.background = background;
return this;
}
public CreateImageGenerationRequest.Builder layerDecomposition(Boolean layerDecomposition) {
this.instance.layerDecomposition = layerDecomposition;
return this;
Expand Down Expand Up @@ -719,6 +747,7 @@ public CreateImageGenerationRequest.Builder toBuilder() {
.optimizePromptOptions(getOptimizePromptOptions())
.tools(getTools())
.outputFormat(getOutputFormat())
.background(getBackground())
.layerDecomposition(getLayerDecomposition());
}

Expand Down
Loading
Loading