# Grid Technique Test Results

**Date**: 2026-02-01
**Story**: Airport-Reaper (Semyonych)
**Output**: 72-second video, 9 scenes

---

## Technique Overview

Based on Dan Kieft's 3x3 grid approach for maintaining character consistency across multiple frames.

### Core Formula

```
A cinematic 3x3 storyboard in 9:16 vertical format.
Label each frame with 'frame 1, frame 2' etc in small text.

[FRAME DESCRIPTIONS - each with "Vertical 9:16 composition"]

CRITICAL: [CHARACTER] must remain visually consistent across frames X, Y, Z.
Style: [STYLE], cinematic lighting, ultra-realistic, 4k resolution.
```

### Workflow

1. **Generate grid** → NanoBanana (Gemini 3 Pro) with 9:16 aspect ratio, 4K
2. **Extract frames** → PIL crop (grid ÷ 3 = individual frames)
3. **Generate videos** → Veo3 with frame as first_frame input
4. **Add captions** → FFmpeg drawtext filter
5. **Assemble** → FFmpeg concat

---

## What Worked Well

### Character Consistency
- Semyonych appears consistent across frames 1, 2, 4, 5, 9
- Same green poncho, similar face, same build
- Grid technique significantly better than generating frames individually

### Story Flow
- 9 frames fit well into ~72 second video
- Each scene 4-8 seconds (Veo3 duration parameter)
- Captions help narrative clarity

### Technical
- 9:16 grid generates proper vertical frames
- 4K resolution provides good quality for extraction (1024x1834 per frame)
- Reference image for scythe helped (somewhat)
- NanoBanana handles complex multi-frame prompts well

---

## What Needs Improvement

### Frame 8 (Horror POV)
**Problem**: Shows classic Grim Reaper instead of Semyonych distorted by fog/rain/window.

**Current result**: Black-cloaked figure, clearly "Death"
**Desired result**: Same green poncho guy, but atmospheric conditions make him LOOK like Death

**Attempts made**:
1. "Same man, same pose as frame 5" - still generates Reaper
2. "15-20 meters away, AT A DISTANCE" - improved distance but still Reaper
3. "green poncho APPEARS as black cloak" - still generates actual black cloak

**Possible solutions**:
- Generate frame 8 separately with frame 5 as reference image
- Use image-to-image transformation on frame 5
- Accept stylized Reaper and rely on story context

### Scythe Usage (коса-литовка)
**Problem**: AI doesn't understand traditional Russian grass mowing technique.

**Current result**: Scythe held like weapon or walking stick
**Desired result**: Horizontal sweeping motion, blade parallel to ground

**Attempts made**:
- Detailed description in prompt
- Reference image of proper mowing stance
- Both helped but still not perfect

**Possible solutions**:
- Multiple reference images
- More specific pose descriptions ("both hands on handle, bent forward at waist")
- Generate mowing scenes separately with video reference

### Passengers Direction
**Problem**: Initially passengers looked straight ahead, not at window.

**Solution that worked**: "looking OUT through the airplane window (иллюминатор), eyes fixed on the window"

---

## Technical Parameters

### NanoBanana (Grid Generation)
```python
payload = {
    "contents": [{"parts": [reference_image, prompt]}],
    "generationConfig": {
        "responseModalities": ["IMAGE"],
        "imageConfig": {
            "aspectRatio": "9:16",  # Vertical format
            "imageSize": "4K"       # Maximum resolution
        }
    }
}
```

### Veo3 (Video Generation)
```python
call_veo3_laozhang(
    prompt=motion_prompt,
    first_frame_path=frame_path,
    model="veo-3.1-fast-fl",  # Fast model with image input
    duration=5,  # 4-5 seconds per scene
)
```

### FFmpeg (Captions)
```bash
ffmpeg -i input.mp4 -vf "drawtext=text='Caption':fontsize=36:fontcolor=white:x=(w-tw)/2:y=h-th-40:box=1:boxcolor=black@0.6:boxborderw=10" output.mp4
```

---

## Prompt Structure Lessons

### What to Include

1. **Frame position**: "Frame N (position):" helps AI place correctly
2. **Character tags**: "SAME worker Semyonych" for consistency
3. **Composition reminder**: "Vertical 9:16 composition" per frame
4. **Style per frame**: Different mood (horror for frame 8, comedic for 7,9)
5. **Explicit negatives**: "NO TEXT OR SPEECH BUBBLES"

### What Doesn't Work

1. **Implicit relationships**: AI doesn't understand "same as frame 5 but viewed differently"
2. **Complex transformations**: "green poncho appears as black cloak through fog" - AI generates actual black cloak
3. **Cultural specifics**: Russian scythe technique needs strong visual reference

### Prompt Length
- Current prompt: ~4400 characters
- Works well for NanoBanana
- More detail per frame = better results
- Reference images help for specific elements

---

## File Structure

```
/mnt/video/microdrama-v2-test/airport-reaper/
├── grids/001/
│   ├── grid_20260201_001955.jpg    # Final grid (8MB, 3072x5504)
│   └── grid_*_prompt.txt           # Archived prompts
├── frames/002/
│   ├── frame_01.jpg ... frame_09.jpg  # Extracted (1024x1834 each)
├── videos/001/
│   ├── scene_01/ ... scene_09/
│   │   ├── video.mp4
│   │   ├── prompt.txt
│   │   └── metadata.json
│   └── assembly/
│       └── final_20260201_003622.mp4  # 72 sec, 16MB
└── references/
    └── scythe/
        └── scythe_02.jpg              # Mowing reference
```

---

## Next Steps for Fine-tuning

1. **Frame 8 alternative approach**: Generate separately using frame 5 as base with fog/rain overlay prompt
2. **Scythe improvement**: Find video reference or multiple angle photos
3. **Test with different stories**: Verify technique generalizes
4. **Upscaling**: Test NanoBanana "extract and upscale" vs PIL crop
5. **Sound design**: Add ambient audio, voice-over for captions

---

## Cost Estimate

- Grid generation: ~$0.05 (NanoBanana)
- 9 videos: ~$1.35 (Veo3 fast @ $0.15 each)
- **Total per story**: ~$1.50

Compared to individual frame generation (9 × image + 9 × video), grid approach saves ~50% on image costs while improving consistency.

---

## Conclusion

The 3x3 grid technique successfully maintains character consistency across 9 frames. Main challenge is complex visual transformations (frame 8) where AI interprets instructions literally rather than understanding the perceptual effect desired.

**Recommendation**: Use grid for character-consistent scenes, generate special effect frames separately with reference images.
