与校舍
< img width="1671" height="941" alt="Image" src="https://GitHub.com/user-attachments/assets/0514233d-41c2-4592-8844-d0ea502ee001" />
import os import replicate
==========================================
1. API KEY
==========================================
Set the API key in the environment variable:
Windows PowerShell:
$env:REPLICATE_API_TOKEN="YOUR_API_KEY"
if "REPLICATE_API_TOKEN" not in os.environ: raise RuntimeError( "There is no REPLICATE_API_TOKEN. " "Please create an API key on Replicate and set it in the environment variable." )
==========================================
2. DESCRIPTION
==========================================
IMAGE_DIR = "images" VIDEO_DIR = "videos" os.makedirs(VIDEO_DIR, exist_ok=True)
==========================================
3. TRANSFORMATION FOR 10 IMAGES
==========================================
PROMPTS = {
1: """ Students naturally walk through the school gate in the morning. Several students smile, wave and greet each other. Backpacks move naturally while walking. Tree leaves and flowers gently move in the breeze. Smooth cinematic camera slowly moves forward. Keep the school building, students, uniforms and faces consistent. Realistic human motion, natural body movement, joyful educational atmosphere. 16:9. """,
2: """ Vietnamese middle school students walk together across the courtyard. They laugh, talk and make friendly gestures. Two students greet each other naturally. Hands and arms move naturally while walking. Other students continue walking in the background. Smooth cinematic tracking camera. Natural facial expressions and realistic body movement. Keep the original characters and school environment consistent. 16:9. """,
3: """ A Vietnamese teacher warmly greets students at the classroom door. Students naturally stop and respectfully greet the teacher. The teacher smiles and gently nods. Students move their hands naturally. Subtle classroom background movement. Smooth cinematic camera movement toward the classroom. Keep faces, uniforms and classroom unchanged. Realistic human motion. 16:9. """,
4: """ A Vietnamese middle school teacher explains a lesson. Students actively participate and raise their hands. Several students naturally move their hands and discuss ideas. The teacher gestures naturally while explaining. Students look at the teacher and classroom board. Subtle camera movement from left to right. Natural human movement and realistic facial expressions. Keep the original classroom and characters consistent. 16:9. """,
5: """ A student accidentally drops books and notebooks in the corridor. Two classmates immediately walk toward the student and bend down. They naturally pick up the books together. The students smile and look at each other. Books and hands move naturally. Smooth cinematic camera tracking shot. Warm emotional atmosphere. Keep characters and school corridor consistent. 16:9. """,
6: """ A student realizes a mistake in the classroom. The student respectfully …
内容来源: Wan-Video/Wan2.1