PromptsRush
Prompts

Browse

All PromptsThe full curated libraryPrompts GalleryVisual, Pinterest-style browsingImage PromptsMidjourney, DALL·E & SDXLVideo PromptsRunway, Kling & SoraText & TemplatesChatGPT & Claude system prompts

Discover

CategoriesExplore prompts by topicAI ModelsBest prompts per modelPrompt PacksCommunity, passcode-protectedSubmit a PromptShare with the community

For Creators

Turn prompts into followers

Share passcode-protected prompt packs and grow your audience with Auto DM.

Start sharing
Marketplace

Explore

Shared PromptsPasscode-protected prompt packsAI SkillsNewInstallable Agent SkillsDesign SystemsNewLive themes & design tokens

Contribute

Submit a PromptPublish a prompt packSubmit a SkillShip an Agent SkillSubmit a DesignShare a design system

New · Skills

Teach your AI new tricks

Install ready-made skills for Claude, ChatGPT, Gemini, n8n & more.

Browse skills
Learn

Learning Tracks

Prompt EngineeringWrite prompts that deliverAI SkillsBuild & ship Agent SkillsAI AutomationWorkflows, agents & MCPDesign SystemsOn-brand UI with AI

More

Learning HubAll tracks · 40+ lessonsBlogGuides, news & deep diveseBooksPremium prompt packs & guides

100% Free

Learn AI, the practical way

From fundamentals to advanced across four hands-on tracks — no fluff.

Explore the hub
Blog
LoginSign Up
PromptsRush

The ultimate directory for finding, sharing, and managing production-ready AI prompts, system instructions, and advanced templates.

TwitterGitHubYouTubeInstagramEmail

Platform

  • Home
  • Browse Prompts
  • Marketplace
  • Skills
  • Categories
  • Submit a Skill

Top Categories

  • Image PromptPopular
  • Video Prompts
  • Text Templates

Company

  • Privacy Policy
  • Terms of Service
  • Contact Us

Subscribe on YouTube

New AI prompt & skills tutorials every week.

Subscribe

© 2026 PromptsRush. Crafted with & Passion.

All systems operational
HomeBlogTutorials
Tutorials

Free AI Image Generation in the Terminal: ChatGPT Plus + Gemini Guide

Generate AI images for free from your terminal using your ChatGPT Plus/Pro subscription, Gemini Nano Banana, and GPT Image 2 — one command, no browser.

P
PromptsRushJune 12, 2026
•13 min read3 views

Advertisement

The cheapest way to generate AI images in 2026 is not the OpenAI API. It is not Midjourney. It is your existing ChatGPT Plus subscription — accessed through your terminal, with no browser, no API key, and no per-image bill. The trick is a small open-source CLI called nanaban, which reads your Codex OAuth token and proxies image generation through ChatGPT's backend so every image counts against your ChatGPT Plus / Pro quota instead of an API balance.

Same idea, broader picture. Nanaban unifies three image backends behind one command — GPT Image 2 (free via ChatGPT Plus/Pro), Google Gemini's Nano Banana 2 and Pro (cents per image), and OpenAI's GPT-5 Image and GPT-5 Image Mini via OpenRouter. You type a prompt, you get a file. Auto-named from the prompt. 14 aspect ratios. Script-friendly stdout. Works inside Claude Code, Codex, and Gemini agents as a Skill.

This guide walks through the whole setup. How nanaban works, how to wire up the free path, the four real workflows it unlocks, and where the trade-offs are. By the end you will have a terminal where typing five words produces a PNG in three seconds for zero marginal cost.

Recommended · OpenArtCreator Pick

Generate Stunning AI Art & Characters

The most powerful AI image suite for creators. Train custom models, design consistent characters, and ship beautiful visuals fast.

Create with OpenArt

Affiliate link · We may earn a commission

Why Terminal Image Generation Matters

For most people, "AI image generation" means a web app — ChatGPT, Midjourney, OpenArt, Gemini. Type a prompt, wait, download. That works for one-off creative asks. It breaks for everything else.

Use caseBrowser painTerminal advantage
Batch generate 50 variations50 manual clicks + downloadsOne while-loop over a prompts.txt file
LLM agent calls image gen as a toolImpossible without an APIStandard subprocess call with --json output
CI pipeline generates social assetsCannot do — no browser in CIOne CLI command in the workflow file
Test prompt variations rapidly20 seconds per iteration3 seconds per iteration in a terminal
Pipe an image into another toolDownload → upload → repeatPipe straight to `xargs open` or `imagemagick`

The browser is the wrong tool for any workflow that touches more than one image. The terminal is where image generation belongs once you treat it as part of a real pipeline.

The Free Path in One Sentence

Install nanaban. Run codex login once. Run nanaban "your prompt". Every image you generate comes out of your ChatGPT Plus / Pro image quota — not an API bill, not Midjourney credits, not anything else you pay for separately.

That is it. If you already pay for ChatGPT Plus or Pro, you have already paid for this. Nanaban just gives you a terminal-native way to use the image quota you are already getting.

Pro tip: The mechanism here is fully legitimate. Nanaban uses the Codex OAuth token that the official Codex CLI writes to ~/.codex/auth.json when you run codex login. It hits the same backend your ChatGPT app does. You are not jailbreaking anything — you are using your own paid quota through a different client.

What is Nanaban?

Nanaban is an open-source CLI built by Boris Djordjevic at Paperfoot AI / 199 Biotechnologies. It is MIT-licensed, ships as a Homebrew tap, an npm package, and standalone bun-compiled binaries for macOS and Linux. One command, one image, automatic filename, three-second turnaround in normal use.

What sets it apart from a thin OpenAI wrapper:

  • Three backends, one command. GPT Image 2 (OpenAI, free via Codex), Nano Banana 2 / Pro (Google Gemini), and GPT-5 Image / Mini (OpenAI via OpenRouter).
  • Auto-detected transport. If you are logged into Codex, it picks GPT Image 2 by default. If not, it falls back to whichever provider key you have configured.
  • Auto-naming from the prompt. "a fox in a snowy forest at dawn" becomes fox_snowy_forest_dawn.png. Collisions auto-increment.
  • 14 aspect ratios on Nano Banana 2. Including extreme panoramic (1:8, 8:1) and tall portrait (1:4, 4:1) that GPT Image 2 cannot do.
  • Script-friendly output. Stdout is the file path only; metadata to stderr. Pipe straight to xargs, jq, or anything else.
  • Agent mode. The --json flag returns structured output with cost, duration, dimensions, and a fallback audit trail — exactly what an LLM agent needs to consume the result programmatically.
  • Image editing. nanaban edit photo.png "make it a pencil sketch" runs an image-to-image edit.
  • Style references. Pass -r style.png to apply that image's visual language (color, composition, texture) to a fresh generation.
  • Skill installation. nanaban skill install registers it with Claude Code, Codex, and Gemini so an agent can call it directly.

Source on GitHub at paperfoot/nanaban-cli. Full skill page on PromptsRush at /marketplace/skills/nanaban-cli.

Setup — From Zero to First Image in 90 Seconds

Step 1 — Install Nanaban

Homebrew is the easiest path on macOS:

brew install paperfoot/tap/nanaban

npm if you already have Node 18+:

npm install -g nanaban

Or grab a standalone binary from the GitHub releases — bun-compiled, no Node.js runtime required. The macOS Apple Silicon one:

curl -L https://github.com/paperfoot/nanaban-cli/releases/latest/download/nanaban-darwin-arm64 -o /usr/local/bin/nanaban && chmod +x /usr/local/bin/nanaban

Step 2 — Authenticate (the free path)

For the free GPT Image 2 backend, install Codex CLI and run:

codex login

This writes an OAuth token to ~/.codex/auth.json. Nanaban reads it on demand. From here on, every nanaban generation routes through ChatGPT's backend and decrements your ChatGPT Plus / Pro image quota.

If you do not have a ChatGPT subscription, skip this step and use one of the alternative backends:

nanaban auth set-openrouter # for OpenRouter (Gemini, GPT-5 Image)
nanaban auth set # for Gemini direct

Step 3 — Generate your first image

nanaban "cyberpunk tokyo street neon rain"

Three seconds later there is a file in your current directory called something like cyberpunk_tokyo_street_neon_rain.png. Open it.

That is the entire setup. Five lines, three of which are a one-time install. Everything from here is optimisation.

OpenArtCreator Pick

Generate Stunning AI Art & Characters

The most powerful AI image suite for creators. Train custom models, design consistent characters, and ship beautiful visuals fast.

Affiliate link · We may earn a commission

Create with OpenArt

The Three Backends — When to Use Which

BackendCost per imageBest forAspect ratios
GPT Image 2 (via Codex OAuth)$0 (uses ChatGPT Plus/Pro quota)Strong text rendering, agentic planning, high fidelity1:1, 2:3, 3:2
Nano Banana 2 (Gemini)$0.067Fast batch work, extreme aspect ratios, panoramasAll 14 (including 1:8, 8:1)
Nano Banana Pro (Gemini)$0.136Higher detail when budget allowsStandard 10
GPT-5 Image (OpenRouter)$0.193UI rendering, on-image typography1:1, 2:3, 3:2
GPT-5 Image Mini (OpenRouter)$0.041Budget OpenAI alternative1:1, 2:3, 3:2

The honest recommendation for most users: leave the default backend as GPT Image 2 (free), and pin Nano Banana 2 with --via gemini-direct or --model nb2 when you need a panoramic ratio that GPT Image 2 cannot produce.

If you do not have a ChatGPT subscription, Nano Banana 2 is the next-best default at $0.067 per image — cheap enough that a hundred generations cost less than a coffee.

The Workflows Nanaban Actually Unlocks

Workflow 1 — Batch generation from a prompts file

The single biggest reason to leave the browser. Write fifty prompts in a text file, generate all fifty:

cat prompts.txt | while read p; do nanaban "$p"; done

On the free Codex backend this costs $0 (within your ChatGPT image quota). On Nano Banana 2 it costs about $3.35. Total time: under five minutes for fifty images.

Workflow 2 — Pipe to your editor or browser

Stdout is the file path only. Pipe it to whatever you want next:

nanaban "a red circle" --json | jq -r .file | xargs open

That command generates the image, parses the JSON output for the file path, and opens it in your default viewer. One line.

Workflow 3 — Image editing

Edit an existing image with a natural-language instruction:

nanaban edit headshot.png "make it a pencil sketch"

Or apply a style reference to a fresh generation:

nanaban "portrait of a woman" -r vermeer_painting.png

The reference image's color, composition, and texture get applied to the generation. This is the cleanest path we have seen for style-locked product shots — one reference image, dozens of consistent product variations.

Workflow 4 — LLM agent tool use

The big one for agent builders. Run:

nanaban skill install

This registers nanaban as a callable Skill in Claude Code, Codex, and Gemini. Any of those agents can now call nanaban as a tool — generate an image, get a file path back, use that file path in the next step.

For programmatic use, the --json flag returns a clean structured response:

{
  "file": "fox_snowy_forest_dawn.png",
  "model": "gpt-image-2",
  "transport": "codex-oauth",
  "cost_usd": 0,
  "duration_ms": 2840,
  "dimensions": "1024x1024",
  "fallbacks_attempted": []
}

For a Claude Code agent building a thumbnail, this is exactly the contract you want — a known file path, a known cost, a known size, and an audit trail of which backend actually served the request.

Aspect Ratios and Sizes

The biggest practical difference between backends. If you are working in vertical 9:16 for Shorts or horizontal 16:9 for YouTube, you need Nano Banana 2.

Aspect ratioNano Banana 2Nano Banana ProGPT Image 2 / GPT-5
1:1 (square)YesYesYes
2:3 / 3:2 (standard photo)YesYesYes
9:16 / 16:9 (social, video)YesYesNo
1:4 / 4:1 (tall / wide)YesNoNo
1:8 / 8:1 (extreme panorama)YesNoNo

Resolution caps: GPT Image 2 and GPT-5 variants are 1024px only. Nano Banana 2 goes from 0.5K up to 4K — useful when you want a generation you can use at billboard size without upscaling.

Use the --ar flag to set the ratio and --size for the resolution:

nanaban "panoramic alpine landscape sunset" --ar 4:1 --size 4k

The Honest Trade-offs

The free path is real but not magic.

  • Your ChatGPT image quota is finite. Plus and Pro have daily image limits — generous, but not unlimited. Heavy batch work will exhaust them. When it does, configure an OpenRouter or Gemini key as fallback and nanaban will silently route there.
  • GPT Image 2 is locked to 1024px and three ratios. For wide / tall / 4K work, you need Nano Banana 2, which costs cents per image.
  • Negative prompts are Gemini-only. If you need explicit "do not include X" guidance, that path is Nano Banana 2 or Pro.
  • You are using your subscription quota. Heavy nanaban use will eat into the same image budget you use through the ChatGPT app. Plan accordingly.
  • OAuth tokens expire. When yours does, re-run codex login. Nanaban surfaces an AUTH_EXPIRED error code so an agent caller can handle the case cleanly.

None of these break the use case. They are just the lines you should know exist before you build a pipeline that depends on the free path.

How This Stacks Up Against Other Image Tools

ToolCostTerminal-nativeBest for
Nanaban (Codex backend)$0 (with ChatGPT Plus/Pro)YesAnyone with a ChatGPT subscription doing scripted image work
Nanaban (Gemini backend)$0.067/imgYesPanoramic, vertical 9:16, batch work without ChatGPT
Midjourney$10-30/moNo (Discord)Premium creative work, distinctive style
OpenAI DALL-E API$0.04-0.17/imgYes (via API)Production app integration with billing tracking
OpenArtFree tier + paidNoBrowser-based with multi-model access (Flux, Midjourney style)
ComfyUI + local models$0 (hardware required)No (mostly)Air-gapped pro workflows with full control

The honest split: nanaban for pipelines, scripts, agents, and any workflow that touches more than one image; OpenArt or Midjourney for browser-based creative exploration; ComfyUI for the air-gapped advanced lane. They are not competitors — they cover different jobs.

A Real Pipeline — Generating Blog Thumbnails From Post Titles

To make this concrete, here is the actual five-line pipeline we use to draft thumbnails for new blog posts. The input is a CSV of post titles; the output is a folder of thumbnail candidates.

tail -n +2 posts.csv | cut -d',' -f1 | while read title; do
  nanaban "blog thumbnail, $title, bold typography, dark background, indigo accent" --ar 16:9 --model nb2 -o "thumbs/$(echo $title | tr ' ' '_' | tr -d '\"').png"
done

Reading from a 12-row CSV. Nano Banana 2 at $0.067 per image. Total cost: about $0.80. Total time: under two minutes. Browser equivalent: a half-hour of clicking.

For an LLM-driven version of the same workflow, the Claude Code agent calls nanaban --json as a tool, gets the file path back, and decides whether to regenerate based on the response. The agent loop is genuinely well-served by the structured JSON contract.

The Verdict

If you have a ChatGPT Plus or Pro subscription, you should install nanaban today. Five minutes of setup, and every image you generate from your terminal afterward costs you nothing on top of what you already pay. The free GPT Image 2 path alone justifies the install.

Even without a ChatGPT subscription, the multi-backend design makes nanaban a strong default — Nano Banana 2 at $0.067 per image is one of the cheapest serious image generators available, and the script-friendly interface is unmatched. If your workflow touches the terminal at all, this is the tool to wire in.

For the full install instructions, supported features, and FAQ, the skill page is at /marketplace/skills/nanaban-cli.

Recommended · OpenArtCreator Pick

Generate Stunning AI Art & Characters

The most powerful AI image suite for creators. Train custom models, design consistent characters, and ship beautiful visuals fast.

Create with OpenArt

Affiliate link · We may earn a commission

Keep Reading

  • Nanaban CLI on the PromptsRush directory — the skill page with the download and full SKILL.md.
  • How to Use Claude Code for FREE — same principle applied to coding instead of images.
  • AI Skills vs Prompts: What's the Difference? — the conceptual primer on what a Skill actually is.
  • Best Nano Banana 2 Fashion Photography Prompts — prompts to pair with the nb2 backend.
  • OpenArt Review 2026 — the browser-based image platform that pairs with nanaban for creative exploration.
  • How to Create a UI Design Skill Using design.md — pair this with nanaban so your agent generates on-brand images.
  • Prompt Library — the searchable prompt collection across image, video, and writing.
  • All AI Models — model catalogue with pricing and capabilities.
❓

Frequently Asked Questions

10 questions answered

The CLI itself is MIT-licensed and free. For image generation: GPT Image 2 is free for ChatGPT Plus and Pro subscribers via Codex OAuth — generations decrement your existing subscription image quota, not an OpenAI API balance. The Gemini Nano Banana and GPT-5 Image backends cost cents per image but are optional.
It reads the OAuth token written by `codex login` (stored in ~/.codex/auth.json) and proxies image generation through ChatGPT's backend. Each image counts against your ChatGPT Plus or Pro image quota — no OpenAI API key, no separate billing. Your existing subscription covers it.
Only if you want the free GPT Image 2 backend. For the Gemini Nano Banana or OpenRouter GPT-5 backends, you just need the relevant API key set via `nanaban auth set` or `nanaban auth set-openrouter`. Codex CLI is the unlock for the free path specifically.
Yes — through the Gemini Nano Banana 2 backend. GPT Image 2 and the GPT-5 variants are limited to 1:1, 2:3, and 3:2. Nano Banana 2 supports all 14 ratios including 9:16, 16:9, 1:4, 4:1, 1:8, and 8:1. Pin it with `--model nb2` or `--via gemini-direct`.
Both. Run `nanaban edit photo.png "make it a pencil sketch"` for image-to-image editing with a natural-language instruction. For style-locked generation, pass a reference image with `-r style.png` and nanaban will apply that image's color, composition, and texture to a fresh generation.
Yes. Run `nanaban skill install` once and nanaban registers itself as a Skill for Claude Code, Codex, and Gemini. The `--json` flag returns structured output with file path, model, cost, duration, dimensions, and a fallback audit trail — exactly the contract an LLM agent needs.
If you have OpenRouter or Gemini API keys configured, nanaban auto-falls back to those backends silently. The agent JSON mode surfaces the actual transport used so an LLM caller can see when the fallback fired. If you have no fallback configured, nanaban returns a RATE_LIMITED error with machine-readable hints.
Same backend, same quota — but terminal-native. Where the ChatGPT app forces you to click, copy, and download, nanaban gives you a one-command CLI that auto-names files, pipes to other tools, and works in scripts and CI. Use the app for one-off creative exploration; use nanaban for anything that touches more than one image.
Nanaban uses the same OAuth token that the official Codex CLI uses, hitting the same backend your ChatGPT app does. You are using your own paid quota through a different client — analogous to using a third-party email client with your Gmail account. Read OpenAI's terms for the latest position, but the mechanism is fully above-board.
Homebrew on macOS (`brew install paperfoot/tap/nanaban`) is the simplest. The standalone binary from GitHub releases is the next best — no Node.js runtime needed. npm (`npm install -g nanaban`) is fine if you already have Node 18+. All three give you the same CLI; pick whatever fits your existing setup.
Back to Blog

Table of Contents

In this article

  • 1Why Terminal Image Generation Matters
  • 2The Free Path in One Sentence
  • 3What is Nanaban?
  • 4Setup — From Zero to First Image in 90 Seconds
  • Step 1 — Install Nanaban
  • Step 2 — Authenticate (the free path)
  • Step 3 — Generate your first image
  • 5The Three Backends — When to Use Which
  • 6The Workflows Nanaban Actually Unlocks
  • Workflow 1 — Batch generation from a prompts file
  • Workflow 2 — Pipe to your editor or browser
  • Workflow 3 — Image editing
  • Workflow 4 — LLM agent tool use
  • 7Aspect Ratios and Sizes
  • 8The Honest Trade-offs
  • 9How This Stacks Up Against Other Image Tools
  • 10A Real Pipeline — Generating Blog Thumbnails From Post Titles
  • 11The Verdict
  • 12Keep Reading

Recent Posts

Claude Opus 5 vs Gemini 3.6 Flash

Jul 25 · 8 min

33+ Best Prompts for Claude Opus 5

Jul 25 · 20 min

40+ Best Prompts for Gemini 3.6 Flash

Jul 25 · 21 min

Kimi K3 vs Fable 5: Detailed Comparison & Benchmarks

Jul 19 · 5 min

11+ Prompts to Redesign Existing Web Pages

Jul 13 · 18 min

Category

Tutorials

Advertisement

You May Also Like

Tutorials

How to Use ChatGPT for Content Creation

Jul 129 min
Tutorials

How Design.md Improves AI Coding Results

Jul 511 min
H
Tutorials

How to Use Claude Code for FREE: The Complete 2026 Guide

Jun 1214 min