Day 15: When AI Generates Twins and Giants

The Problem That Almost Derailed Deployment

I was ready to deploy the Pride and Prejudice story pack. All 29 scenes generated, 12 unique endings ready, MBTI personality tracking working perfectly. But when I reviewed the final illustrations, I noticed something horrifying:

Background characters at a ball looked exactly like Darcy and Wickham.

Charlotte, Elizabeth’s friend, was supposed to be a unique supporting character. Instead, she appeared as a clone of Jane Bennet. Party guests had identical faces. It was like a Victorian horror story - multiple twins everywhere.

Even worse: Elizabeth appeared 1.5x-2x larger than other characters, looking like a giant among normal people.

These weren’t minor quality issues. They would completely break immersion.

Understanding Why AI Makes These Mistakes

Issue #1: The Multiple Twins Problem

What I Did Wrong:

# I provided ALL character references to EVERY scene
references = [elizabeth, darcy, jane, wickham]  # All 4
scene_prompt = "Elizabeth talking to Charlotte at ball"

What the AI Heard:

“Here are 4 character designs. Use them somehow in this ballroom scene.”

What the AI Did: Applied character references to anyone it could - background characters, party guests, servants. Since it saw Darcy’s reference, some gentleman in the background got Darcy’s face. Jane’s reference? That became Charlotte.

Issue #2: The Giant Character Problem

What I Provided:

Use the EXACT character appearances from character reference images.

What the AI Interpreted:

“These referenced characters are important - make them PROMINENT.”

What Happened: The AI emphasized referenced characters by making them larger, more dominant in composition. Elizabeth became 1.8x the size of Charlotte. Darcy towered over background guests.

No explicit instructions about realistic human proportions = AI defaulted to emphasizing importance through size.

The Solution: Extremely Explicit Prompt Engineering

I learned that AI image generation requires obsessive specificity. Here’s what I had to add:

Fix #1: Scene-Specific Character Detection

Before:

  • Every scene got all 4 character references

After:

# Detect which characters are actually in this scene
art_prompt = "Elizabeth and Charlotte laughing together..."
detected = detect_characters_in_prompt(art_prompt, all_characters)
# Result: only ['elizabeth'] detected

# Only pass relevant references
references = [elizabeth_reference]  # Just Elizabeth
excluded = [darcy, jane, wickham]  # Explicitly state who's NOT here

New Prompt Addition:

CRITICAL: These main characters DO NOT appear in this scene: darcy, jane, wickham
- Do NOT make any background people, extras, or supporting characters look like: darcy, jane, wickham
- All other people in the scene (not elizabeth) should have completely different appearances

Fix #2: Character Scale & Proportion Rules

I added 8 explicit rules about realistic human sizing:

CHARACTER SCALE AND PROPORTIONS (CRITICAL):
- ALL human characters must be realistically proportioned to each other
- Main characters should be NORMAL HUMAN SIZE, not oversized or giant-like
- Characters should be properly scaled relative to the environment (doorways, furniture, etc.)
- Maintain proper perspective - characters farther away should appear smaller
- No character should dominate the composition by being disproportionately large
- All people in the scene should have consistent, realistic human proportions
- If multiple characters are at the same distance, they should be approximately the same size
- Background characters should be appropriately smaller only due to distance, not arbitrary scaling

Plus reference-specific constraints:

IMPORTANT: Character references are for APPEARANCE ONLY, NOT SIZE
- Referenced characters should be NORMAL HUMAN SIZE
- Do NOT make referenced characters larger, more prominent, or dominant in the scene
- Apply references to facial features, clothing, and details - NOT to scale or composition weight

Fix #3: The “Multiple Elizabeths” Problem

When I fixed the twins issue by using only Elizabeth’s reference, a NEW problem appeared: the AI started applying Elizabeth’s appearance to multiple people in the same scene!

New Addition:

CRITICAL: NO DUPLICATE FACES IN THIS SCENE
- ONLY ONE person in this scene should have each referenced character's appearance
- If only one character is referenced (e.g., elizabeth), ONLY ONE person should look like that character
- ALL other people in the scene must have completely unique, different faces
- Every person should be a unique individual with different facial features
- There should be NO identical or twin-like faces anywhere in this scene

Fix #4: Character Design Distinction

Darcy and Wickham were both described as “handsome” with dark features. Only their outfits differed (dark coat vs red uniform). Not enough!

Before:

  • Darcy: Dark wavy hair, strong features, intense eyes
  • Wickham: Handsome features, easy smile, friendly eyes

After:

  • Darcy: Dark wavy hair, dark intense eyes, strong aristocratic features
  • Wickham: Light brown hair, bright blue eyes, softer approachable features

Visual contrast in hair color and eye color made them immediately distinguishable even without uniforms.

The Iterative Testing Process

Phase 1: Test 4 Problem Scenes

  • ✅ 1/4 worked (solo Elizabeth scene)
  • ❌ 3/4 failed (scenes with background Darcy)

Learning: Characters “in background” or “across room” shouldn’t use references.

Phase 2: Regenerate Without Background References

  • ✅ Fixed giant character issue
  • ❌ Created multiple Elizabeths issue

Learning: Fixing one issue can create new ones. Need explicit uniqueness constraints.

Phase 3: Add “No Duplicate Faces” Logic

  • ✅ Better, but some twins remained
  • Decided to do full regeneration to see final results

Full Regeneration: All 29 Scenes

  • Generated 22/29 successfully first run
  • Retried 7 failed scenes → 6 more succeeded
  • Manually fixed final scene
  • Result: 29/29 scenes with all fixes applied

Key Learnings About AI Prompt Engineering

  1. Explicit Over Implicit: Don’t assume AI understands context. State everything explicitly.

  2. Negative Instructions Matter: Don’t just say what TO do - say what NOT to do.

    • “ONLY elizabeth should match reference”
    • “darcy, jane, wickham should NOT appear”
  3. Layer Your Constraints:

    • General rules (all humans realistic proportions)
    • Specific rules (references for appearance only)
    • Critical rules (no duplicate faces)
  4. Test Edge Cases: The obvious cases work fine. It’s the edge cases (background characters, distant characters) that break.

  5. Iterate Quickly: Each fix revealed new issues. Fast iteration was key.

  6. Character Design Matters: AI can’t create distinction from personality alone - needs visual contrast (dark vs light hair, different eye colors, etc.)

  7. One Fix Can Break Another: When using only one character reference fixed twins, it created duplicate faces. Always test after each change.

The Final Result

After all fixes:

  • ✅ 29/29 scenes generated successfully
  • ✅ All character references applied correctly
  • ✅ No more twins of main characters
  • ✅ Realistic human proportions throughout
  • ✅ Each person visually unique
  • ✅ Darcy and Wickham clearly distinguishable

Time Investment:

  • Problem discovery: 30 minutes
  • Fix implementation: 2 hours
  • Testing iterations: 3 rounds
  • Full regeneration: 16 minutes
  • Total: ~3 hours

Worth It? Absolutely. Quality issues would have destroyed the user experience.

Technical Implementation

For those interested in the code changes:

Enhanced Scene Prompt Generation:

def create_scene_prompt(scene_description, use_references=False,
                       character_names=None, all_main_characters=None):
    prompt = f"Create a cinematic illustration: {scene_description}"

    # Add scale/proportion rules
    prompt += """
    CHARACTER SCALE AND PROPORTIONS (CRITICAL):
    [8 explicit rules about realistic sizing]
    """

    if use_references and character_names:
        # Explicit character matching
        char_list = ", ".join(character_names)
        prompt += f"""
        CONSISTENCY REQUIREMENTS:
        - ONLY the following named characters should match references: {char_list}
        - For these characters, maintain EXACT facial features...

        CRITICAL: NO DUPLICATE FACES IN THIS SCENE
        - ONLY ONE person should have each referenced character's appearance
        [Additional uniqueness constraints]

        IMPORTANT: Character references for APPEARANCE ONLY, NOT SIZE
        [Size constraint rules]
        """

        # Character exclusion
        excluded = [c for c in all_main_characters if c not in character_names]
        if excluded:
            prompt += f"""
            CRITICAL: These main characters DO NOT appear: {", ".join(excluded)}
            - Do NOT make background people look like them
            """

    return prompt

What’s Next

With all 29 Pride and Prejudice scenes properly generated, I can now:

  1. Deploy the complete story pack to production
  2. Test the full story flow with personality tracking
  3. Start generating the next classic (1984? The Great Gatsby?)
  4. Apply these learnings to improve the story pack generator for future classics

Resources

  • Full Session Log: Documented all 5 fixes with before/after examples
  • Prompt Examples: See how the enhanced prompts work
  • Character Fix Guide: Complete technical documentation

The Bigger Picture

This experience reinforced something important: AI is a powerful tool, but it requires precise human guidance.

The difference between mediocre and excellent AI-generated content often comes down to prompt engineering quality. Spending 3 hours to get the prompts right saved weeks of manual illustration work.

Building in public means sharing both wins and challenges. Today was definitely a challenge - but solving it taught me more about AI image generation than a month of smooth sailing would have.


Progress: Day 15/100 Status: Pride and Prejudice story pack ready for deployment (29/29 scenes complete) Tomorrow: Deploy to production and test full story flow

What challenging AI issues have you encountered? How did you solve them? Let me know in the comments!