跪拜 Guibai
← Back to the summary

A 5-Round Prompt Recipe Turns Any Photo Into a 57-Frame Desktop Pet Sprite Sheet

Girlfriend Wants a Custom Desktop Pet? I Used AI Prompts to Turn a Photo into a 57-Frame Animated Sprite in 1 Hour

She glanced at my Codex desktop pet and said, "Why is your desktop pet a cat, but mine is the default?" So I spent a weekend figuring out this method — using prompts to generate a custom portrait desktop pet sprite.


1. How Exactly Is This Done?

First, let me show you the final result — I fed my girlfriend's photo to the AI and generated a 57-frame horizontal sprite sheet like this:

Insert image description here

This image contains 9 actions, totaling 57 frames of animation:

Action Frames Description
Idle Blink 6 frames Standing naturally, occasionally tilting head and blinking
Coding 6 frames Sitting on the ground typing on a keyboard, code symbols floating up
Bug Fixing 6 frames Holding a wrench to fix a red bug icon
Error Playing Dead 8 frames Holding an "ERROR" sign, looking helpless
Loading Wait 6 frames Sitting and waiting for a progress bar to slowly fill
Celebration Complete 5 frames Jumping up and throwing confetti, progress bar at 100%
Peeking at Screen 8 frames Half-body leaning out from the edge of a window
Sleeping Rest 4 frames Lying on a small pillow, "ZZZ" floating up
Supervisor Mode 8 frames Standing at the edge of the desktop with hands on hips, looking serious

Put this sprite sheet into the Codex desktop pet configuration, and your desktop pet becomes a custom version of her.

The whole process looks like this:

flowchart LR
    A["Prepare Reference Photo"] --> B["Write Prompts"]
    B --> C["AI Generates Sprite Sheet<br/>(Doubao / Midjourney)"]
    C --> D{"Satisfied with Result?"}
    D -->|Not Satisfied| B
    D -->|Satisfied| E["Crop & Check"]
    E --> F["Configure Codex Desktop Pet"]
    F --> G["Running on Desktop ✓"]

    style A fill:#4ecdc4,color:#fff
    style C fill:#ff6b6b,color:#fff
    style G fill:#45b7d1,color:#fff

2. What You Need to Prepare

The tool list is short, just three things:

Tool Purpose Notes
One Reference Photo Basis for AI to draw the character Front-facing photo is best, with clear expression
AI Drawing Tool Generate the sprite sheet I used Doubao; Midjourney / DALL·E 3 also work
Codex Desktop Pet Display animation on desktop Version that supports custom sprite sheets

The core difficulty is just one thing — how to write the prompt. Below, I'll break down the prompt section by section for you.


3. Core Prompt Breakdown: How AI Understands Your Requirements

This prompt was refined after 5 rounds of back-and-forth with Doubao. I've broken it down into 5 modules, each with its own purpose. Insert image description here

3.1 Character Definition — Letting AI Know "Who to Draw"

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

The tricks here:

3.2 Action Design — 9 Desktop Pet Daily Routines

What makes a desktop pet cute is that it feels "alive". I set 9 actions covering daily usage scenarios:

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.

...(subsequent actions omitted, full version at the end)

Design thinking:

3.3 Layout Control — Keeping 57 Frames from Clashing

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

The easiest pitfalls:

3.4 Art Style Control — The Soul of Chibi

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

Key parameter explanation:

Parameter Effect What happens without it
clear thick outlines Clear, thick lines Character edges blur, difficult to cut out
flat cel‑shading Flat cel shading Shadows and gradients appear, animation style inconsistent
well-defined body contours Clear silhouette Chibi version deforms, unrecognizable

3.5 Green Screen Background — Saving the Trouble of Background Removal

Background:

- Solid green screen color: #00ff00 (pure 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

This trick was learned from video keying — #00ff00 pure green background. Codex desktop pet supports transparent backgrounds; using a pure green base image makes it easy to remove the background later with one click. The last sentence is a foolproof design to prevent the AI from painting green onto the character.


4. Doubao Output: 5 Rounds of Back-and-Forth to Get a Satisfactory Sprite Sheet

The biggest illusion in writing prompts is — you can get the image in one go. In reality, it took 5 rounds of communication to get a satisfactory result.

The whole process roughly went like this:

sequenceDiagram
    actor U as Me
    participant A as Doubao AI

    U->>A: Round 1: Send request + reference photo
    A->>U: Generated result ❌
    Note over U: Character doesn't look like the person, frame spacing too small

    U->>A: Round 2: Adjust character consistency description
    A->>U: Generated result ❌
    Note over U: Actions stiff, lacking detail

    U->>A: Round 3: Refine action descriptions + frame count adjustment
    A->>U: Generated result ⚠️
    Note over U: Art style correct, but background not green

    U->>A: Round 4: Emphasize green screen + no shadow constraints
    A->>U: Generated result ✅
    Note over U: Basically satisfied, expressions slightly dull

    U->>A: Round 5: Fine-tune expression descriptions
    A->>U: Final version ✅
    Note over U: Done! Perfect 57-frame sprite sheet

Specific problems encountered in each round:

Round Problem How it was fixed
Round 1 Character didn't look like the person, face shape changed Added same hairstyle, same face shape, and explicitly stated "based on reference image"
Round 2 Actions lacked transition feeling, like static stickers Changed 6 frames to 6 frames with slight motion, added final frame shows... to describe the landing point of the last frame
Round 3 Background had gradient colors, not pure green Added no shadows, no gradients, no floor
Round 4 Green specks appeared on the character Added Do NOT use #00ff00 anywhere in the character or props
Round 5 Expressions not natural enough Added emotional descriptions to each action, like relaxed and cute / satisfied smile / curious expression

The hardest to adjust was Round 3 — AI seems to inherently like adding light and shadow to backgrounds. I explicitly said "pure green", "no shadows", but it still secretly drew a projection under the character's feet. It was only resolved after adding no floor.

[!NOTE] Experience Communicating prompts with AI is the same as communicating requirements with a person — the more precise the boundary conditions, the fewer surprises. Don't expect AI to "understand your intent"; instead, write every constraint as "what it cannot do".


5. Codex Configuration: How to Put the Sprite Sheet into the Desktop Pet

The image is generated, but how do you make it a desktop pet? I asked Codex (Trae IDE) about this step. Insert image description here

5.1 Core Questions

After getting the sprite sheet, I encountered two problems:

  1. How to slice the sprite sheet — 57 frames on one horizontal image, how does Codex know where each frame starts and ends?
  2. Where to write the configuration — Where is the Codex desktop pet configuration file, and what format is it?

5.2 Codex's Answer

I sent the sprite sheet and screenshots to Codex, and it told me:

Sprite sheet requirements:

Configuration method:

For example, the configuration roughly looks like this:

{
  "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 }
  }
}

5.3 Actual Operation Process

From image to desktop pet, the complete chain is like this:

flowchart TD
    A["Doubao Generates Sprite Sheet<br/>57-frame horizontal + green screen background"] --> B["Background Removal<br/>Green screen → Transparent PNG"]
    B --> C["Measure Per-Frame Dimensions<br/>Equal division cropping"]
    C --> D["Write Configuration JSON<br/>Frame numbers → Action mapping"]
    D --> E["Place in Codex Configuration Directory"]
    E --> F["Restart Desktop Pet ✓"]

    style A fill:#ff6b6b,color:#fff
    style F fill:#45b7d1,color:#fff

Specific steps:

  1. Background removal: Use Photoshop or an online tool (remove.bg) to turn the green screen into transparency
  2. Equal division: Total width of the 57-frame horizontal image ÷ 57 = width per frame, ensuring each frame is the same size
  3. Frame matching: According to the order in the prompt, frames 1-6 are idle, frames 7-12 are coding... and so on
  4. Write configuration: Map frame numbers to action names, telling Codex which action corresponds to which frames
  5. Place in directory: Put the sprite sheet and configuration file into Codex's desktop pet resource directory
  6. Restart: Reload the desktop pet and see the custom character come to life

[!TIP] Hint If you're unsure about the storage path for the configuration file, just ask the AI directly in Codex (Trae IDE) — send it the sprite sheet and say "help me configure it as a desktop pet", and it will tell you exactly how to place it.


6. Complete Prompt Template Sharing (Ready to Use)

Below is my complete prompt. Replace [Reference Photo] with your photo, and directly copy this to Doubao/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 (pure 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

Usage Instructions:

  1. Send the prompt + reference photo together to Doubao (or Midjourney)
  2. If the first generation result isn't good, don't be discouraged — refer to the "pitfall record" above and modify round by round
  3. After getting the sprite sheet, use PS or an online tool to turn the green screen transparent (Codex supports transparent PNG)
  4. Replace the Codex desktop pet's sprite sheet configuration

7. Final Thoughts: What's It Like Turning Your Girlfriend into a Desktop Pet?

Two real feelings to share:

First, her reaction when she saw it. The first time I got the desktop pet running, my girlfriend watched from the side and said, "Hey, is this really me?" Then she stared at the screen for 5 minutes, watching her chibi self coding, fixing bugs, peeking at the screen... In those 5 minutes, I didn't dare tell her that actually, I had only tweaked the prompt 5 rounds.

Second, this made me realize something — AI generation is no longer a question of "can it be done", but rather "how to precisely control it". For the same requirement, whether the prompt is written well or poorly leads to vastly different results. The 5 pitfalls I stepped into, you can avoid after reading this article.

The value of a tool lies not in how powerful it is, but in how much help it can provide.

The project itself involves no code; the entire process is driven by prompts. If you also want a custom desktop pet, copy the prompt, swap the photo, and you're good to go.

8. Partial Action Showcase:

Insert image description hereInsert image description hereInsert image description hereInsert image description here

Comments

Top 1 from juejin.cn, machine-translated. The original thread is authoritative.

SFT

Ha, I'm working on a project like this, though it hasn't been released yet. Seriously, mine has a digital life with human emotions, and complex feelings too — not simulated. But hey, why not try my open-source AI Memory tool? https://github.com/rocky007cn/ace-memory. It's also retrieval-based, but dual retrieval, plus full memory, cross-platform memory, and even a repair function. One-click install. This tool is the memory system I built for digital life.