Zum Hauptinhalt springen
POST
/
image
/
edit
/api/v1/image/edit
curl --request POST \
  --url https://api.venice.ai/api/v1/image/edit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "Colorize",
  "image": "iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A..."
}
'
"<string>"
Dies ist ein experimenteller Endpoint und kann Änderungen unterliegen.
Preise: Die Preise für die Bildbearbeitung variieren je nach Modell. Das Standardmodell (qwen-edit) kostet $0.04 pro Bearbeitung. Siehe den Models-Endpoint für alle verfügbaren Edit-Modelle und deren Preise.

Qualitätsstufen

Einige Edit-Modelle akzeptieren einen optionalen Parameter quality (low, medium, high), der visuelle Qualität gegen Kosten abwägt. Derzeit von gpt-image-2-edit unterstützt; andere Modelle ignorieren den Parameter.
{
  "model": "gpt-image-2-edit",
  "image": "iVBORw0KGgo...",
  "prompt": "change the sky to a sunrise",
  "resolution": "2K",
  "quality": "medium"
}
Wenn Sie quality weglassen, verwendet das Modell seine Standardstufe (high für gpt-image-2-edit). Preise pro Stufe (1K/2K/4K × low/medium/high) finden Sie unter model_spec.pricing.quality im Models-Endpoint und in der Preisübersicht.
Qualitätsabhängige Preise sind der Standard für alle API- und SDK-Aufrufer — kein Opt-in-Header erforderlich. Anfragen, bei denen quality weggelassen wird, werden mit der Standardstufe des Modells abgerechnet (high für gpt-image-2-edit).

Postman-Collection

Weitere Beispiele finden Sie in dieser Postman-Collection.
Das Standardmodell (qwen-edit) blockiert Anfragen, die explizite sexuelle Bilder generieren, Minderjährige sexualisieren oder reale Gewalt darstellen wollen. Andere Modelle können abweichende Inhaltsrichtlinien haben.

Autorisierungen

Authorization
string
header
erforderlich

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

Edit an image based on the supplied prompt.

image
erforderlich

The image to edit. Can be either a file upload, a base64-encoded string, or a URL starting with http:// or https://. Image dimensions must be at least 65536 pixels and must not exceed 33177600 pixels. File size must be less than 25MB.

prompt
string
erforderlich

The text directions to edit or modify the image. Short, descriptive prompts work best (e.g., "remove the tree", "change the sky to sunrise"). Character limit is model specific and is listed in the promptCharacterLimit setting in the model list endpoint.

Required string length: 1 - 32768
Beispiel:

"Change the color of the sky to a sunrise"

aspect_ratio
enum<string>

The aspect ratio for the output image. Use 'auto' or omit this parameter to infer the closest supported aspect ratio from the input image when explicit sizing is required by the model. Supported values vary by model - check GET /api/v1/models for model-specific options.

Verfügbare Optionen:
auto,
1:1,
3:2,
16:9,
21:9,
9:16,
2:3,
3:4,
4:5
Beispiel:

"16:9"

resolution
string

Resolution tier for the output image (e.g. "1K", "2K", "4K"). Supported values vary by model - check GET /api/v1/models for model-specific options. Defaults to "1K" when not specified.

Required string length: 1 - 10
Beispiel:

"1K"

model
string
Standard:firered-image-edit

The model ID to use for image editing.

Minimum string length: 1
modelId
enum<string>
veraltet

Deprecated: Use "model" instead. The model ID to use for image editing.

Verfügbare Optionen:
firered-image-edit,
qwen-edit,
qwen-edit-uncensored,
grok-imagine-edit,
grok-imagine-quality-edit,
qwen-image-2-edit,
qwen-image-2-pro-edit,
wan-2-7-pro-edit,
flux-2-max-edit,
gpt-image-2-edit,
gpt-image-1-5-edit,
nano-banana-2-edit,
nano-banana-pro-edit,
seedream-v5-lite-edit,
seedream-v4-edit
Minimum string length: 1
output_format
enum<string>

Output format for the edited image. Accepts jpeg, jpg, png, or webp. When omitted, the format is inferred from resolution: PNG for 1K edits and JPEG for 2K/4K edits.

Verfügbare Optionen:
jpeg,
png,
webp
Beispiel:

"png"

safe_mode
boolean
Standard:true

Whether to use safe mode. If enabled, this will blur images that are classified as having adult content.

Beispiel:

false

Antwort

OK

The response is of type file.