惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
博客园 - 三生石上(FineUI控件)
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
V
Visual Studio Blog
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MongoDB | Blog
MongoDB | Blog
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
L
LangChain Blog
Martin Fowler
Martin Fowler
GbyAI
GbyAI
博客园 - 司徒正美

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I Couldn't Grow Up with a Cat, So I Made a Django Package...
Weilu Wang · 2026-06-03 · via DEV Community

Weilu Wang

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.


The Empty Space

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.


A Programmer’s Solution

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:

  1. Pick a beautiful landscape – the old locust tree at my childhood hutong, summer thick with cicadas.
  2. Add my childhood face and my fat white cat (round as a snowball).
  3. Merge them into one image where we play together.
  4. Animate that still picture – the cat rolls on the grass, the child chases, flowers tremble in a breeze I only feel in memory.

I created two Django views:

  • The first fuses multiple reference images into one AI-generated picture.
  • The second turns that picture into a short video (5–12 seconds).

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.


What the Package Does

  • Multi‑image fusion – combine several reference images + text prompt → one new AI image.
  • Image‑to‑video generation – turn a single image (generated or uploaded) into a 5–12 sec video. Supports aspect ratios, resolutions, returns video + last frame.
  • Asynchronous polling – video generation is async; the package polls automatically. No while loops needed.
  • Task records – via Django models, so you can track or re‑create past generations.

Quick Architecture Overview

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:

  • No built-in permissions – you wrap views with login_required or user_passes_test yourself. Each project is different.
  • Self-contained templates – they work even if your project has no base.html. You can override them.
  • Synchronous polling – good for low‑concurrency personal use; you can swap in Celery later.

Using django-doubao

Install:

pip install django-doubao

Add to INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'doubao',
]

Set your API key:

DOUBAO_API_KEY = "your-key-here"

Include URLs:

# urls.py
path('doubao/', include('doubao.urls')),

Then visit /doubao/image/ to generate images, and /doubao/video/ to turn them into videos.


Why I’m Sharing This

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.