Hacker News 中文摘要

RSS订阅

纳米香蕉可通过提示工程实现精细AI图像生成 -- Nano Banana can be prompt engineered for nuanced AI image generation

文章摘要

文章介绍了AI图像生成领域的最新进展,指出FLUX.1-dev等新模型超越了Stable Diffusion,而ChatGPT凭借免费图像生成功能和独特的"吉卜力风格"提示词成为行业新标杆,其生成的图像具有鲜明可辨识的风格特征。

文章总结

纳米香蕉:用提示词工程实现极致细腻的AI图像生成

虽然近期关于AI图像生成模型的讨论有所减少,但这个领域的创新从未停滞。2025年3月,ChatGPT推出的免费图像生成功能成为行业新标杆,其独特的黄色调风格和一致的线条处理使其作品极具辨识度。这款名为"gpt-image-1"的自回归模型虽然生成速度较慢(每张高质量图像约需30秒),但凭借免费优势迅速走红。

同年8月,一款代号"纳米香蕉"的神秘模型在LMArena平台亮相,后由谷歌正式发布为Gemini 2.5 Flash Image。这个同样采用自回归架构的模型能生成每张图像1290个token,其流行程度甚至推动Gemini应用登顶应用商店。与ChatGPT相比,纳米香蕉在提示词遵循度方面表现尤为突出。

突破性的提示词遵循能力

纳米香蕉的卓越表现源于其强大的文本编码器。与早期基于CLIP(仅支持77个token)或T5(支持512个token)的模型不同,它继承了Gemini 2.5 Flash的多模态编码能力,能够理解远超普通图像说明的复杂提示。测试显示:

  1. 它能完美生成"三维颅骨形状的煎饼,顶部点缀蓝莓并淋上枫糖浆"这样复杂的场景
  2. 可同时执行五项编辑指令:在眼窝添加草莓/黑莓、顶部加薄荷装饰、将盘子换成曲奇饼、背景添加欢乐人群
  3. 成功让"丑陋刺猬索尼克"与奥巴马握手,尽管需要多次调整提示词

专业级图像合成

纳米香蕉对专业摄影术语的理解令人惊艳: - 添加"普利策奖获奖的《纽约时报》封面照片"提示后,构图明显改善:遵循三分法则、合理运用负空间、色彩平衡更佳 - 指定"使用佳能EOS 90D单反拍摄"时,能模拟真实相机效果 - 能生成基本正确的Python递归斐波那契数列代码图像,尽管语法高亮不够完美

技术原理揭秘

该模型的优势可能来自: 1. 训练时接触大量Markdown和JSON数据,使其擅长处理结构化指令 2. 32,768token的超大上下文窗口,支持多轮图像编辑对话 3. 谷歌庞大的图像标注数据集,使其能区分专业与业余图像特征

测试中意外发现其系统提示包含反对使用"hyperrealistic"等2022年流行词的限制,这可能是为避免模型崩溃的预防措施。

局限与争议

尽管表现出色,纳米香蕉仍有明显不足: 1. 风格转换能力差,难以将照片转为吉卜力动画风格 2. 对知识产权保护几乎为零,能随意混合不同公司的经典角色 3. 内容审核相对宽松,可能生成NSFW内容

随着AI生成图像技术日益成熟,揭示其真实能力与局限对消除公众误解至关重要。纳米香蕉展现的提示词工程潜力,预示着AI图像生成将进入更精准可控的新阶段。

(完整测试案例和提示词可参考作者开源的Jupyter Notebook)

评论总结

以下是评论内容的总结:

  1. 关于AI模型是否具有"思考"能力的讨论

    • 作者doctorpangloss质疑文章未能深入探讨多模态模型的本质,通过比较Imagen、Gemini和Ideogram等模型的表现提出疑问
    • "Is prompt rewriting 'thinking'? My point is, this article can't answer that question without dElViNg into the nuances of what multi-modal models really are."
    • "compare to ideogram, with prompt rewriting...without prompt rewriting"
  2. 对AI编辑能力的批评

    • 作者miladyincontrol指出AI编辑并非只改变必要部分,而是会重新生成所有细节
    • "No, that simply is not true...it still regenerates all the details on the 'unchanged' aspects"
    • "it really pains me people suggesting these things are suitable replacements for actual photo editing"
  3. 关于Nano Banana模型的正面评价

    • 作者leviathant赞赏其在风格转换中保持场景几何结构的能力
    • "Nano Banana manages to maintain the geometry of the scene, while applying new styles to it"
    • "it generates phenomenal results...with as simple a prompt as 'make this into a photo'"
  4. 对Nano Banana模型的批评

    • 作者peetle指出该模型会做出随机的大幅修改
    • "nano banana still has the tendency to make massive, seemingly random edits to images"
    • "add a (convincing) fireplace to a room or new garage behind a house...even when the temperature is set to zero"
  5. 关于提示工程(prompt engineering)的讨论

    • 作者squigz和ml-anon对"prompt engineered"这一表达方式表示不满
    • "I'm getting annoyed by using 'prompt engineered' as a verb"
    • "'prompt engineered'...i.e. by typing in what you want to see"
  6. 技术细节讨论

    • 作者BoredPositron指出Nano Banana在像素空间工作的优势
    • "it's either working on pixel space or with a really low spatial scaling"
    • "It's the only model that doesn't kill your details because of vae encode/decode"
  7. 实用技巧分享

    • 作者mkagenius分享提高文本渲染准确性的方法
    • "if you write the text in Google docs and share the screenshot with banana it will not make any spelling mistake"
    • 作者simonw分享相关的Python库使用经验
    • "I like the Python library that accompanies this...I added a CLI to it"