import os
import requests
URL = "https://api.dreamto.ai/api/v1/services/aigc/multimodal-generation/generation"
HEADERS = {"Authorization": f"Bearer {os.environ['DREAMTO_API_KEY']}"}
payload = {
"model": "qwen-image-3.0-pro",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "A minimalist coffee brand poster: off-white background, a steaming white ceramic cup in the center, the words \"MORNING BREW\" in a dark brown sans-serif font above the cup and a small line \"Freshly ground daily\" at the bottom, soft natural light, generous white space"
}
]
}
]
},
"parameters": {
"size": "1104*1472",
"prompt_extend": False
}
}
result = requests.post(URL, headers=HEADERS, json=payload, timeout=300).json()
if "output" not in result:
raise SystemExit(result)
for item in result["output"]["choices"][0]["message"]["content"]:
print(item["image"])