来源:互联网 更新时间:2026-07-14 07:25
这事儿其实挺简单的,但效果相当炸裂。先看结果——我把女朋友的照片喂给了 AI,最终生成了一张 57 帧的横版精灵图(Sprite Sheet)。
这张图里装下了 9 种不同的动作,总共 57 帧动画,具体分布如下:
| 动作 | 帧数 | 说明 |
|---|---|---|
| 待机眨眼 | 6 帧 | 自然站立,偶尔歪头眨眼 |
| 敲代码 | 6 帧 | 坐地上敲键盘,代码符号飘起 |
| 修 Bug | 6 帧 | 拿扳手修红色 Bug 图标 |
| 报错装死 | 8 帧 | 举"ERROR"牌子,表情无奈 |
| 加载等待 | 6 帧 | 坐等进度条慢慢走 |
| 庆祝完成 | 5 帧 | 跳起来撒花,进度条 100% |
| 偷看屏幕 | 8 帧 | 从窗口边探出半个身子 |
| 睡觉休息 | 4 帧 | 趴小枕头上,ZZZ 飘起 |
| 监工模式 | 8 帧 | 叉腰站在桌面边,表情严肃 |
拿到这张精灵图之后,把它塞进 Codex 桌宠的配置里,你的桌宠就成了独一无二的 "她"。
整个流程走下来其实很清晰:
flowchart LR
A["准备参考照片"] --> B["写提示词 Prompts"]
B --> C["AI 生成精灵图
(豆包/ Midjourney)"]
C --> D{"效果满意?"}
D -->|不满意| B
D -->|满意| E["裁剪 & 检查"]
E --> F["配置 Codex 桌宠"]
F --> G["桌面运行 ✓"]
style A fill:#4ecdc4,color:#fff
style C fill:#ff6b6b,color:#fff
style G fill:#45b7d1,color:#fff
工具清单并不复杂,三样东西就搞定:
| 工具 | 作用 | 备注 |
|---|---|---|
| 一张参考照片 | AI 画角色的依据 | 正面照最好,表情清晰 |
| AI 绘图工具 | 生成精灵图 | 豆包、Midjourney、DALL·E 3 都行 |
| Codex 桌宠 | 桌面显示动画 | 支持自定义精灵图的版本 |
整个流程里的核心难点只有一个——提示词怎么写。下面就把提示词逐段拆开,看看里面的门道。
这份提示词前前后后和豆包沟通了 5 轮才算调好。拆成 5 个模块来看,每个模块都有自己的用意。
Generate a horizontal sprite sheet for a Codex desktop pet, in chibi anime style.
Character:
- Cute Q‑version (chibi) of the person in the reference image
- Maintain all key features: same hairstyle and hair color, face expression style,
clothing style, accessories, and overall vibe
- The character must be exactly the same person across all frames
这里面有几个关键点:
Q-version (chibi) 是让 AI 画 Q 版,而不是写实风格same hairstyle / hair color / clothing style 是保底条款——防止 AI 在不同帧里画出不同的角色exactly the same person across all frames 是关键中的关键,没有它,AI 很可能会在动作帧里偷偷改角色长相桌宠之所以可爱,是因为它有"活着"的感觉。设定 9 种动作,覆盖了日常使用场景:
1. Idle blink (6 frames): standing naturally, gently blinking, occasionally tilting head slightly, relaxed and cute expression.
2. Coding (6 frames): sitting or kneeling, holding a small keyboard or mini computer, typing rapidly, with a few code symbols floating nearby like @, >, ;, :, etc.
3. Bug fixing (6 frames): holding a small wrench, seriously repairing a red bug icon, with slight motion lines, final frame shows a satisfied smile.
...(后续动作省略,文末有完整版)
设计思路很明确:
Layout:
- All frames arranged in one single horizontal strip
- Each frame shows the same character performing the action with only minor variations
- No crop on hair, head, hands, feet, props, or body
- Enough spacing between frames so they do not overlap
这里有几个容易踩的坑:
minor variations——告诉 AI 每帧是微动不是重画No crop——防止 AI 切到头发或手脚,Codex 桌宠需要完整的角色轮廓Enough spacing——不加这句,AI 会把所有帧挤在一起,裁切时会痛苦Art style:
- Chibi Q‑version anime style, clear thick outlines, flat cel‑shading,
cute and clear expressions, well‑defined body contours
- High character consistency across all frames
关键参数的作用:
| 参数 | 作用 | 不加会怎样 |
|---|---|---|
clear thick outlines |
清晰粗线条 | 角色边缘模糊,抠图困难 |
flat cel‑shading |
平涂赛璐璐 | 出现阴影渐变,动画风格不统一 |
well-defined body contours |
轮廓清晰 | Q 版变形,认不出是谁 |
Background:
- Solid green screen color: #00ff00 (pu re green)
- Entire background must be this solid green only
- No shadows, no gradients, no floor, no textures, no glow, no reflections
- Do NOT use #00ff00 anywhere in the character or props
这招是从视频抠图里学来的——#00ff00 纯绿背景。Codex 桌宠支持透明背景,用纯绿底图方便后期一键去背。最后那句是防呆设计,防止 AI 把绿色画到角色身上。
写提示词最大的错觉就是——一次就能出图。实际上前后沟通了 5 轮才算拿到满意结果。
sequenceDiagram
actor U as 我
participant A as 豆包 AI
U->>A: 第1轮:发需求 + 参考照片
A->>U: 生成结果 ❌
Note over U: 角色不像、帧间距太小
U->>A: 第2轮:调整角色一致性描述
A->>U: 生成结果 ❌
Note over U: 动作僵硬,缺少细节
U->>A: 第3轮:细化动作描述 + 帧数调整
A->>U: 生成结果 ⚠️
Note over U: 画风对了,但背景不绿
U->>A: 第4轮:强调绿幕 + 无阴影约束
A->>U: 生成结果 ✅
Note over U: 基本满意,表情略显呆
U->>A: 第5轮:微调表情描述
A->>U: 终版 ✅
Note over U: 搞定!57帧完美精灵图
每轮遇到的具体问题和修复方法:
| 轮次 | 问题 | 怎么修的 |
|---|---|---|
| 第 1 轮 | 角色不像本人,脸型变了 | 加 same hairstyle, same face shape,明确说 "based on reference image" |
| 第 2 轮 | 动作没有过渡感,像静态贴图 | 把 6 frames 改成 6 frames with slight motion,加 final frame shows... 描述最后一帧的落点 |
| 第 3 轮 | 背景带了渐变色,不是纯绿 | 加了 no shadows, no gradients, no floor |
| 第 4 轮 | 角色身上出现了绿色杂点 | 加了 Do NOT use #00ff00 anywhere in the character or props |
| 第 5 轮 | 表情不够自然 | 每个动作加了情绪描述,如 relaxed and cute / satisfied smile / curious expression |
最难调的是第 3 轮——AI 似乎天生喜欢给背景加光影,明明说了"纯绿"、"无阴影",它还是偷偷给角色脚下画了投影。直到把 no floor 加上才彻底解决。
图生成好了,但怎么让它变成桌宠?这一步是在 Codex 里问出来的。
拿到精灵图后,遇到两个问题:
把精灵图和截图发给 Codex,它给出了答案:
精灵图要求:
配置方式:
sprite 配置项指定举个例子,配置大致长这样:
{
"sprite": "path/to/your-sprite.png",
"frameWidth": 128,
"frameHeight": 128,
"totalFrames": 57,
"animations": {
"idle": { "frames": [0,1,2,3,4,5], "loop": true },
"coding": { "frames": [6,7,8,9,10,11], "loop": true },
"bugfix": { "frames": [12,13,14,15,16,17], "loop": true },
"error": { "frames": [18,19,20,21,22,23,24,25], "loop": false },
"loading": { "frames": [26,27,28,29,30,31], "loop": true },
"celebrate":{ "frames": [32,33,34,35,36], "loop": false },
"peek": { "frames": [37,38,39,40,41,42,43,44], "loop": true },
"sleep": { "frames": [45,46,47,48], "loop": true },
"supervise":{ "frames": [49,50,51,52,53,54,55,56], "loop": true }
}
}
从图到桌宠,完整链条是这样的:
flowchart TD
A["豆包生成精灵图
57帧横版 + 绿幕背景"] --> B["去背处理
绿幕 → 透明 PNG"]
B --> C["测量每帧尺寸
等分裁剪"]
C --> D["编写配置 JSON
帧序号 → 动作映射"]
D --> E["放到 Codex 配置目录"]
E --> F["重启桌宠 ✓"]
style A fill:#ff6b6b,color:#fff
style F fill:#45b7d1,color:#fff
具体步骤:
下面就是完整的提示词,把 [参考照片] 换成你的照片,直接把这段复制给豆包或 Midjourney 就行。
Generate a horizontal sprite sheet for a Codex desktop pet, in chibi anime style.
Character:
- Cute Q‑version (chibi) of the person in the reference image
- Maintain all key features: same hairstyle and hair color, face expression style,
clothing style, accessories, and overall vibe
- The character must be exactly the same person across all frames
Actions (each on the same horizontal strip, evenly spaced,
no grid lines, no frame numbers, no borders):
1. Idle blink (6 frames): standing naturally, gently blinking, occasionally tilting head slightly, relaxed and cute expression.
2. Coding (6 frames): sitting or kneeling, holding a small keyboard or mini computer, typing rapidly, with a few code symbols floating nearby like @, >, ;, :, etc.
3. Bug fixing (6 frames): holding a small wrench, seriously repairing a red bug icon, with slight motion lines, final frame shows a satisfied smile.
4. Error display (8 frames): holding a small sign that says "ERROR", expression helpless or awkward, slight arm movements, one frame has eyes closed looking frustrated.
5. Loading wait (6 frames): sitting while holding a horizontal progress bar that gradually fills up, patient waiting expression, occasional blinks.
6. Celebration complete (5 frames): jumping happily with both arms raised, colorful confetti around, holding or next to a progress bar showing 100%, finally landing back on the ground.
7. Peeking at screen (8 frames): peeking half‑body from behind the edge of a vertical window, curious expression, slight lean‑in and lean‑out motion, one frame with a blink.
8. Sleepy rest (4 frames): lying on a small white pillow, eyes closed, slight breathing motion, with "ZZZ" floating nearby.
9. Supervising work (8 frames): standing at the edge of the desktop, hands on hips, serious but cute expression, one frame pointing forward, one frame blinking.
Layout:
- All frames arranged in one single horizontal strip
- Each frame shows the same character performing the action with only minor variations
- No crop on hair, head, hands, feet, props, or body
- Enough spacing between frames so they do not overlap
Art style:
- Chibi Q‑version anime style, clear thick outlines, flat cel‑shading,
cute and clear expressions, well‑defined body contours,
suitable for scaling down as a desktop pet
- High character consistency across all frames
Background:
- Solid green screen color: #00ff00 (pu re green)
- Entire background must be this solid green only
- No shadows, no gradients, no floor, no textures, no glow, no reflections
- Do NOT use #00ff00 anywhere in the character or props
使用说明:
说两个真实感受。
第一,她看到后的反应。第一次把桌宠跑起来的时候,女朋友在旁边看着,说"诶,这真的是我?"然后她就盯着屏幕看了 5 分钟,看着自己的 Q 版小人敲代码、修 Bug、偷看屏幕……那 5 分钟里,没敢告诉她,其实也就调了 5 轮提示词。
第二,这件事让人意识到—— AI 生成已经不是"能不能"的问题,而是"怎么精确控制"的问题。同样一个需求,提示词写得好不好,结果天差地别。踩过的这 5 个坑,看了这篇文章就能避开。
项目本身不涉及代码,整个流程全靠提示词驱动。如果也想要一个专属桌宠,把提示词复制走,换张照片就行。
Bubbly无法连接服务器修复方法
币安Binance官方中文网站 币安App最新版下载及新手注册指南
七麦数据官网网页地址 七麦数据官方入口在线首页
问卷星官方网站入口地址 问卷星网页版在线使用
新浪人工智能热点小时报丨2026年06月20日02时_今日实时人工智能热点速递
闲鱼的严选验货在哪里看?闲鱼严选和验货宝哪个可靠
欧易OKX官方网站直达入口 2026欧易官方App安卓版v7.1.0下载安装
Siren (SIREN)币价格预测 2026-2050:SIREN 股价会很快达到 1.5 美元吗?
动漫《KiraKira 光之美少女 A La Mode》剧情介绍
淘宝直播如何看回放在哪里看?怎么查看淘宝直播回放
以太坊(ETH)未来数周或持续呈现低迷态势,多重因素制约价格走势
币安Binance交易所官方入口 币安App下载安装与实名注册教程
为何比特币BTC价格跌破7.3万美元?一文拆解影响近期比特币行情的五大原因
花的网名大全男生古风(精选100个)
Pharos(PROS)币是什么?如何参与?PROS币代币经济学和参与指南
比特币(BTC)与黄金在英国相遇:21Shares将BOLD基金引入伦敦
GPT5.6惨遭切脑,Fable 5回归要变弱鸡版?
可惜他不是我爸爸,他是我的情人。
新手如何购买比特币?2026年新手在币安购买比特币的完整教程
《梦幻西游》特殊鬼怪怎么抓-隐藏变异鬼应对要点
手机号码测吉凶
本站所有软件,都由网友上传,如有侵犯你的版权,请发邮件haolingcc@hotmail.com 联系删除。 版权所有 Copyright@2012-2013 haoling.cc