{"@context":"https://schema.org","@type":"NewsArticle","generatedAt":"2026-09-28T06:03:00.468Z","headline":"OpenRouter 教程：用代码调用 Nano Banana 2 编辑图像","description":"OpenRouter 发布教程，演示通过 API 向 google/gemini-3.1-flash-image（即 Nano Banana 2）发送源图和文本指令完成图像编辑，编辑结果以 base64 形式在响应中返回。教程给出 Python 和 TypeScript 示例、提示词写法、多轮小步编辑方法，以及更换模型只需改一个字段，并介绍了 Nano Banana 系列四个成员的价格与质量差异。","url":"https://www.aioga.com/news/cmtwlujuv02r0row7odx8rss3/","mainEntityOfPage":"https://www.aioga.com/news/cmtwlujuv02r0row7odx8rss3/","datePublished":"2026-09-09T00:00:00.000Z","dateModified":"2026-09-09T00:00:00.000Z","inLanguage":"zh-CN","publisher":{"@type":"NewsMediaOrganization","name":"Aioga","url":"https://www.aioga.com"},"citation":["https://openrouter.ai/blog/tutorials/nano-banana","https://aihot.news/items/cmtwlujuv02r0row7odx8rss3"],"canonicalUrl":"https://www.aioga.com/news/cmtwlujuv02r0row7odx8rss3/","directAnswer":{"@type":"Answer","text":"OpenRouter 发布图像编辑教程，展示如何通过 API 向 google/gemini-3.1-flash-image 提交源图与文本指令，并从响应中的 base64 数据获取编辑结果。","url":"https://www.aioga.com/news/cmtwlujuv02r0row7odx8rss3/","dateCreated":"2026-09-09T00:00:00.000Z","author":{"@type":"Organization","@id":"https://www.aioga.com/authors/aioga-editorial/#editorial-team","name":"Aioga Editorial Team","url":"https://www.aioga.com/authors/aioga-editorial/"}},"evidence":[{"@type":"CreativeWork","name":"openrouter.ai source article","url":"https://openrouter.ai/blog/tutorials/nano-banana","datePublished":"2026-09-09T00:00:00.000Z","provider":{"@type":"Organization","name":"openrouter.ai","url":"https://openrouter.ai/blog/tutorials/nano-banana"}},{"@type":"CreativeWork","name":"AIHot archive record","url":"https://aihot.news/items/cmtwlujuv02r0row7odx8rss3","datePublished":"2026-09-09T00:00:00.000Z","provider":{"@type":"Organization","name":"AIHot","url":"https://aihot.news/items/cmtwlujuv02r0row7odx8rss3"}}],"aggregationSource":"OpenRouter：Announcements（RSS）","originalPublisher":{"name":"openrouter.ai","url":"https://openrouter.ai/blog/tutorials/nano-banana"},"geoDeepAnswer":null,"article":{"id":"cmtwlujuv02r0row7odx8rss3","slug":"cmtwlujuv02r0row7odx8rss3","url":"https://www.aioga.com/news/cmtwlujuv02r0row7odx8rss3/","title":"OpenRouter 教程：用代码调用 Nano Banana 2 编辑图像","title_en":"","summary":"OpenRouter 发布教程，演示通过 API 向 google/gemini-3.1-flash-image（即 Nano Banana 2）发送源图和文本指令完成图像编辑，编辑结果以 base64 形式在响应中返回。教程给出 Python 和 TypeScript 示例、提示词写法、多轮小步编辑方法，以及更换模型只需改一个字段，并介绍了 Nano Banana 系列四个成员的价格与质量差异。","source":"OpenRouter：Announcements（RSS）","sourceUrl":"https://openrouter.ai/blog/tutorials/nano-banana","aiHotUrl":"https://aihot.news/items/cmtwlujuv02r0row7odx8rss3","publishedAt":"2026-09-09T00:00:00.000Z","category":"行业动态","score":72,"selected":true,"articleBody":["This guide shows how to edit an image with a text prompt in code. You send the source image and an edit prompt to google/gemini-3.1-flash-image through the OpenRouter API, and the edited image comes back in the response. “Nano Banana” is the nickname for Google’s Gemini image models. This slug is Nano Banana 2, the default fast model in that family. Because you reach it through one API：https://openrouter.ai/blog/announcements/image-api, you can use a different editing model later by changing one field.","Image editing changes an existing image. Image generation creates a new image from text. This guide covers editing, so every request here includes a source image. For creating images from text, see the image generation docs：https://openrouter.ai/docs/guides/overview/multimodal/image-generation or the image generation tutorial：https://openrouter.ai/blog/tutorials/image-generation.","The default in this guide is google/gemini-3.1-flash-image , Nano Banana 2. It takes an image as input and returns an edited image. The Nano Banana family has four current members: Nano Banana 2 ( google/gemini-3.1-flash-image ) is the default in this guide, Nano Banana 2 Lite ( google/gemini-3.1-flash-lite-image ) is the cheapest and fastest, Nano Banana Pro ( google/gemini-3-pro-image ) is slower and higher quality, and the original Nano Banana ( google/gemini-2.5-flash-image ) is the older model the nickname started with.","The image catalog changes often. Models are added, deprecated, and repriced, so a slug you pin today may be retired later. Before you build on a model, check that it accepts image input and supports the editing features you need. You can browse the editing-capable models in the image model collection：https://openrouter.ai/collections/image-models. For a walkthrough of the catalog, see image generation models：https://openrouter.ai/blog/tutorials/image-generation-models.","The samples below use the slug shown in each request, so you can run them as written and change the model later. Keep your key in an environment variable, not in your code:","To edit an image, send the source image and a text instruction in a single request. The edited image comes back in the response. Here is a working request in Python that encodes a local file:","The request body is the same in both languages. Put the reference image in input_references and the instruction in prompt . That is the whole request.","The input_references field takes either a base64 data URL or an HTTP(S) URL. The examples above encode a local file. If your image is already hosted publicly, pass the link directly and skip the encoding:","Use a URL when the image is public and hosted, because it keeps the request body small. Use base64 for local or private files. Gemini accepts image/png , image/jpeg , image/webp , image/heic , and image/heif inputs. Supported formats vary by model, so check the model page before you send.","The API returns the edited image as base64 data in the data array. Decode the b64_json value and write it to a file:","Open edited.png to see the result. If you want a typed client instead of raw HTTP, the OpenRouter SDK has an images resource that calls the same endpoint:","Install the SDK with pip install openrouter . It reuses the api_key defined earlier, so no extra setup is needed.","A generation prompt describes a whole new image. An edit prompt says what to change and what to leave alone. State the change first, then name what must stay the same:","You can also write the prompt as a small block of JSON text:","The API treats this as plain text, so it is not a special mode. The structure can help the model separate what changes from what stays. Try both the sentence form and the JSON form on your own images and keep whichever works better.","One edit will not always give you what you want. To run another pass, send the returned image back in as the next source. Take the b64_json value from the response, turn it into a data URL, and pass it in the next input_references :","Each call edits the last result, so earlier changes carry forward. Give one instruction per call. Small edits are easier to check and easier to redo when they come back wrong. The model does not remember your earlier prompts, so repeat the parts it should leave alone in each new prompt.","To send the same edit request to a different model, change the model field. The source image, the prompt, and the response-handling code stay the same:","Use google/gemini-3.1-flash-image as a fast default. Use google/gemini-3.1-flash-lite-image when you want the lowest price. Use google/gemini-3-pro-image when you want higher quality and can accept more latency. The original google/gemini-2.5-flash-image still works with the same request shape, but the newer models above are the better default. Use a model from another provider, such as openai/gpt-5-image , when you want to compare quality, cost, or speed：https://openrouter.ai/blog/announcements/image-benchmarks on your own images. This one-field change only works for models that accept image input and support the same input_references shape, so check that a model is editing-capable before you switch to it.","To set a model and its options per environment instead of in code, use OpenRouter Presets：https://openrouter.ai/docs/guides/features/presets.","These failures are common enough to plan for:","The response reports the cost of each request in USD when usage data is available. Log it to track spend:","For batch jobs, stay within rate limits：https://openrouter.ai/docs/api_reference/limits. Retry 429 and 5xx responses with growing delays between tries, and limit how many edits run at once. Save each returned image before starting its next edit, so one failure does not lose finished work.","Copy the first request, use your own image, and run an edit. To create images from text instead, see the image generation docs：https://openrouter.ai/docs/guides/overview/multimodal/image-generation. To find current editing-capable models, browse the image model collection：https://openrouter.ai/collections/image-models.","Yes. Send the source image and a text instruction in one request to google/gemini-3.1-flash-image through the OpenRouter API, and the edited image comes back as base64 in the response. That model is Nano Banana 2. The full request fits on one screen, and you can run it in Python, TypeScript, or curl.","Image editing changes an existing image. Image generation creates a new image from text. Every editing request includes a source image in input_references and an instruction that says what to change and what to keep. If your request has no source image and works from a text prompt alone, that is generation.","The input_references field takes a base64 data URL for a local or private file, or a plain HTTP(S) URL for a public hosted image. Use the URL form to keep the request small when the image is already online, and the base64 form when the file is on your machine. Gemini accepts png, jpeg, webp, heic, and heif inputs ( image/png , image/jpeg , image/webp , image/heic , image/heif ). Supported formats vary by model, so check the model page before you send.","Yes. Change the model field and keep the rest of the request the same. Check the image model collection：https://openrouter.ai/collections/image-models first, because editing support, price, and speed vary by model.","Describe the change first, then name what to preserve, for example “Change the background to a snowy street at night. Keep the subject exactly as is.” One instruction per request works best. For precise results, edit in small steps and send each returned image back in as the source for the next prompt."],"articleImages":[{"sourceUrl":"https://openrouter.ai/blog/images/nano-banana.png","alt":"Nano Banana API: Edit Images with Gemini in Code","afterParagraph":0,"url":"/media/articles/cmtwlujuv02r0row7odx8rss3/203d54ca266986d9.png"},{"sourceUrl":"https://openrouter.ai/blog/images/nano-banana-before-after.png","alt":"Before-and-after example of a natural-language image edit: a portrait photo, the prompt \"Add a red wool scarf around the person's neck. Keep everything else the same.\", and the edited result with the scarf added and everything else intact","afterParagraph":1,"url":"/media/articles/cmtwlujuv02r0row7odx8rss3/62ca87086ab972a1.png"}],"mediaStatus":"ok","articleBodyZh":["本指南展示了如何在代码中编辑带有文本提示的图片。你通过 OpenRouter API 发送源图片和编辑提示到 google/gemini-3.1-flash-image，编辑后的图片会在回复中返回。“纳米香蕉”是谷歌 Gemini 图片模型的昵称。这个 slug 是 Nano Banana 2，是该系列的默认快速模型。因为你通过一个 API：https：//openrouter.ai/blog/announcements/image-api 访问它，之后可以通过更改一个字段来使用不同的编辑模型。","图像编辑会修改已有图像。图像生成会从文本生成新图像。本指南涵盖编辑，因此每个请求都包含源图像。关于从文本创建图像，请参见图像生成文档：https：//openrouter.ai/docs/guides/overview/multimodal/image-generation 或图像生成教程：https：//openrouter.ai/blog/tutorials/image-generation。","本指南默认是 google/gemini-3.1-flash-image，Nano Banana 2。它接收一张图片作为输入，返回经过编辑的图像。Nano Banana 家族目前有四个成员：Nano Banana 2（google/gemini-3.1-flash-image）是本指南的默认型号，Nano Banana 2 Lite（google/gemini-3.1-flash-lite-image）是最便宜且最快的，Nano Banana Pro（google/gemini-3-pro-image）速度较慢但质量更高，而最初的 Nano Banana（google/gemini-2.5-flash-image）是昵称最初的旧型号。","图片目录经常更换。模型会被添加、弃用和重新定价，所以你今天钉上的一个 slug 可能以后会被淘汰。在你构建模型之前，先检查它是否接受图像输入并支持你需要的编辑功能。你可以在图像模型集合中浏览支持编辑的模型：https：//openrouter.ai/collections/image-models。想了解目录，请参见图像生成模型：https：//openrouter.ai/blog/tutorials/image-generation-models。","下面的示例使用了每个请求中显示的 slug，这样你可以按写法运行，之后再修改模型。把密钥放在环境变量里，而不是代码里：","要编辑图片，只需在一次请求中发送源图片和文本指令。编辑后的图片会在回复中返回。这里有一个用 Python 编写的本地文件工作请求：","请求体在两种语言中相同。将参考图像放在 input_references 中，并将指令放在 prompt 中。这就是整个请求。","input_references 字段可以使用 base64 数据 URL 或 HTTP(S) URL。上面的示例对本地文件进行了编码。如果您的图像已经公开托管，则直接传递链接并跳过编码：","当图像是公开托管时，请使用 URL，因为这可以保持请求体小。对于本地或私有文件，请使用 base64。Gemini 接受 image/png、image/jpeg、image/webp、image/heic 和 image/heif 格式的输入。支持的格式因模型而异，因此在发送之前请查看模型页面。","API 将编辑后的图像作为 base64 数据返回在 data 数组中。解码 b64_json 值并写入文件：","打开 edited.png 查看结果。如果您想使用类型化客户端而非原始 HTTP，请使用 OpenRouter SDK，其有一个 images 资源调用相同的端点：","使用 pip install openrouter 安装 SDK。它会重复使用之前定义的 api_key，因此无需额外设置。","生成提示描述的是全新图像。编辑提示说明要更改的内容和要保持不变的内容。先说明更改，然后列出必须保持不变的部分：","您也可以将提示写成一个小块 JSON 文本：","API 将其视为普通文本，因此这并不是特殊模式。该结构可以帮助模型区分要更改的内容和保持不变的内容。在自己的图像上尝试句子形式和 JSON 形式，并保留效果更好的那种。","一次编辑不一定能得到你想要的结果。要进行下一轮编辑，将返回的图像作为下一次的源图像。获取响应中的 b64_json 值，将其转换为数据 URL，并在下一次的 input_references 中传递：","每次调用都会编辑上一次的结果，因此早期的更改会延续。每次调用给出一个指令。小修改更容易检查，也更容易在出错时重新操作。模型不会记住你之前的提示，因此每次新提示都要重复它应该保持不变的部分。","要向不同模型发送相同的编辑请求，请更改 model 字段。源图像、提示和响应处理代码保持不变：","使用 google/gemini-3.1-flash-image 作为快速默认选项。当你想获得最低价格时，使用 google/gemini-3.1-flash-lite-image。当你希望获得更高质量并且可以接受更高延迟时，使用 google/gemini-3-pro-image。原始的 google/gemini-2.5-flash-image 仍然可以使用相同的请求格式，但上面提到的新模型是更好的默认选择。当你想比较质量、成本或速度时，可以使用其他提供商的模型，例如 openai/gpt-5-image：https://openrouter.ai/blog/announcements/image-benchmarks 用于你自己的图像。此单字段更改仅适用于接受图像输入并支持相同 input_references 格式的模型，因此在切换之前请检查模型是否支持编辑。","要为每个环境设置模型及其选项，而不是在代码中设置，请使用 OpenRouter 预设：https://openrouter.ai/docs/guides/features/presets。","这些失败情况足够常见，需要提前规划：","当使用数据可用时，响应会报告每个请求的美元成本。记录它以跟踪花费：","对于批处理任务，请遵守速率限制：https://openrouter.ai/docs/api_reference/limits。对 429 和 5xx 响应进行重试，每次尝试间隔逐渐增加，并限制同时运行的编辑次数。在开始下一个编辑之前保存每个返回的图像，这样一次失败不会丢失已完成的工作。","复制第一次请求，使用你自己的图像，并运行一次编辑。若要从文本生成图像，请参阅图像生成文档：https://openrouter.ai/docs/guides/overview/multimodal/image-generation。要查找当前支持编辑的模型，请浏览图像模型集合：https://openrouter.ai/collections/image-models。","是的。通过 OpenRouter API 将源图像和文本指令在一次请求中发送到 google/gemini-3.1-flash-image，编辑后的图像将以 base64 形式返回。该模型是 Nano Banana 2。完整请求适合显示在一个屏幕上，并且可以在 Python、TypeScript 或 curl 中运行。","图像编辑是对现有图像进行修改。图像生成是从文本创建新图像。每个编辑请求都包括 input_references 中的源图像和说明，说明要更改什么和保留什么。如果请求没有源图像，仅根据文本提示生成图像，则属于生成。","input_references 字段接受本地或私人文件的 base64 数据 URL，或者公开托管图片的普通 HTTP(S) URL。当图片已经在线时，使用 URL 形式可以保持请求体积小；当文件在你的电脑上时，使用 base64 形式。Gemini 接受 png、jpeg、webp、heic 和 heif 输入（ image/png、image/jpeg、image/webp、image/heic、image/heif ）。支持的格式因模型而异，因此在发送前请先查看模型页面。","是的。更改 model 字段并保持请求的其他部分不变。请先查看图片模型集合：https://openrouter.ai/collections/image-models，因为不同模型的编辑支持、价格和速度各不相同。","先描述要更改的内容，然后说明要保留的内容，例如“将背景更改为夜晚的雪街。保持主题完全不变。” 每次请求最好只给一条指令。为了获得精确结果，可分小步骤编辑，并将每次返回的图像作为下一步提示的源图像发送。"],"translationStatus":"translated","bodyOrigin":"source-page","editorial":{"summary":"OpenRouter 发布图像编辑教程，展示如何通过 API 向 google/gemini-3.1-flash-image 提交源图与文本指令，并从响应中的 base64 数据获取编辑结果。","background":"教程区分图像编辑与文本生成图像，提供 Python 和 TypeScript 示例，并说明输入参考图可使用 base64 数据 URL 或公开的 HTTP(S) URL。","viewpoint":"Aioga 判断：这篇教程的重点是把图像编辑请求归纳为源图、文本指令和模型字段，并通过多轮小步编辑与可替换模型字段说明实际调用方式。","implications":"可能影响：开发者可能更容易比较并切换支持图像编辑的模型，但单篇教程不足以证明模型适合具体业务；接入前仍需要核验输入支持、编辑特性与当前价格。","nextStep":"后续观察：关注图像模型目录中的新增、下线与价格调整，并核对 Nano Banana 系列各模型的速度、质量和成本差异是否继续符合项目需求。","evidenceRefs":["title","summary","articleBody","source"],"status":"published","aiGenerated":true,"autoApproved":true,"generatedBy":"aioga-editorial:gpt-5.6-sol","reviewedBy":"aioga-editorial-review:gpt-5.6-sol","generatedAt":"2026-09-11T07:35:36.647Z","sourceHash":"35f57ee358280fca","review":{"approved":true,"groundedness":95,"clarity":91,"duplicationRisk":24,"blockingIssues":[],"notes":["“文本生成图像”可选改为“图像生成”，与来源材料中的术语更一致。","“Aioga 判断”和“可能影响”已明确标注为判断性内容，没有冒充来源事实。"]},"validation":{"passed":true,"mode":"ai-auto","revisions":0,"checks":["schema","length","source-attribution","editorial-labels","inference-boundary","low-source-overlap","no-html","independent-ai-review"]}},"tags":["行业动态","OpenRouter：Announcements（RSS）"],"translations":{"zh-CN":{"title":"OpenRouter 教程：用代码调用 Nano Banana 2 编辑图像","summary":"OpenRouter 发布教程，演示通过 API 向 google/gemini-3.1-flash-image（即 Nano Banana 2）发送源图和文本指令完成图像编辑，编辑结果以 base64 形式在响应中返回。教程给出 Python 和 TypeScript 示例、提示词写法、多轮小步编辑方法，以及更换模型只需改一个字段，并介绍了 Nano Banana 系列四个成员的价格与质量差异。","category":"行业动态","source":"openrouter.ai","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"OpenRouter 教程：用代码调用 Nano Banana 2 编辑图像 - Aioga AI资讯","description":"OpenRouter 发布教程，演示通过 API 向 google/gemini-3.1-flash-image（即 Nano Banana 2）发送源图和文本指令完成图像编辑，编辑结果以 base64 形式在响应中返回。教程给出 Python 和 TypeScript 示例、提示词写法、多轮小步编辑方法，以及更换模型只需改一个字段，并介绍了 Nano Ba...","url":"https://www.aioga.com/news/cmtwlujuv02r0row7odx8rss3/","articleBody":["本指南展示了如何在代码中编辑带有文本提示的图片。你通过 OpenRouter API 发送源图片和编辑提示到 google/gemini-3.1-flash-image，编辑后的图片会在回复中返回。“纳米香蕉”是谷歌 Gemini 图片模型的昵称。这个 slug 是 Nano Banana 2，是该系列的默认快速模型。因为你通过一个 API：https：//openrouter.ai/blog/announcements/image-api 访问它，之后可以通过更改一个字段来使用不同的编辑模型。","图像编辑会修改已有图像。图像生成会从文本生成新图像。本指南涵盖编辑，因此每个请求都包含源图像。关于从文本创建图像，请参见图像生成文档：https：//openrouter.ai/docs/guides/overview/multimodal/image-generation 或图像生成教程：https：//openrouter.ai/blog/tutorials/image-generation。","本指南默认是 google/gemini-3.1-flash-image，Nano Banana 2。它接收一张图片作为输入，返回经过编辑的图像。Nano Banana 家族目前有四个成员：Nano Banana 2（google/gemini-3.1-flash-image）是本指南的默认型号，Nano Banana 2 Lite（google/gemini-3.1-flash-lite-image）是最便宜且最快的，Nano Banana Pro（google/gemini-3-pro-image）速度较慢但质量更高，而最初的 Nano Banana（google/gemini-2.5-flash-image）是昵称最初的旧型号。","图片目录经常更换。模型会被添加、弃用和重新定价，所以你今天钉上的一个 slug 可能以后会被淘汰。在你构建模型之前，先检查它是否接受图像输入并支持你需要的编辑功能。你可以在图像模型集合中浏览支持编辑的模型：https：//openrouter.ai/collections/image-models。想了解目录，请参见图像生成模型：https：//openrouter.ai/blog/tutorials/image-generation-models。","下面的示例使用了每个请求中显示的 slug，这样你可以按写法运行，之后再修改模型。把密钥放在环境变量里，而不是代码里：","要编辑图片，只需在一次请求中发送源图片和文本指令。编辑后的图片会在回复中返回。这里有一个用 Python 编写的本地文件工作请求：","请求体在两种语言中相同。将参考图像放在 input_references 中，并将指令放在 prompt 中。这就是整个请求。","input_references 字段可以使用 base64 数据 URL 或 HTTP(S) URL。上面的示例对本地文件进行了编码。如果您的图像已经公开托管，则直接传递链接并跳过编码：","当图像是公开托管时，请使用 URL，因为这可以保持请求体小。对于本地或私有文件，请使用 base64。Gemini 接受 image/png、image/jpeg、image/webp、image/heic 和 image/heif 格式的输入。支持的格式因模型而异，因此在发送之前请查看模型页面。","API 将编辑后的图像作为 base64 数据返回在 data 数组中。解码 b64_json 值并写入文件：","打开 edited.png 查看结果。如果您想使用类型化客户端而非原始 HTTP，请使用 OpenRouter SDK，其有一个 images 资源调用相同的端点：","使用 pip install openrouter 安装 SDK。它会重复使用之前定义的 api_key，因此无需额外设置。","生成提示描述的是全新图像。编辑提示说明要更改的内容和要保持不变的内容。先说明更改，然后列出必须保持不变的部分：","您也可以将提示写成一个小块 JSON 文本：","API 将其视为普通文本，因此这并不是特殊模式。该结构可以帮助模型区分要更改的内容和保持不变的内容。在自己的图像上尝试句子形式和 JSON 形式，并保留效果更好的那种。","一次编辑不一定能得到你想要的结果。要进行下一轮编辑，将返回的图像作为下一次的源图像。获取响应中的 b64_json 值，将其转换为数据 URL，并在下一次的 input_references 中传递：","每次调用都会编辑上一次的结果，因此早期的更改会延续。每次调用给出一个指令。小修改更容易检查，也更容易在出错时重新操作。模型不会记住你之前的提示，因此每次新提示都要重复它应该保持不变的部分。","要向不同模型发送相同的编辑请求，请更改 model 字段。源图像、提示和响应处理代码保持不变：","使用 google/gemini-3.1-flash-image 作为快速默认选项。当你想获得最低价格时，使用 google/gemini-3.1-flash-lite-image。当你希望获得更高质量并且可以接受更高延迟时，使用 google/gemini-3-pro-image。原始的 google/gemini-2.5-flash-image 仍然可以使用相同的请求格式，但上面提到的新模型是更好的默认选择。当你想比较质量、成本或速度时，可以使用其他提供商的模型，例如 openai/gpt-5-image：https://openrouter.ai/blog/announcements/image-benchmarks 用于你自己的图像。此单字段更改仅适用于接受图像输入并支持相同 input_references 格式的模型，因此在切换之前请检查模型是否支持编辑。","要为每个环境设置模型及其选项，而不是在代码中设置，请使用 OpenRouter 预设：https://openrouter.ai/docs/guides/features/presets。","这些失败情况足够常见，需要提前规划：","当使用数据可用时，响应会报告每个请求的美元成本。记录它以跟踪花费：","对于批处理任务，请遵守速率限制：https://openrouter.ai/docs/api_reference/limits。对 429 和 5xx 响应进行重试，每次尝试间隔逐渐增加，并限制同时运行的编辑次数。在开始下一个编辑之前保存每个返回的图像，这样一次失败不会丢失已完成的工作。","复制第一次请求，使用你自己的图像，并运行一次编辑。若要从文本生成图像，请参阅图像生成文档：https://openrouter.ai/docs/guides/overview/multimodal/image-generation。要查找当前支持编辑的模型，请浏览图像模型集合：https://openrouter.ai/collections/image-models。","是的。通过 OpenRouter API 将源图像和文本指令在一次请求中发送到 google/gemini-3.1-flash-image，编辑后的图像将以 base64 形式返回。该模型是 Nano Banana 2。完整请求适合显示在一个屏幕上，并且可以在 Python、TypeScript 或 curl 中运行。","图像编辑是对现有图像进行修改。图像生成是从文本创建新图像。每个编辑请求都包括 input_references 中的源图像和说明，说明要更改什么和保留什么。如果请求没有源图像，仅根据文本提示生成图像，则属于生成。","input_references 字段接受本地或私人文件的 base64 数据 URL，或者公开托管图片的普通 HTTP(S) URL。当图片已经在线时，使用 URL 形式可以保持请求体积小；当文件在你的电脑上时，使用 base64 形式。Gemini 接受 png、jpeg、webp、heic 和 heif 输入（ image/png、image/jpeg、image/webp、image/heic、image/heif ）。支持的格式因模型而异，因此在发送前请先查看模型页面。","是的。更改 model 字段并保持请求的其他部分不变。请先查看图片模型集合：https://openrouter.ai/collections/image-models，因为不同模型的编辑支持、价格和速度各不相同。","先描述要更改的内容，然后说明要保留的内容，例如“将背景更改为夜晚的雪街。保持主题完全不变。” 每次请求最好只给一条指令。为了获得精确结果，可分小步骤编辑，并将每次返回的图像作为下一步提示的源图像发送。"]},"en":{"title":"OpenRouter Tutorial: Using Code to Edit Images with Nano Banana 2","summary":"OpenRouter release tutorial, demonstrating how to send source images and text instructions to google/gemini-3.1-flash-image (i.e., Nano Banana 2) via API to complete image editing, with the edited results returned in base64 format in the response. The tutorial provides Python and TypeScript examples, prompt writing methods, multi-step small edits, and mentions that changing the model only requires modifying one field. It also introduces the price and quality differences among the four members of the Nano Banana series.","category":"Industry","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"OpenRouter Tutorial: Using Code to Edit Images with Nano Banana 2 - Aioga AI News","description":"OpenRouter release tutorial, demonstrating how to send source images and text instructions to google/gemini-3.1-flash-image (i.e., Nano Banana 2) via API to complete image editing,...","url":"https://www.aioga.com/en/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:23:15.121Z"},"ja":{"title":"OpenRouter チュートリアル：コードで Nano Banana 2 を使って画像を編集する","summary":"OpenRouterのチュートリアルが公開され、APIを通じてgoogle/gemini-3.1-flash-image（つまりNano Banana 2）に元の画像とテキスト指示を送信して画像編集を行い、編集結果がbase64形式でレスポンスに返される様子を示しています。チュートリアルにはPythonとTypeScriptの例、プロンプトの書き方、複数回の小さなステップでの編集方法、モデルを変更する場合はフィールドを一つ変えるだけでよいことも紹介されており、さらにNano Bananaシリーズの4つのモデルの価格と品質の違いも説明されています。","category":"業界動向","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"OpenRouter チュートリアル：コードで Nano Banana 2 を使って画像を編集する - Aioga AIニュース","description":"OpenRouterのチュートリアルが公開され、APIを通じてgoogle/gemini-3.1-flash-image（つまりNano Banana 2）に元の画像とテキスト指示を送信して画像編集を行い、編集結果がbase64形式でレスポンスに返される様子を示しています。チュートリアルにはPythonとTypeScriptの例、プロンプトの書き方、複数回の...","url":"https://www.aioga.com/ja/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:23:29.912Z"},"ko":{"title":"OpenRouter 튜토리얼: 코드로 Nano Banana 2를 사용하여 이미지 편집하기","summary":"OpenRouter 게시 튜토리얼은 API를 통해 google/gemini-3.1-flash-image(즉 Nano Banana 2)에 원본 이미지와 텍스트 명령을 보내 이미지 편집을 완료하고, 편집 결과를 base64 형식으로 응답에 반환하는 방법을 시연합니다. 튜토리얼은 Python과 TypeScript 예제, 프롬프트 작성법, 다중 단계 소규모 편집 방법을 제공하며, 모델을 변경할 때는 하나의 필드만 수정하면 되도록 안내하고, Nano Banana 시리즈 네 멤버의 가격과 품질 차이도 소개합니다.","category":"업계 동향","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"OpenRouter 튜토리얼: 코드로 Nano Banana 2를 사용하여 이미지 편집하기 - Aioga AI 뉴스","description":"OpenRouter 게시 튜토리얼은 API를 통해 google/gemini-3.1-flash-image(즉 Nano Banana 2)에 원본 이미지와 텍스트 명령을 보내 이미지 편집을 완료하고, 편집 결과를 base64 형식으로 응답에 반환하는 방법을 시연합니다. 튜토리얼은 Python과 TypeScript 예제, 프롬프...","url":"https://www.aioga.com/ko/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:24:09.905Z"},"es":{"title":"Tutorial de OpenRouter: Usar código para llamar a Nano Banana 2 y editar imágenes","summary":"Tutorial de OpenRouter, demostrando cómo enviar imágenes originales e instrucciones de texto a google/gemini-3.1-flash-image (es decir, Nano Banana 2) a través de la API para realizar edición de imágenes, con los resultados de la edición devueltos en la respuesta en formato base64. El tutorial proporciona ejemplos en Python y TypeScript, la forma de escribir prompts, métodos de edición por pasos múltiples, y cambiar de modelo solo requiere modificar un campo, además de introducir las diferencias de precio y calidad de los cuatro miembros de la serie Nano Banana.","category":"Industria","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"Tutorial de OpenRouter: Usar código para llamar a Nano Banana 2 y editar imágenes - Aioga Noticias de IA","description":"Tutorial de OpenRouter, demostrando cómo enviar imágenes originales e instrucciones de texto a google/gemini-3.1-flash-image (es decir, Nano Banana 2) a través de la API para reali...","url":"https://www.aioga.com/es/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:24:09.762Z"},"fr":{"title":"Tutoriel OpenRouter : utiliser le code pour appeler Nano Banana 2 afin d’éditer des images","summary":"Tutoriel OpenRouter, montrant comment envoyer une image source et des instructions textuelles à google/gemini-3.1-flash-image (c'est-à-dire Nano Banana 2) via l'API pour effectuer l'édition d'image, le résultat de l'édition étant renvoyé sous forme de base64 dans la réponse. Le tutoriel fournit des exemples en Python et TypeScript, la rédaction des prompts, la méthode d'édition par petites étapes multiples, et indique que changer de modèle ne nécessite de modifier qu'un seul champ, tout en présentant les différences de prix et de qualité des quatre membres de la série Nano Banana.","category":"Industrie","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"Tutoriel OpenRouter : utiliser le code pour appeler Nano Banana 2 afin d’éditer des images - Aioga Actualités IA","description":"Tutoriel OpenRouter, montrant comment envoyer une image source et des instructions textuelles à google/gemini-3.1-flash-image (c'est-à-dire Nano Banana 2) via l'API pour effectuer...","url":"https://www.aioga.com/fr/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:24:49.827Z"},"de":{"title":"OpenRouter Tutorial: Verwendung von Code zur Bearbeitung von Bildern mit Nano Banana 2","summary":"OpenRouter Veröffentlichungstutorial, das demonstriert, wie man über die API Quellbilder und Textanweisungen an google/gemini-3.1-flash-image (d.h. Nano Banana 2) sendet, um Bildbearbeitungen durchzuführen, wobei die Bearbeitungsergebnisse in Base64-Form im Response zurückgegeben werden. Das Tutorial enthält Python- und TypeScript-Beispiele, Anleitungen zum Schreiben von Prompts, Methoden für mehrstufige Kleinschrittbearbeitung und erklärt, dass zum Wechseln des Modells nur ein Feld geändert werden muss, sowie eine Einführung in die Preis- und Qualitätsunterschiede der vier Mitglieder der Nano Banana-Serie.","category":"行业动态","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"OpenRouter Tutorial: Verwendung von Code zur Bearbeitung von Bildern mit Nano Banana 2 - Aioga KI-News","description":"OpenRouter Veröffentlichungstutorial, das demonstriert, wie man über die API Quellbilder und Textanweisungen an google/gemini-3.1-flash-image (d.h. Nano Banana 2) sendet, um Bildbe...","url":"https://www.aioga.com/de/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:24:50.984Z"},"pt-BR":{"title":"Tutorial do OpenRouter: Usando código para chamar o Nano Banana 2 para editar imagens","summary":"Tutorial do OpenRouter, demonstrando como enviar imagens de origem e instruções de texto para google/gemini-3.1-flash-image (ou seja, Nano Banana 2) através da API para realizar edição de imagens, com os resultados da edição retornados em base64 na resposta. O tutorial fornece exemplos em Python e TypeScript, formas de escrever prompts, método de edição em pequenos passos de múltiplas rodadas, e explica que para trocar de modelo basta alterar um campo, além de apresentar as diferenças de preço e qualidade entre os quatro membros da série Nano Banana.","category":"行业动态","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"Tutorial do OpenRouter: Usando código para chamar o Nano Banana 2 para editar imagens - Aioga Notícias de IA","description":"Tutorial do OpenRouter, demonstrando como enviar imagens de origem e instruções de texto para google/gemini-3.1-flash-image (ou seja, Nano Banana 2) através da API para realizar ed...","url":"https://www.aioga.com/pt-BR/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:25:29.020Z"},"ru":{"title":"Учебник OpenRouter: использование кода для вызова Nano Banana 2 для редактирования изображений","summary":"OpenRouter публикует руководство, показывающее, как с помощью API отправлять исходное изображение и текстовые инструкции в google/gemini-3.1-flash-image (то есть Nano Banana 2) для выполнения редактирования изображений, при этом результат редактирования возвращается в ответе в формате base64. Руководство содержит примеры на Python и TypeScript, инструкции по написанию подсказок, метод многократного пошагового редактирования, а для смены модели нужно изменить только одно поле, а также介绍 различия в цене и качестве четырех моделей серии Nano Banana.","category":"行业动态","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"Учебник OpenRouter: использование кода для вызова Nano Banana 2 для редактирования изображений - Aioga Новости ИИ","description":"OpenRouter публикует руководство, показывающее, как с помощью API отправлять исходное изображение и текстовые инструкции в google/gemini-3.1-flash-image (то есть Nano Banana 2) для...","url":"https://www.aioga.com/ru/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:25:32.030Z"},"ar":{"title":"دليل OpenRouter: استخدام الكود لاستدعاء Nano Banana 2 لتحرير الصور","summary":"نشر OpenRouter درسًا يوضح كيفية إرسال صورة المصدر وتعليمات نصية إلى google/gemini-3.1-flash-image (أي Nano Banana 2) عبر API لإجراء تحرير الصور، ويتم إرجاع نتائج التحرير في الاستجابة بصيغة base64. يقدم الدرس أمثلة على Python و TypeScript، وطريقة كتابة كلمات التلميح، وطريقة التحرير التدريجي متعدد الخطوات، كما يوضح أنه لتغيير النموذج يكفي تعديل حقل واحد، ويستعرض أيضًا الفرق في السعر والجودة بين الأعضاء الأربعة لسلسلة Nano Banana.","category":"行业动态","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"دليل OpenRouter: استخدام الكود لاستدعاء Nano Banana 2 لتحرير الصور - Aioga أخبار الذكاء الاصطناعي","description":"نشر OpenRouter درسًا يوضح كيفية إرسال صورة المصدر وتعليمات نصية إلى google/gemini-3.1-flash-image (أي Nano Banana 2) عبر API لإجراء تحرير الصور، ويتم إرجاع نتائج التحرير في الاستجا...","url":"https://www.aioga.com/ar/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:26:17.612Z"},"hi":{"title":"OpenRouter ट्यूटोरियल: कोड का उपयोग करके Nano Banana 2 से छवि संपादित करें","summary":"OpenRouter ट्यूटोरियल जारी किया, जो दिखाता है कि API के माध्यम से google/gemini-3.1-flash-image (यानी Nano Banana 2) को स्रोत छवि और टेक्स्ट निर्देश भेजकर चित्र संपादन कैसे किया जाता है, और संपादन परिणाम को base64 स्वरूप में प्रतिक्रिया में लौटाया जाता है। ट्यूटोरियल में Python और TypeScript उदाहरण, प्रॉम्प्ट लिखने का तरीका, छोटे चरणों में कई बार संपादन करने की विधि दी गई है, साथ ही मॉडल बदलने के लिए केवल एक फ़ील्ड बदलने की बात बताई गई है, और Nano Banana श्रृंखला के चार सदस्यों की कीमत और गुणवत्ता के अंतर को भी बताया गया है।","category":"行业动态","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"OpenRouter ट्यूटोरियल: कोड का उपयोग करके Nano Banana 2 से छवि संपादित करें - Aioga AI समाचार","description":"OpenRouter ट्यूटोरियल जारी किया, जो दिखाता है कि API के माध्यम से google/gemini-3.1-flash-image (यानी Nano Banana 2) को स्रोत छवि और टेक्स्ट निर्देश भेजकर चित्र संपादन कैसे किया जा...","url":"https://www.aioga.com/hi/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:26:16.495Z"},"it":{"title":"Tutorial di OpenRouter: utilizzare il codice per chiamare Nano Banana 2 per modificare immagini","summary":"Tutorial di OpenRouter, che mostra come inviare immagini di origine e istruzioni testuali a google/gemini-3.1-flash-image (cioè Nano Banana 2) tramite API per completare la modifica delle immagini, con i risultati della modifica restituiti in formato base64 nella risposta. Il tutorial fornisce esempi in Python e TypeScript, la scrittura dei prompt, il metodo di modifica iterativa a piccoli passi e spiega che per cambiare modello basta modificare un solo campo, oltre a introdurre le differenze di prezzo e qualità dei quattro membri della serie Nano Banana.","category":"行业动态","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"Tutorial di OpenRouter: utilizzare il codice per chiamare Nano Banana 2 per modificare immagini - Aioga Notizie IA","description":"Tutorial di OpenRouter, che mostra come inviare immagini di origine e istruzioni testuali a google/gemini-3.1-flash-image (cioè Nano Banana 2) tramite API per completare la modific...","url":"https://www.aioga.com/it/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:27:02.887Z"},"nl":{"title":"OpenRouter handleiding: afbeeldingen bewerken met Nano Banana 2 via code","summary":"OpenRouter publiceert een handleiding die laat zien hoe je via de API bronafbeeldingen en tekstinstructies naar google/gemini-3.1-flash-image (oftewel Nano Banana 2) stuurt om beeldbewerking uit te voeren, waarbij het bewerkte resultaat in base64-vorm in de reactie wordt teruggegeven. De handleiding geeft voorbeelden in Python en TypeScript, schrijft vormvrije promptmethodes voor, methode voor multi-step kleine bewerkingen, en het model aanpassen vereist slechts één veld te wijzigen. Ook worden de prijs- en kwaliteitsverschillen van de vier leden van de Nano Banana-serie geïntroduceerd.","category":"行业动态","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"OpenRouter handleiding: afbeeldingen bewerken met Nano Banana 2 via code - Aioga AI-nieuws","description":"OpenRouter publiceert een handleiding die laat zien hoe je via de API bronafbeeldingen en tekstinstructies naar google/gemini-3.1-flash-image (oftewel Nano Banana 2) stuurt om beel...","url":"https://www.aioga.com/nl/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:26:59.887Z"},"tr":{"title":"OpenRouter Eğitimi: Kod Kullanarak Nano Banana 2 ile Görüntü Düzenleme","summary":"OpenRouter eğitimini yayınladı, API aracılığıyla google/gemini-3.1-flash-image (yani Nano Banana 2) göndermek için kaynak görsel ve metin komutları kullanarak görüntü düzenlemenin nasıl yapıldığını gösteriyor ve düzenleme sonucu yanıt içinde base64 formatında dönüyor. Eğitimde Python ve TypeScript örnekleri, ipucu yazımı, çok adımlı küçük düzenleme yöntemleri verilmiş, model değiştirmek için sadece bir alanın değiştirilmesi gerektiği ve Nano Banana serisinin dört üyesinin fiyat ve kalite farkları da tanıtılmış.","category":"行业动态","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"OpenRouter Eğitimi: Kod Kullanarak Nano Banana 2 ile Görüntü Düzenleme - Aioga AI Haberleri","description":"OpenRouter eğitimini yayınladı, API aracılığıyla google/gemini-3.1-flash-image (yani Nano Banana 2) göndermek için kaynak görsel ve metin komutları kullanarak görüntü düzenlemenin...","url":"https://www.aioga.com/tr/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:27:44.099Z"},"vi":{"title":"Hướng dẫn OpenRouter: Sử dụng mã để gọi Nano Banana 2 chỉnh sửa hình ảnh","summary":"Hướng dẫn phát hành OpenRouter, trình bày cách gửi hình gốc và lệnh văn bản tới google/gemini-3.1-flash-image (tức Nano Banana 2) thông qua API để hoàn thành chỉnh sửa hình ảnh, kết quả chỉnh sửa được trả về trong phản hồi dưới dạng base64. Hướng dẫn đưa ra ví dụ bằng Python và TypeScript, cách viết prompt, phương pháp chỉnh sửa từng bước nhiều vòng, cũng như chỉ cần thay đổi một trường để đổi mô hình, và giới thiệu sự khác nhau về giá cả và chất lượng của bốn thành viên trong series Nano Banana.","category":"行业动态","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"Hướng dẫn OpenRouter: Sử dụng mã để gọi Nano Banana 2 chỉnh sửa hình ảnh - Tin tức AI Aioga","description":"Hướng dẫn phát hành OpenRouter, trình bày cách gửi hình gốc và lệnh văn bản tới google/gemini-3.1-flash-image (tức Nano Banana 2) thông qua API để hoàn thành chỉnh sửa hình ảnh, kế...","url":"https://www.aioga.com/vi/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:27:49.936Z"},"id":{"title":"Tutorial OpenRouter: Memanggil Nano Banana 2 dengan Kode untuk Mengedit Gambar","summary":"Tutorial OpenRouter, menunjukkan cara mengirim gambar sumber dan instruksi teks ke google/gemini-3.1-flash-image (yaitu Nano Banana 2) melalui API untuk menyelesaikan pengeditan gambar, dengan hasil pengeditan dikembalikan dalam bentuk base64 di respons. Tutorial ini memberikan contoh Python dan TypeScript, cara penulisan prompt, metode pengeditan bertahap multi-putaran, serta hanya perlu mengganti satu kolom untuk mengganti model, dan juga memperkenalkan perbedaan harga dan kualitas dari empat anggota seri Nano Banana.","category":"行业动态","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"Tutorial OpenRouter: Memanggil Nano Banana 2 dengan Kode untuk Mengedit Gambar - Berita AI Aioga","description":"Tutorial OpenRouter, menunjukkan cara mengirim gambar sumber dan instruksi teks ke google/gemini-3.1-flash-image (yaitu Nano Banana 2) melalui API untuk menyelesaikan pengeditan ga...","url":"https://www.aioga.com/id/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:28:27.885Z"},"th":{"title":"คู่มือ OpenRouter: ใช้โค้ดเรียก Nano Banana 2 เพื่อแก้ไขภาพ","summary":"OpenRouter เผยแพร่บทเรียนสอนการใช้งาน แสดงวิธีส่งภาพต้นฉบับและคำสั่งข้อความไปยัง google/gemini-3.1-flash-image (หรือที่เรียกว่า Nano Banana 2) ผ่าน API เพื่อทำการแก้ไขภาพ ผลลัพธ์การแก้ไขจะถูกส่งกลับในรูปแบบ base64 บทเรียนให้ตัวอย่างการใช้งานทั้ง Python และ TypeScript วิธีเขียนคำสั่ง คำแนะนำสำหรับการแก้ไขทีละขั้นตอนหลายรอบ และการเปลี่ยนโมเดลทำได้เพียงแก้ไขฟิลด์เดียว พร้อมแนะนำความแตกต่างด้านราคาและคุณภาพของสมาชิกทั้งสี่รุ่นในซีรีส์ Nano Banana","category":"行业动态","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"คู่มือ OpenRouter: ใช้โค้ดเรียก Nano Banana 2 เพื่อแก้ไขภาพ - ข่าว AI Aioga","description":"OpenRouter เผยแพร่บทเรียนสอนการใช้งาน แสดงวิธีส่งภาพต้นฉบับและคำสั่งข้อความไปยัง google/gemini-3.1-flash-image (หรือที่เรียกว่า Nano Banana 2) ผ่าน API เพื่อทำการแก้ไขภาพ ผลลัพธ์กา...","url":"https://www.aioga.com/th/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:28:37.387Z"},"pl":{"title":"Samouczek OpenRouter: używanie kodu do wywoływania Nano Banana 2 w celu edycji obrazów","summary":"OpenRouter opublikował samouczek, pokazujący, jak za pomocą API wysyłać obraz źródłowy i instrukcje tekstowe do google/gemini-3.1-flash-image (czyli Nano Banana 2) w celu edycji obrazu, przy czym wynik edycji zwracany jest w odpowiedzi w formie base64. Samouczek zawiera przykłady w Python i TypeScript, sposoby pisania promptów, metodę wieloetapowej drobnej edycji, a także informuje, że zmiana modelu wymaga zmiany tylko jednego pola, oraz opisuje różnice cenowe i jakościowe czterech członków serii Nano Banana.","category":"行业动态","source":"OpenRouter：Announcements（RSS）","aggregationSource":"OpenRouter：Announcements（RSS）","pageTitle":"Samouczek OpenRouter: używanie kodu do wywoływania Nano Banana 2 w celu edycji obrazów - Aioga Wiadomości AI","description":"OpenRouter opublikował samouczek, pokazujący, jak za pomocą API wysyłać obraz źródłowy i instrukcje tekstowe do google/gemini-3.1-flash-image (czyli Nano Banana 2) w celu edycji ob...","url":"https://www.aioga.com/pl/news/cmtwlujuv02r0row7odx8rss3/","contentTranslated":true,"sourceHash":"6eb84f6023dec616","translatedAt":"2026-09-11T07:29:19.393Z"}},"evidenceTier":"verified-news","reviewStatus":"editorial-selected","indexable":true,"editorialCover":""}}