使用 AtlasCloud Nanobanana 2 模型根据文本提示生成图像,需提供 AtlasCloud API token 和特定 JSON 参数,且不含 media_resolution。
Generates images using the AtlasCloud Nanobanana 2 model ( google/nano-banana-2/text-to-image).
Before generating images, you need the user's AtlasCloud API token.
atlascloud_token.atlascloud_token so it is not needed again.Step 1: Write the params to {baseDir}/params.json.
Step 2: Run the script:
bash
node {baseDir}/generate.js <TOKEN> {baseDir}/params.json
Step 3: In the script output, find the line that starts with IMAGE_URL: between the two rows of = signs:
text
============================================================
IMAGE_URL: https://atlas-media.oss-us-west-1.aliyuncs.com/images/xxxx.png
============================================================
⚠️ CRITICAL: Use exactly the URL that appears in the
IMAGE_URL:line of this execution. Never use a URL from the conversation history, previous executions, or memory. Each execution generates a different URL.
Report this URL to the user.
⚠️ IMPORTANT: Never include
media_resolutionin the payload — it causes an HTTP 500 error.
json
{
"prompt": "descrição detalhada da imagem",
"aspect_ratio": "16:9",
"output_format": "png",
"resolution": "2k",
"enable_base64_output": false,
"enable_sync_mode": false,
"enable_web_search": false,
"enable_image_search": false
}
FieldRequiredDefaultOptionsprompt✅ yes—any textaspect_rationo16:9``1:1``resolutionno2k``1k``output_formatnopng``png``enable_web_searchnofalse``true``enable_image_searchnofalse``true``enable_sync_modenofalse``true
NÃO inclua
media_resolution— causa erro 500.
ErroCausa provávelSoluçãoHTTP 500media_resolution presente no payloadRemova media_resolution do params.jsonHTTP 500Token inválido ou expiradoSolicitar novo token ao usuário e atualizar memóriaLink não atualizaURL lida de lugar erradoBuscar a linha IMAGE_URL: no output desta execuçãoTimeoutResolução muito altaTentar novamente com "resolution": "1k"Job failedPrompt inválido ou API instávelSimplificar o prompt e tentar novamente