Skip to content

Commit 67c3a4e

Browse files
authored
feat(image_gen): upgrade Recraft V3 → V4 Pro, Nano Banana → Pro (NousResearch#11406)
* feat(image_gen): upgrade Recraft V3 → V4 Pro, Nano Banana → Pro Upstream asked for these two upgrades ASAP — the old entries show stale models when newer, higher-quality versions are available on FAL. Recraft V3 → Recraft V4 Pro ID: fal-ai/recraft-v3 → fal-ai/recraft/v4/pro/text-to-image Price: $0.04/image → $0.25/image (6x — V4 Pro is premium tier) Schema: V4 dropped the required `style` enum entirely; defaults handle taste now. Added `colors` and `background_color` to supports for brand-palette control. `seed` is not supported by V4 per the API docs. Nano Banana → Nano Banana Pro ID: fal-ai/nano-banana → fal-ai/nano-banana-pro Price: $0.08/image → $0.15/image (1K); $0.30 at 4K Schema: Aspect ratio family unchanged. Added `resolution` (1K/2K/4K, default 1K for billing predictability), `enable_web_search` (real-time info grounding, +$0.015), and `limit_generations` (force exactly 1 image). Architecture: Gemini 2.5 Flash → Gemini 3 Pro Image. Quality and reasoning depth improved; slower (~6s → ~8s). Migration: users who had the old IDs in `image_gen.model` will fall through the existing 'unknown model → default' warning path in `_resolve_fal_model()` and get the Klein 9B default on the next run. Re-run `hermes tools` → Image Generation to pick the new version. No silent cost-upgrade aliasing — the 2-6x price jump on these tiers warrants explicit user re-selection. Portal note: both new model IDs need to be allowlisted on the Nous fal-queue-gateway alongside the previous 7 additions, or users on Nous Subscription will see the 'managed gateway rejected model' error we added previously (which is clear and self-remediating, just noisy). * docs: wrap '<1s' in backticks to unblock MDX compilation Docusaurus's MDX parser treats unquoted '<' as the start of JSX, and '<1s' fails because '1' isn't a valid tag-name start character. This was broken on main since PR NousResearch#11265 (never noticed because docs-site-checks was failing on OTHER issues at the time and we admin-merged through it). Wrapping in backticks also gives the cell monospace styling which reads more cleanly alongside the inline-code model ID in the same row. The other '<1s' occurrence (line 52) is inside a fenced code block and is already safe — code fences bypass MDX parsing.
1 parent d893d4e commit 67c3a4e

5 files changed

Lines changed: 40 additions & 30 deletions

File tree

tests/tools/test_image_generation.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,16 @@ class TestAspectRatioFamily:
107107
"""Nano-banana uses aspect_ratio enum, NOT image_size."""
108108

109109
def test_nano_banana_landscape_uses_aspect_ratio(self, image_tool):
110-
p = image_tool._build_fal_payload("fal-ai/nano-banana", "hello", "landscape")
110+
p = image_tool._build_fal_payload("fal-ai/nano-banana-pro", "hello", "landscape")
111111
assert p["aspect_ratio"] == "16:9"
112112
assert "image_size" not in p
113113

114114
def test_nano_banana_square_uses_aspect_ratio(self, image_tool):
115-
p = image_tool._build_fal_payload("fal-ai/nano-banana", "hello", "square")
115+
p = image_tool._build_fal_payload("fal-ai/nano-banana-pro", "hello", "square")
116116
assert p["aspect_ratio"] == "1:1"
117117

118118
def test_nano_banana_portrait_uses_aspect_ratio(self, image_tool):
119-
p = image_tool._build_fal_payload("fal-ai/nano-banana", "hello", "portrait")
119+
p = image_tool._build_fal_payload("fal-ai/nano-banana-pro", "hello", "portrait")
120120
assert p["aspect_ratio"] == "9:16"
121121

122122

@@ -164,13 +164,17 @@ def test_gpt_image_strips_unsupported_overrides(self, image_tool):
164164
assert "num_inference_steps" not in p
165165

166166
def test_recraft_has_minimal_payload(self, image_tool):
167-
# Recraft supports prompt, image_size, style only.
168-
p = image_tool._build_fal_payload("fal-ai/recraft-v3", "hi", "landscape")
169-
assert set(p.keys()) <= {"prompt", "image_size", "style"}
167+
# Recraft V4 Pro supports prompt, image_size, enable_safety_checker,
168+
# colors, background_color (no seed, no style — V4 dropped V3's style enum).
169+
p = image_tool._build_fal_payload("fal-ai/recraft/v4/pro/text-to-image", "hi", "landscape")
170+
assert set(p.keys()) <= {
171+
"prompt", "image_size", "enable_safety_checker",
172+
"colors", "background_color",
173+
}
170174

171175
def test_nano_banana_never_gets_image_size(self, image_tool):
172176
# Common bug: translator accidentally setting both image_size and aspect_ratio.
173-
p = image_tool._build_fal_payload("fal-ai/nano-banana", "hi", "landscape", seed=1)
177+
p = image_tool._build_fal_payload("fal-ai/nano-banana-pro", "hi", "landscape", seed=1)
174178
assert "image_size" not in p
175179
assert p["aspect_ratio"] == "16:9"
176180

@@ -285,9 +289,9 @@ def test_env_var_fallback_when_no_config(self, image_tool, monkeypatch):
285289
def test_config_wins_over_env_var(self, image_tool, monkeypatch):
286290
monkeypatch.setenv("FAL_IMAGE_MODEL", "fal-ai/z-image/turbo")
287291
with patch("hermes_cli.config.load_config",
288-
return_value={"image_gen": {"model": "fal-ai/nano-banana"}}):
292+
return_value={"image_gen": {"model": "fal-ai/nano-banana-pro"}}):
289293
mid, _ = image_tool._resolve_fal_model()
290-
assert mid == "fal-ai/nano-banana"
294+
assert mid == "fal-ai/nano-banana-pro"
291295

292296

293297
# ---------------------------------------------------------------------------
@@ -387,10 +391,10 @@ def test_4xx_translates_to_value_error_with_remediation(self, image_tool, monkey
387391
lambda gw: mock_managed_client)
388392

389393
with pytest.raises(ValueError) as exc_info:
390-
image_tool._submit_fal_request("fal-ai/nano-banana", {"prompt": "x"})
394+
image_tool._submit_fal_request("fal-ai/nano-banana-pro", {"prompt": "x"})
391395

392396
msg = str(exc_info.value)
393-
assert "fal-ai/nano-banana" in msg
397+
assert "fal-ai/nano-banana-pro" in msg
394398
assert "403" in msg
395399
assert "FAL_KEY" in msg
396400
assert "hermes tools" in msg

tools/image_generation_tool.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@
134134
},
135135
"upscale": False,
136136
},
137-
"fal-ai/nano-banana": {
138-
"display": "Nano Banana (Gemini 2.5 Flash Image)",
139-
"speed": "~6s",
140-
"strengths": "Gemini 2.5, consistency",
141-
"price": "$0.08/image",
137+
"fal-ai/nano-banana-pro": {
138+
"display": "Nano Banana Pro (Gemini 3 Pro Image)",
139+
"speed": "~8s",
140+
"strengths": "Gemini 3 Pro, reasoning depth, text rendering",
141+
"price": "$0.15/image (1K)",
142142
"size_style": "aspect_ratio",
143143
"sizes": {
144144
"landscape": "16:9",
@@ -149,10 +149,14 @@
149149
"num_images": 1,
150150
"output_format": "png",
151151
"safety_tolerance": "5",
152+
# "1K" is the cheapest tier; 4K doubles the per-image cost.
153+
# Users on Nous Subscription should stay at 1K for predictable billing.
154+
"resolution": "1K",
152155
},
153156
"supports": {
154157
"prompt", "aspect_ratio", "num_images", "output_format",
155-
"safety_tolerance", "seed", "sync_mode",
158+
"safety_tolerance", "seed", "sync_mode", "resolution",
159+
"enable_web_search", "limit_generations",
156160
},
157161
"upscale": False,
158162
},
@@ -202,22 +206,24 @@
202206
},
203207
"upscale": False,
204208
},
205-
"fal-ai/recraft-v3": {
206-
"display": "Recraft V3",
209+
"fal-ai/recraft/v4/pro/text-to-image": {
210+
"display": "Recraft V4 Pro",
207211
"speed": "~8s",
208-
"strengths": "Vector, brand styles",
209-
"price": "$0.04/image",
212+
"strengths": "Design, brand systems, production-ready",
213+
"price": "$0.25/image",
210214
"size_style": "image_size_preset",
211215
"sizes": {
212216
"landscape": "landscape_16_9",
213217
"square": "square_hd",
214218
"portrait": "portrait_16_9",
215219
},
216220
"defaults": {
217-
"style": "realistic_image",
221+
# V4 Pro dropped V3's required `style` enum — defaults handle taste now.
222+
"enable_safety_checker": False,
218223
},
219224
"supports": {
220-
"prompt", "image_size", "style",
225+
"prompt", "image_size", "enable_safety_checker",
226+
"colors", "background_color",
221227
},
222228
"upscale": False,
223229
},

website/docs/user-guide/features/image-generation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Image Generation
3-
description: Generate images via FAL.ai — 8 models including FLUX 2, GPT-Image, Nano Banana, Ideogram, and more, selectable via `hermes tools`.
3+
description: Generate images via FAL.ai — 8 models including FLUX 2, GPT-Image, Nano Banana Pro, Ideogram, Recraft V4 Pro, and more, selectable via `hermes tools`.
44
sidebar_label: Image Generation
55
sidebar_position: 6
66
---
@@ -13,13 +13,13 @@ Hermes Agent generates images from text prompts via FAL.ai. Eight models are sup
1313

1414
| Model | Speed | Strengths | Price |
1515
|---|---|---|---|
16-
| `fal-ai/flux-2/klein/9b` *(default)* | <1s | Fast, crisp text | $0.006/MP |
16+
| `fal-ai/flux-2/klein/9b` *(default)* | `<1s` | Fast, crisp text | $0.006/MP |
1717
| `fal-ai/flux-2-pro` | ~6s | Studio photorealism | $0.03/MP |
1818
| `fal-ai/z-image/turbo` | ~2s | Bilingual EN/CN, 6B params | $0.005/MP |
19-
| `fal-ai/nano-banana` | ~6s | Gemini 2.5, character consistency | $0.08/image |
19+
| `fal-ai/nano-banana-pro` | ~8s | Gemini 3 Pro, reasoning depth, text rendering | $0.15/image (1K) |
2020
| `fal-ai/gpt-image-1.5` | ~15s | Prompt adherence | $0.034/image |
2121
| `fal-ai/ideogram/v3` | ~5s | Best typography | $0.03–0.09/image |
22-
| `fal-ai/recraft-v3` | ~8s | Vector art, brand styles | $0.04/image |
22+
| `fal-ai/recraft/v4/pro/text-to-image` | ~8s | Design, brand systems, production-ready | $0.25/image |
2323
| `fal-ai/qwen-image` | ~12s | LLM-based, complex text | $0.02/MP |
2424

2525
Prices are FAL's pricing at time of writing; check [fal.ai](https://fal.ai/) for current numbers.
@@ -87,7 +87,7 @@ Make me a futuristic cityscape, landscape orientation
8787
8888
Every model accepts the same three aspect ratios from the agent's perspective. Internally, each model's native size spec is filled in automatically:
8989
90-
| Agent input | image_size (flux/z-image/qwen/recraft/ideogram) | aspect_ratio (nano-banana) | image_size (gpt-image) |
90+
| Agent input | image_size (flux/z-image/qwen/recraft/ideogram) | aspect_ratio (nano-banana-pro) | image_size (gpt-image) |
9191
|---|---|---|---|
9292
| `landscape` | `landscape_16_9` | `16:9` | `1536x1024` |
9393
| `square` | `square_hd` | `1:1` | `1024x1024` |

website/docs/user-guide/features/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Hermes Agent includes a rich set of capabilities that extend far beyond basic ch
3030
- **[Voice Mode](voice-mode.md)** — Full voice interaction across CLI and messaging platforms. Talk to the agent using your microphone, hear spoken replies, and have live voice conversations in Discord voice channels.
3131
- **[Browser Automation](browser.md)** — Full browser automation with multiple backends: Browserbase cloud, Browser Use cloud, local Chrome via CDP, or local Chromium. Navigate websites, fill forms, and extract information.
3232
- **[Vision & Image Paste](vision.md)** — Multimodal vision support. Paste images from your clipboard into the CLI and ask the agent to analyze, describe, or work with them using any vision-capable model.
33-
- **[Image Generation](image-generation.md)** — Generate images from text prompts using FAL.ai. Eight models supported (FLUX 2 Klein/Pro, GPT-Image 1.5, Nano Banana, Ideogram V3, Recraft V3, Qwen, Z-Image Turbo); pick one via `hermes tools`.
33+
- **[Image Generation](image-generation.md)** — Generate images from text prompts using FAL.ai. Eight models supported (FLUX 2 Klein/Pro, GPT-Image 1.5, Nano Banana Pro, Ideogram V3, Recraft V4 Pro, Qwen, Z-Image Turbo); pick one via `hermes tools`.
3434
- **[Voice & TTS](tts.md)** — Text-to-speech output and voice message transcription across all messaging platforms, with five provider options: Edge TTS (free), ElevenLabs, OpenAI TTS, MiniMax, and NeuTTS.
3535

3636
## Integrations

website/docs/user-guide/features/tool-gateway.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The **Tool Gateway** lets paid [Nous Portal](https://portal.nousresearch.com) su
1818
| Tool | What It Does | Direct Alternative |
1919
|------|--------------|--------------------|
2020
| **Web search & extract** | Search the web and extract page content via Firecrawl | `FIRECRAWL_API_KEY`, `EXA_API_KEY`, `PARALLEL_API_KEY`, `TAVILY_API_KEY` |
21-
| **Image generation** | Generate images via FAL (8 models: FLUX 2 Klein/Pro, GPT-Image, Nano Banana, Ideogram, Recraft, Qwen, Z-Image) | `FAL_KEY` |
21+
| **Image generation** | Generate images via FAL (8 models: FLUX 2 Klein/Pro, GPT-Image, Nano Banana Pro, Ideogram, Recraft V4 Pro, Qwen, Z-Image) | `FAL_KEY` |
2222
| **Text-to-speech** | Convert text to speech via OpenAI TTS | `VOICE_TOOLS_OPENAI_KEY`, `ELEVENLABS_API_KEY` |
2323
| **Browser automation** | Control cloud browsers via Browser Use | `BROWSER_USE_API_KEY`, `BROWSERBASE_API_KEY` |
2424

0 commit comments

Comments
 (0)