I always wanted a cat but never had one as a child. Decades later, I used Doubao API to merge my childhood photos with my cat's images, then built a reusable Django app (django-doubao
) that does AI image fusion and image-to-video generation. Here's how it works and why I built it.
When I was a kid, I longed for a cat. My mother wouldn't allow it. I pressed my face against the neighbour’s window, watching their tabby stretch and roll in the sun – a hollow ache in my chest.
Only after forty years did I finally get my own cat. But then a new sadness crept in: I couldn’t grow up with her.
So I devised a trick.
On Doubao (ByteDance’s AI platform), I took my old, faded childhood photos – gap-toothed, laughing – and merged them with my cat’s plump white face. Suddenly, we were playing together. Then I made videos: the child chasing the cat through a field of flowers, wind lifting our hair, years dissolving.
Each creation sent ripples through my heart – from a quiet centre to the corners of my lips and eyes.
I started on Doubao’s official website, but soon I thought: I’m a programmer. Why not build my own app?
I got a Doubao API key, set up a Django project, and wrote a utils.py
– not three hundred lines – that became the key to my own toy box.
My ritual:
I created two Django views:
When I saw the boy and the cat move across the screen, something long empty inside me was gently filled.
I packed the whole thing into a Python package, django-doubao
, and published it on GitHub.
while
loops needed.
django-doubao/
├── doubao/
│ ├── models.py # ImageGeneration, VideoGeneration
│ ├── views.py # generate_image_view, generate_video_view
│ ├── urls.py # routes with namespace
│ ├── utils.py # API calls: generate_image, submit_video_task, poll_video_result
│ ├── templates/ # standalone Vue3 templates (no base.html required)
│ └── migrations/
├── tests/ # pytest + mock, 15 tests all green
├── pyproject.toml
└── README.md
Key decisions:
login_required
or user_passes_test
yourself. Each project is different.base.html
. You can override them.Install:
pip install django-doubao
Add to INSTALLED_APPS
:
INSTALLED_APPS = [
...
'doubao',
]
Set your API key:
DOUBAO_API_KEY = "your-key-here"
Include URLs:
path('doubao/', include('doubao.urls')),
Then visit /doubao/image/
to generate images, and /doubao/video/
to turn them into videos.
I could have kept using online tools. But as a programmer, I chose to build a small world with code – one where the child and the cat can finally run, daydream, and watch maple leaves fall together.
If you have a similar wish – to revive an old photograph or animate a memory – I hope django-doubao
helps you take fewer detours.
Code is like bricks. The important thing isn’t how complex it is, but what you build with it.
The cat is purring beside me. The video loops on the screen. I turn off the light, leaving only the screen’s glow – and that old hollow feels truly filled.
What do you think? Have you ever used AI to fill a childhood gap? Let me know in the comments.