Flexible parameters
Configure 3 documented parameters, including aspect_ratio, output_format, prompt.
Qwen2 text-to-image with 5 aspect ratios
curl -X POST https://runapi.ai/api/v1/qwen_2/text_to_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-2-text-to-image",
"prompt": "Generate an isometric illustration of a cozy home office with warm lighting and plants on the desk."
}'
import { Qwen2Client } from "@runapi.ai/qwen-2";
const client = new Qwen2Client();
const result = await client.textToImage.run({
model: "qwen-2-text-to-image",
prompt: "Generate an isometric illustration of a cozy home office with warm lighting and plants on the desk.",
});
import os
import requests
response = requests.post(
"https://runapi.ai/api/v1/qwen_2/text_to_image",
headers={"Authorization": f"Bearer {os.environ['RUNAPI_API_KEY']}"},
json={"model":"qwen-2-text-to-image","prompt":"Generate an isometric illustration of a cozy home office with warm lighting and plants on the desk."}
)
response.raise_for_status()
<?php
$client = curl_init("https://runapi.ai/api/v1/qwen_2/text_to_image");
curl_setopt_array($client, [
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("RUNAPI_API_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
'model' => 'qwen-2-text-to-image',
'prompt' => 'Generate an isometric illustration of a cozy home office with warm lighting and plants on the desk.',
])
]);
$response = curl_exec($client);
RunApi client = new RunApi(System.getenv("RUNAPI_API_KEY"));
Task task = client.textToImage().run({"model":"qwen-2-text-to-image","prompt":"Generate an isometric illustration of a cozy home office with warm lighting and plants on the desk."});
task.waitForResult();
require "runapi/qwen_2"
client = RunApi::Qwen2::Client.new
result = client.text_to_image.run(
model: "qwen-2-text-to-image",
prompt: "Generate an isometric illustration of a cozy home office with warm lighting and plants on the desk."
)
client := runapi.NewClient(os.Getenv("RUNAPI_API_KEY"))
task, err := client.textToImage.Run({"model":"qwen-2-text-to-image","prompt":"Generate an isometric illustration of a cozy home office with warm lighting and plants on the desk."})
if err != nil { log.Fatal(err) }
task.Wait()
$ runapi generate \
--model qwen-2-text-to-image \
--endpoint text_to_image \
--wait
2 versions available
Pick any model and generate in seconds.
| Provider | Alibaba |
| Model ID | qwen-2-text-to-image |
| Modality | Image |
| Task types | Asynchronous |
| API endpoint | /api/v1/qwen_2/text_to_image |
| Billing unit | call |
| Input parameters | aspect_ratio, output_format, prompt |
| Aspect ratios | 1:1, 3:4, 4:3, 9:16, 16:9 |
| Output format | png, jpeg |
| Catalog status | Operational |
Sign up for free and create an API key for qwen-2-text-to-image from the dashboard.
POST to /api/v1/qwen_2/text_to_image with the qwen-2-text-to-image model slug and your parameters.
Poll the task or follow the callback to retrieve the completed qwen-2-text-to-image result.
Configure 3 documented parameters, including aspect_ratio, output_format, prompt.
Exposes 1 public endpoint(s): text_to_image.
Metered by call with no subscription requirement.
promptNo description available.
aspect_ratioNo description available. (1:1, 3:4, 4:3, 9:16, 16:9)
output_formatNo description available. (png, jpeg)
Auto-generate lifestyle product photos for e-commerce catalogs that lack studio photography.
Rapidly concept environments and characters before committing to final art.
Generate unique cover art and illustrations for blog posts and articles at scale.
Pass the model ID shown in the quickstart.
Per-key rate limits scale with your usage tier. The pricing page shows current limits. If you need higher throughput, contact support to discuss tier upgrades.
Yes. Variant is a parameter in the request. Switch by changing the model ID — no code changes, no re-authentication, no separate billing setup. All variants share the same API key and request shape.
Where streaming is available, RunAPI streams end-to-end. LLM models support token-level streaming. Media models use async task polling or webhook callbacks for result delivery.
Open an issue on the public GitHub repo or email support at [email protected]. Include the task ID and model ID so the team can investigate the specific generation.
No. Your RunAPI API key is enough to access this variant and every other model in the catalog. You do not need accounts with the underlying provider.
We're here to help with enterprise setup, integrations, and technical questions.
Contact Us