AI-Powered Video Editing Platform - Transform your shorts into Ghibli-style animations
- π₯ Ingestion - Import videos via URL (YouTube Shorts, TikTok) or file upload
- π¨ Image Studio - Generate Ghibli-style frames with SDXL + ControlNet + LoRA
- π¬ Video Studio - Animate images with Wan2.2 + RIFE interpolation
- πΌοΈ Gallery - Organize source media, generated images, and videos
- π REST API - Full FastAPI backend for integration
- π³ Docker Ready - Production-ready containerized deployment
cd Ganimation2
# Start Studio (Streamlit) + ComfyUI
./run.shAccess:
- Studio (Streamlit): http://localhost:8501
- ComfyUI UI: http://localhost:8188
Persistent storage (host):
./gallery/(source videos + generated outputs)./temp/./models/(non-ComfyUI models used by the app)./data/comfyui/models/(ComfyUI models: checkpoints / loras / controlnet / etc.)./data/comfyui/custom_nodes/(ComfyUI plugins)./data/comfyui/user/(ComfyUI workflows + settings)
ComfyUI model placement (host):
- LoRAs:
./data/comfyui/models/loras/ - Checkpoints:
./data/comfyui/models/checkpoints/ - ControlNet:
./data/comfyui/models/controlnet/
To move to another VM, copy ./data/comfyui/models, ./data/comfyui/custom_nodes, and ./data/comfyui/user.
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run the app
./run.sh localNote: local mode does not start ComfyUI. If you run locally, start ComfyUI separately.
Ganimation2/
βββ app.py # Streamlit application
βββ config.py # Configuration management
βββ run.sh # Local run script
βββ docker-compose.yml # API/worker stack (advanced)
βββ docker-compose.dev.yml # API/worker stack (advanced)
βββ docker-compose.studio.yml # Minimal Studio + ComfyUI
β
βββ api/ # FastAPI Backend
β βββ main.py # API entry point
β βββ config.py # API configuration
β βββ routers/ # API endpoints
β β βββ ingestion.py # Video import endpoints
β β βββ gallery.py # Media management
β β βββ generation.py # AI generation endpoints
β β βββ system.py # System & GPU info
β βββ services/ # Business logic
β βββ video_service.py
β βββ gallery_service.py
β βββ generation_service.py
β βββ gpu_manager.py
β
βββ views/ # Streamlit views/pages
β βββ ingestion.py # Video import UI
β βββ gallery.py # Media browser UI
β βββ image_studio.py # Image generation UI
β βββ video_studio.py # Video generation UI
β
βββ utils/ # Shared utilities
β βββ video_processor.py # FFmpeg operations
β βββ image_generator.py # SDXL pipeline
β βββ video_animator.py # Wan2.2 pipeline
β
βββ docker/ # Docker configurations
β βββ Dockerfile.api # API image
β βββ Dockerfile.frontend # Frontend image
β βββ nginx.conf # Reverse proxy config
β βββ streamlit_config.toml
β
βββ scripts/ # Deployment scripts
β βββ docker-build.sh
β βββ docker-start.sh
β βββ docker-stop.sh
β
βββ .github/workflows/ # CI/CD
β βββ ci.yml
β
βββ data/ # Data directories
β βββ gallery/
β β βββ source_media/ # Imported videos
β β βββ generated_images/ # Ghibli frames
β β βββ generated_videos/ # Animated outputs
β βββ temp/ # Temporary files
β βββ models/ # AI models
β
βββ requirements*.txt # Dependencies
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β NGINX (80/443) β
β Reverse Proxy β
βββββββββββββββββββ¬ββββββββββββββββββββ¬ββββββββββββββββββββββββ
β β
βββββββββββΌββββββββββ βββββββββΌββββββββ
β Frontend β β API β
β (Streamlit) β β (FastAPI) β
β :8501 β β :8000 β
βββββββββββββββββββββ βββββββββ¬ββββββββ
β
βββββββββββββΌββββββββββββ
β β β
βββββββββΌββββ βββββββΌββββββ βββββΌββββ
β Worker β β Redis β β GPUs β
β (Tasks) β β (Queue) β β2xH100 β
βββββββββββββ βββββββββββββ βββββββββ
POST /api/v1/ingestion/download- Download video from URLPOST /api/v1/ingestion/upload- Upload video fileGET /api/v1/ingestion/videos- List all videos
GET /api/v1/gallery/stats- Gallery statisticsGET /api/v1/gallery/source- List source mediaGET /api/v1/gallery/images- List generated imagesGET /api/v1/gallery/videos- List generated videos
POST /api/v1/generation/image- Generate Ghibli imagePOST /api/v1/generation/video- Generate animated videoGET /api/v1/generation/tasks- List generation tasksGET /api/v1/generation/tasks/{id}- Get task status
GET /api/v1/system/info- System informationGET /api/v1/system/gpu- GPU statusPOST /api/v1/system/gpu/clear-cache- Clear GPU memory
| Component | Model | Purpose |
|---|---|---|
| Base | SDXL 1.0 | High-quality generation |
| Style | ntc-ai/SDXL-LoRA-slider.Studio-Ghibli-style | Ghibli aesthetic |
| Structure | ControlNet (Depth/Canny) | Preserve source |
Settings (H100 optimized):
- Steps: 30
- CFG: 5.0
- LoRA Weight: 0.75
- Batch Size: 4
Implementation note:
- The ComfyUI workflow is generated dynamically in
utils/comfyui_client.pyand executed via the ComfyUI HTTP API. - That means you won't see a pre-saved graph in ComfyUI unless you build/import one yourself.
Generated Image + Source Video
β
Wan2.2 Animate Control
β
RIFE 4x Interpolation
β
Optional Upscale
β
Audio Merge + Encode
β
Output Video
Automatic optimizations enabled:
- β TF32 Tensor Cores
- β BFloat16 precision
- β Flash Attention 2
- β torch.compile
- β Multi-GPU distribution
- β No memory offloading needed
# API
API_HOST=0.0.0.0
API_PORT=8000
API_WORKERS=2
# GPU
CUDA_VISIBLE_DEVICES=0,1
NVIDIA_TF32_OVERRIDE=1
# Generation
SDXL_STEPS=30
SDXL_BATCH_SIZE=4
WAN_NUM_FRAMES=96
RIFE_MULTIPLIER=4See env.example for full configuration.
cd Ganimation2
source venv/bin/activate
# Run API with hot-reload
uvicorn api.main:app --reload --port 8000
# Run Frontend
streamlit run app.py# Start with hot-reload
./scripts/docker-start.sh dev
# View logs
docker compose -f docker-compose.dev.yml logs -f
# Rebuild after changes
docker compose -f docker-compose.dev.yml up --build# Build images
./scripts/docker-build.sh
# Start production stack (with nginx)
./scripts/docker-start.sh prod -d
# Check status
docker compose ps
docker compose logs -f- Docker Guide - Detailed Docker documentation
- API Docs - Interactive API documentation
- ReDoc - Alternative API docs
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing) - Open Pull Request
MIT License - see LICENSE for details.
- Stability AI - SDXL
- ntc-ai - Ghibli LoRA
- RIFE - Frame interpolation
- FastAPI - API framework
- Streamlit - UI framework