편집 (인페인트)
Edit or modify an image based on the supplied prompt. The image can be provided either as a multipart form-data file upload or as a base64-encoded string in a JSON request. For models with resolution tiers that require explicit dimensions, omit aspect_ratio or set it to auto to infer the closest supported aspect ratio from the input image; provide aspect_ratio directly when exact output dimensions are required. Use output_format to request jpeg, jpg, png, or webp output.
Authentication: This endpoint accepts either a Bearer API key or a SIGN-IN-WITH-X header for x402 wallet-based authentication. The legacy X-Sign-In-With-X header is also accepted during migration. When using x402, a 402 Payment Required response indicates insufficient balance and includes top-up instructions. A 401 response with code X402_USER_NOT_ALLOWED means the wallet’s Venice account is banned or deleted, or the wallet’s x402 credit account belongs to a different user.
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..."
}
'import requests
url = "https://api.venice.ai/api/v1/image/edit"
payload = {
"prompt": "Colorize",
"image": "iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A..."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'Colorize',
image: 'iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A...'
})
};
fetch('https://api.venice.ai/api/v1/image/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.venice.ai/api/v1/image/edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'Colorize',
'image' => 'iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A...'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.venice.ai/api/v1/image/edit"
payload := strings.NewReader("{\n \"prompt\": \"Colorize\",\n \"image\": \"iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.venice.ai/api/v1/image/edit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Colorize\",\n \"image\": \"iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.venice.ai/api/v1/image/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"Colorize\",\n \"image\": \"iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A...\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "<string>",
"details": {
"_errors": [],
"field": {
"_errors": [
"Field is required"
]
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "This API key is restricted to configured IP addresses, and this request's source IP is not allowed"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}firered-image-edit)은 편집당 $0.04입니다. 사용 가능한 모든 편집 모델과 가격은 모델 엔드포인트를 참조하세요.품질 등급
/image/edit는 quality 매개변수를 허용하지 않으며, 보내면 400이 반환됩니다. 이 엔드포인트의 편집은 모델의 기본 등급(gpt-image-2-edit의 경우 high)으로 청구됩니다.
등급(low, medium, high)을 선택하려면 /image/multi-edit를 사용하세요. 이 엔드포인트는 지원하는 모델에서 quality를 허용합니다. 등급별 가격(1K/2K/4K × low/medium/high)은 모델 엔드포인트의 model_spec.pricing.quality 아래에 있으며 이미지 모델에 나열되어 있습니다.
Postman 컬렉션
추가 예제는 이 Postman 컬렉션을 참조하세요.인증
본문
Edit an image based on the supplied prompt.
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.
1 - 32768"Change the color of the sky to a sunrise"
Optional identifier for the API customer's end user. Combined with the Venice user id when attributing the request to upstream providers. Distinct from the discarded OpenAI user field. Must be printable ASCII and must not contain ||.
1 - 128^[\x20-\x7E]+$"end-user-123"
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.
32^(?:auto|\d+(?:\.\d+)?:\d+(?:\.\d+)?)$"16:9"
Rewrite the edit prompt using the input image before editing to add clarifying detail. Additional credits are charged when a rewrite is generated. Adds up to ~30 seconds. When enhancement is applied, the final prompt is returned URL-encoded in the x-venice-enhanced-prompt response header. Defaults to false.
false
Deprecated: Use "model" instead. The model ID to use for image editing.
firered-image-edit, seedream-v5-5-edit, qwen-edit-uncensored, grok-imagine-edit, grok-imagine-image-2-0-edit, krea-3-edit, qwen-image-2-edit, qwen-image-2-pro-edit, wan-2-7-pro-edit, flux-2-max-edit, flux-3-image-edit, gpt-image-2-5-flare-edit, gpt-image-2-5-sunburst-edit, gpt-image-2-6-sunburst-edit, gpt-image-2-6-flare-edit, gpt-image-2-edit, gpt-image-1-5-edit, ideogram-v4-5-edit, nano-banana-2-edit, nano-banana-2-1-edit, nano-banana-pro-edit, nano-banana-2-lite-edit, luma-uni-1-edit, luma-uni-1-max-edit, minimax-h3-image-edit, muse-image-edit, seedream-v5-lite-edit, seedream-v5-pro-edit, seedream-v4-edit, qwen-image-3-edit, qwen-image-3-pro-edit, qwen-image-2-1-turbo-edit, qwen-image-2-1-pro-edit 1Whether to blur images classified as adult content. Defaults to true. Set to false to receive unblurred output. No Pro subscription is required, and the mature filter setting in the Venice app does not affect this. The x-venice-is-blurred response header reports whether the returned image was blurred.
false
Return the edited image with a transparent background (alpha channel). Only supported by models with supportsTransparentBackground: true in their constraints (see GET /api/v1/models), and requires output_format png or webp when set; otherwise the request is rejected. Omit or set to false to keep the model default background.
false
응답
OK
The response is of type file.
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..."
}
'import requests
url = "https://api.venice.ai/api/v1/image/edit"
payload = {
"prompt": "Colorize",
"image": "iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A..."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'Colorize',
image: 'iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A...'
})
};
fetch('https://api.venice.ai/api/v1/image/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.venice.ai/api/v1/image/edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'Colorize',
'image' => 'iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A...'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.venice.ai/api/v1/image/edit"
payload := strings.NewReader("{\n \"prompt\": \"Colorize\",\n \"image\": \"iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.venice.ai/api/v1/image/edit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Colorize\",\n \"image\": \"iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.venice.ai/api/v1/image/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"Colorize\",\n \"image\": \"iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A...\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "<string>",
"details": {
"_errors": [],
"field": {
"_errors": [
"Field is required"
]
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "This API key is restricted to configured IP addresses, and this request's source IP is not allowed"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}