General-purpose image generation model that supports various art styles and is particularly good at rendering complex text.
General-purpose image generation model that supports various art styles and is particularly good at rendering complex text.
आपके अनुरोध की लागत 0.052 प्रति रन होगी। $10 के साथ आप इस मॉडल को लगभग 192 बार चला सकते हैं।
आगे आप यह कर सकते हैं:
import requests
import time
# Step 1: Start image generation
generate_url = "https://api.atlascloud.ai/api/v1/model/generateImage"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer $ATLASCLOUD_API_KEY"
}
data = {
"model": "alibaba/qwen-image/text-to-image-max",
"prompt": "A beautiful landscape with mountains and lake",
"width": 512,
"height": 512,
"steps": 20,
"guidance_scale": 7.5
}
generate_response = requests.post(generate_url, headers=headers, json=data)
generate_result = generate_response.json()
prediction_id = generate_result["data"]["id"]
# Step 2: Poll for result
poll_url = f"https://api.atlascloud.ai/api/v1/model/prediction/{prediction_id}"
def check_status():
while True:
response = requests.get(poll_url, headers={"Authorization": "Bearer $ATLASCLOUD_API_KEY"})
result = response.json()
if result["data"]["status"] == "completed":
print("Generated image:", result["data"]["outputs"][0])
return result["data"]["outputs"][0]
elif result["data"]["status"] == "failed":
raise Exception(result["data"]["error"] or "Generation failed")
else:
# Still processing, wait 2 seconds
time.sleep(2)
image_url = check_status()अपने मॉडल अनुरोध इतिहास तक पहुंचने के लिए आपको साइन इन करना होगा।
साइन इन करेंThe flagship text-to-image generation model from Alibaba Cloud, designed to deliver state-of-the-art visual quality, exceptional prompt adherence, and rich artistic detail. Qwen-Image Max represents the pinnacle of the Qwen-Image family, capable of transforming complex text descriptions into stunning, high-resolution visuals suitable for professional and creative workflows.
To achieve the best results, follow these guidelines:
Billing is typically based on the number of images generated and the resolution selected.