Z-Image Turbo 画像生成
curl --request POST \
--url https://api.sinancode.com/v1/generate/f/z-image-turbo \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A hyper-realistic portrait of a cat",
"enable_safety_checker": true,
"image_size": "landscape_4_3",
"num_images": 1,
"output_format": "png",
"seed": -1
}
'import requests
url = "https://api.sinancode.com/v1/generate/f/z-image-turbo"
payload = {
"prompt": "A hyper-realistic portrait of a cat",
"enable_safety_checker": True,
"image_size": "landscape_4_3",
"num_images": 1,
"output_format": "png",
"seed": -1
}
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: 'A hyper-realistic portrait of a cat',
enable_safety_checker: true,
image_size: 'landscape_4_3',
num_images: 1,
output_format: 'png',
seed: -1
})
};
fetch('https://api.sinancode.com/v1/generate/f/z-image-turbo', 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.sinancode.com/v1/generate/f/z-image-turbo",
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' => 'A hyper-realistic portrait of a cat',
'enable_safety_checker' => true,
'image_size' => 'landscape_4_3',
'num_images' => 1,
'output_format' => 'png',
'seed' => -1
]),
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.sinancode.com/v1/generate/f/z-image-turbo"
payload := strings.NewReader("{\n \"prompt\": \"A hyper-realistic portrait of a cat\",\n \"enable_safety_checker\": true,\n \"image_size\": \"landscape_4_3\",\n \"num_images\": 1,\n \"output_format\": \"png\",\n \"seed\": -1\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.sinancode.com/v1/generate/f/z-image-turbo")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A hyper-realistic portrait of a cat\",\n \"enable_safety_checker\": true,\n \"image_size\": \"landscape_4_3\",\n \"num_images\": 1,\n \"output_format\": \"png\",\n \"seed\": -1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/f/z-image-turbo")
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\": \"A hyper-realistic portrait of a cat\",\n \"enable_safety_checker\": true,\n \"image_size\": \"landscape_4_3\",\n \"num_images\": 1,\n \"output_format\": \"png\",\n \"seed\": -1\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}画像生成 - Z-Image
Z-Image Turbo
通義萬相 Z-Image Turbo モデルを使用して画像を生成(非同期、6B パラメータ超高速テキストから画像生成)
POST
/
generate
/
f
/
z-image-turbo
Z-Image Turbo 画像生成
curl --request POST \
--url https://api.sinancode.com/v1/generate/f/z-image-turbo \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A hyper-realistic portrait of a cat",
"enable_safety_checker": true,
"image_size": "landscape_4_3",
"num_images": 1,
"output_format": "png",
"seed": -1
}
'import requests
url = "https://api.sinancode.com/v1/generate/f/z-image-turbo"
payload = {
"prompt": "A hyper-realistic portrait of a cat",
"enable_safety_checker": True,
"image_size": "landscape_4_3",
"num_images": 1,
"output_format": "png",
"seed": -1
}
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: 'A hyper-realistic portrait of a cat',
enable_safety_checker: true,
image_size: 'landscape_4_3',
num_images: 1,
output_format: 'png',
seed: -1
})
};
fetch('https://api.sinancode.com/v1/generate/f/z-image-turbo', 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.sinancode.com/v1/generate/f/z-image-turbo",
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' => 'A hyper-realistic portrait of a cat',
'enable_safety_checker' => true,
'image_size' => 'landscape_4_3',
'num_images' => 1,
'output_format' => 'png',
'seed' => -1
]),
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.sinancode.com/v1/generate/f/z-image-turbo"
payload := strings.NewReader("{\n \"prompt\": \"A hyper-realistic portrait of a cat\",\n \"enable_safety_checker\": true,\n \"image_size\": \"landscape_4_3\",\n \"num_images\": 1,\n \"output_format\": \"png\",\n \"seed\": -1\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.sinancode.com/v1/generate/f/z-image-turbo")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A hyper-realistic portrait of a cat\",\n \"enable_safety_checker\": true,\n \"image_size\": \"landscape_4_3\",\n \"num_images\": 1,\n \"output_format\": \"png\",\n \"seed\": -1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/f/z-image-turbo")
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\": \"A hyper-realistic portrait of a cat\",\n \"enable_safety_checker\": true,\n \"image_size\": \"landscape_4_3\",\n \"num_images\": 1,\n \"output_format\": \"png\",\n \"seed\": -1\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}アリババクラウド Tongyi Wanxiang Z-Image Turbo モデルを使用して超高速で画像を生成します。
モデルの特徴:
- 最低価格 - 現在プラットフォーム上で最も安価な画像生成モデル
- 最速 - 6B パラメータ蒸留モデル、8 ステップ推論、H800 でサブ秒レイテンシ、プラットフォーム最速
- バイリンガルテキストレンダリング - 中国語と英語のテキストを正確にレンダリング、文字化けや画数欠落の問題を解決
- 写真レベルのリアリズム - ポートレートとリアルなシーンの肌質感、光と影、被写界深度のディテールが優れている
- オープンソース商用可 - Apache-2.0 ライセンス、オープンソースモデルで SOTA レベルを達成
承認
API Tokenを使用して認証を行ってください
ボディ
application/json
タスクパラメータ
プロンプトテキスト(必須)
Minimum string length:
1例:
"A hyper-realistic portrait of a cat"
セーフティチェッカーを有効にする(デフォルト true)
例:
true
画像サイズ(プリセット値)
利用可能なオプション:
square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9 例:
"landscape_4_3"
生成する画像の数(1-4枚、デフォルト 1)
必須範囲:
1 <= x <= 4例:
1
出力形式(jpeg/png/webp、デフォルト png)
利用可能なオプション:
jpeg, png, webp 例:
"png"
ランダムシード(同じシード + 同じプロンプト = 同じ結果)
例:
-1
レスポンス
OK
タスクID
例:
"01234567-89ab-cdef-0123-456789abcdef"
⌘I