Qwen-Image Text to Image
curl --request POST \
--url https://api.novita.ai/v3/async/qwen-image-txt2img \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"size": "<string>"
}
'import requests
url = "https://api.novita.ai/v3/async/qwen-image-txt2img"
payload = {
"prompt": "<string>",
"size": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({prompt: '<string>', size: '<string>'})
};
fetch('https://api.novita.ai/v3/async/qwen-image-txt2img', 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.novita.ai/v3/async/qwen-image-txt2img",
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' => '<string>',
'size' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.novita.ai/v3/async/qwen-image-txt2img"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"size\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
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.novita.ai/v3/async/qwen-image-txt2img")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"size\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novita.ai/v3/async/qwen-image-txt2img")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"prompt\": \"<string>\",\n \"size\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Image Generator
Qwen-Image Text to Image
POST
/
v3
/
async
/
qwen-image-txt2img
Qwen-Image Text to Image
curl --request POST \
--url https://api.novita.ai/v3/async/qwen-image-txt2img \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"size": "<string>"
}
'import requests
url = "https://api.novita.ai/v3/async/qwen-image-txt2img"
payload = {
"prompt": "<string>",
"size": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({prompt: '<string>', size: '<string>'})
};
fetch('https://api.novita.ai/v3/async/qwen-image-txt2img', 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.novita.ai/v3/async/qwen-image-txt2img",
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' => '<string>',
'size' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.novita.ai/v3/async/qwen-image-txt2img"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"size\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
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.novita.ai/v3/async/qwen-image-txt2img")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"size\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novita.ai/v3/async/qwen-image-txt2img")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"prompt\": \"<string>\",\n \"size\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Qwen-Image — a 20B MMDiT model for next-gen text-to-image generation. Especially strong at creating stunning graphic posters with native text.

This is an asynchronous API; only the task_id will be returned. You should use the task_id to request the Task Result API to retrieve the image generation results.
Request Headers
string
required
Supports:
application/jsonstring
required
Bearer authentication format, for example: Bearer {{API Key}}.
Request Body
string
required
Text prompt for image generation.
string
The size of the generated media in pixels (width*height). Default is
1024*1024. Range: 256 ~ 1536 per dimension.Response
string
required
Use the task_id to request the Task Result API to retrieve the generated outputs.
Example
Here is an example of how to use the Qwen-Image Text to Image API.- Generate a task_id by sending a POST request to the Qwen-Image Text to Image API.
Request:
curl --location 'https://api.novita.ai/v3/async/qwen-image-txt2img' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "A cinematic scene of a quiet girl with short brown hair sitting by a misty lake at dawn. She wears an oversized sweater, holding a warm mug. Soft morning light filters through the trees, cool tones, tranquil mood, light fog, 50mm photography style.",
"size": "1024*1024"
}'
Response:
{
"task_id": "{Returned Task ID}"
}
- Use
task_idto get output images.
images of response.
Request:
curl --location --request GET 'https://api.novita.ai/v3/async/task-result?task_id={Returned Task ID}' \
--header 'Authorization: Bearer {{API Key}}'
Response:
{
"extra": {
"has_nsfw_contents": []
},
"task": {
"task_id": "0cdee604-7168-4ff4-9b2a-9793c0cc6cdf",
"task_type": "QWEN_IMAGE_TEXT_TO_IMAGE",
"status": "TASK_STATUS_SUCCEED",
"reason": "",
"eta": 0,
"progress_percent": 0
},
"images": [
{
"image_url": "https://d2p7pge43lyniu.cloudfront.net/output/9dc2f15a-0dd3-49a3-a121-a352f229c84b-u2_c61a700e-dfec-4c01-81c6-bf890ad68f6c.jpeg",
"image_url_ttl": "0",
"image_type": "jpeg",
"nsfw_detection_result": null
}
],
"videos": [],
"audios": []
}
Image files:

Last modified on January 14, 2026
Was this page helpful?
⌘I