图片增强接口
curl --request POST \
--url https://geekai.co/api/v1/images/enhance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "jimeng-image-enhance-v2",
"image": "<string>",
"size": "1080p",
"response_format": "url",
"output_format": "png",
"extra_body": {
"enable_hdr": false,
"enable_wb": false,
"hdr_strength": 1
},
"retries": 0
}
'import requests
url = "https://geekai.co/api/v1/images/enhance"
payload = {
"model": "jimeng-image-enhance-v2",
"image": "<string>",
"size": "1080p",
"response_format": "url",
"output_format": "png",
"extra_body": {
"enable_hdr": False,
"enable_wb": False,
"hdr_strength": 1
},
"retries": 0
}
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({
model: 'jimeng-image-enhance-v2',
image: '<string>',
size: '1080p',
response_format: 'url',
output_format: 'png',
extra_body: {enable_hdr: false, enable_wb: false, hdr_strength: 1},
retries: 0
})
};
fetch('https://geekai.co/api/v1/images/enhance', 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://geekai.co/api/v1/images/enhance",
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([
'model' => 'jimeng-image-enhance-v2',
'image' => '<string>',
'size' => '1080p',
'response_format' => 'url',
'output_format' => 'png',
'extra_body' => [
'enable_hdr' => false,
'enable_wb' => false,
'hdr_strength' => 1
],
'retries' => 0
]),
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://geekai.co/api/v1/images/enhance"
payload := strings.NewReader("{\n \"model\": \"jimeng-image-enhance-v2\",\n \"image\": \"<string>\",\n \"size\": \"1080p\",\n \"response_format\": \"url\",\n \"output_format\": \"png\",\n \"extra_body\": {\n \"enable_hdr\": false,\n \"enable_wb\": false,\n \"hdr_strength\": 1\n },\n \"retries\": 0\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://geekai.co/api/v1/images/enhance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"jimeng-image-enhance-v2\",\n \"image\": \"<string>\",\n \"size\": \"1080p\",\n \"response_format\": \"url\",\n \"output_format\": \"png\",\n \"extra_body\": {\n \"enable_hdr\": false,\n \"enable_wb\": false,\n \"hdr_strength\": 1\n },\n \"retries\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geekai.co/api/v1/images/enhance")
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 \"model\": \"jimeng-image-enhance-v2\",\n \"image\": \"<string>\",\n \"size\": \"1080p\",\n \"response_format\": \"url\",\n \"output_format\": \"png\",\n \"extra_body\": {\n \"enable_hdr\": false,\n \"enable_wb\": false,\n \"hdr_strength\": 1\n },\n \"retries\": 0\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>",
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "aSDinaTvuI8gbWludGxpZnk=",
"revised_prompt": "<string>"
}
],
"task_status": "succeed"
}{
"code": "validation_error",
"message": "参数验证失败",
"details": {
"field": "错误描述"
}
}{
"code": "unauthorized",
"message": "Invalid API key or token"
}{
"code": "invalid_request",
"message": "请求参数不合法"
}画图模型
图像增强
POST
/
images
/
enhance
图片增强接口
curl --request POST \
--url https://geekai.co/api/v1/images/enhance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "jimeng-image-enhance-v2",
"image": "<string>",
"size": "1080p",
"response_format": "url",
"output_format": "png",
"extra_body": {
"enable_hdr": false,
"enable_wb": false,
"hdr_strength": 1
},
"retries": 0
}
'import requests
url = "https://geekai.co/api/v1/images/enhance"
payload = {
"model": "jimeng-image-enhance-v2",
"image": "<string>",
"size": "1080p",
"response_format": "url",
"output_format": "png",
"extra_body": {
"enable_hdr": False,
"enable_wb": False,
"hdr_strength": 1
},
"retries": 0
}
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({
model: 'jimeng-image-enhance-v2',
image: '<string>',
size: '1080p',
response_format: 'url',
output_format: 'png',
extra_body: {enable_hdr: false, enable_wb: false, hdr_strength: 1},
retries: 0
})
};
fetch('https://geekai.co/api/v1/images/enhance', 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://geekai.co/api/v1/images/enhance",
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([
'model' => 'jimeng-image-enhance-v2',
'image' => '<string>',
'size' => '1080p',
'response_format' => 'url',
'output_format' => 'png',
'extra_body' => [
'enable_hdr' => false,
'enable_wb' => false,
'hdr_strength' => 1
],
'retries' => 0
]),
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://geekai.co/api/v1/images/enhance"
payload := strings.NewReader("{\n \"model\": \"jimeng-image-enhance-v2\",\n \"image\": \"<string>\",\n \"size\": \"1080p\",\n \"response_format\": \"url\",\n \"output_format\": \"png\",\n \"extra_body\": {\n \"enable_hdr\": false,\n \"enable_wb\": false,\n \"hdr_strength\": 1\n },\n \"retries\": 0\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://geekai.co/api/v1/images/enhance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"jimeng-image-enhance-v2\",\n \"image\": \"<string>\",\n \"size\": \"1080p\",\n \"response_format\": \"url\",\n \"output_format\": \"png\",\n \"extra_body\": {\n \"enable_hdr\": false,\n \"enable_wb\": false,\n \"hdr_strength\": 1\n },\n \"retries\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geekai.co/api/v1/images/enhance")
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 \"model\": \"jimeng-image-enhance-v2\",\n \"image\": \"<string>\",\n \"size\": \"1080p\",\n \"response_format\": \"url\",\n \"output_format\": \"png\",\n \"extra_body\": {\n \"enable_hdr\": false,\n \"enable_wb\": false,\n \"hdr_strength\": 1\n },\n \"retries\": 0\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>",
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "aSDinaTvuI8gbWludGxpZnk=",
"revised_prompt": "<string>"
}
],
"task_status": "succeed"
}{
"code": "validation_error",
"message": "参数验证失败",
"details": {
"field": "错误描述"
}
}{
"code": "unauthorized",
"message": "Invalid API key or token"
}{
"code": "invalid_request",
"message": "请求参数不合法"
}注意:目前仅
jimeng-image-enhance-v2 模型支持图像增强,其他模型不支持。请求/响应参数明细
授权
bearerAuthapiKeyAuth
API认证token
请求体
application/json
图像增强模型
示例:
"jimeng-image-enhance-v2"
单张图片URL/Base64编码数据
图片分辨率,支持 144p/240p/360p/480p/540p/720p/1080p/2k,默认为720p
示例:
"1080p"
图片响应格式,支持 url/b64_json 两种格式,默认为url
可用选项:
url, b64_json 图片输出格式,支持 png/jpg/webp 三种格式,默认为png
可用选项:
png, jpg, webp 额外参数配置
Show child attributes
Show child attributes
自动重试次数,默认0,表示失败不重试
示例:
0
此页面对您有帮助吗?
⌘I
