mirror of
				https://github.com/Wan-Video/Wan2.1.git
				synced 2025-11-04 06:15:17 +00:00 
			
		
		
		
	This commit introduces comprehensive Docker support for running Wan2.1 video generation models locally with GPU acceleration. Changes: - Add Dockerfile with CUDA 12.1 support and optimized layer caching - Add docker-compose.yml for easy container orchestration - Add .dockerignore for efficient Docker builds - Add DOCKER_SETUP.md with detailed setup and troubleshooting guide - Add DOCKER_QUICKSTART.md for rapid deployment - Add docker-run.sh helper script for container management - Update Makefile with Docker management commands Features: - Full GPU support with NVIDIA Docker runtime - Single-GPU and multi-GPU (FSDP + xDiT) configurations - Memory optimization flags for consumer GPUs (8GB+) - Gradio web interface support on port 7860 - Volume mounts for models, outputs, and cache - Comprehensive troubleshooting and optimization guides - Production-ready security best practices The Docker setup supports all Wan2.1 models (T2V, I2V, FLF2V, VACE) and includes both 1.3B (consumer GPU) and 14B (high-end GPU) variants. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
		
			
				
	
	
		
			59 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
.PHONY: format docker-build docker-up docker-down docker-shell docker-logs docker-clean help
 | 
						|
 | 
						|
# Code formatting
 | 
						|
format:
 | 
						|
	isort generate.py gradio wan
 | 
						|
	yapf -i -r *.py generate.py gradio wan
 | 
						|
 | 
						|
# Docker commands
 | 
						|
docker-build:
 | 
						|
	@echo "Building Docker image..."
 | 
						|
	docker compose build
 | 
						|
 | 
						|
docker-up:
 | 
						|
	@echo "Starting Wan2.1 container..."
 | 
						|
	@mkdir -p models outputs cache
 | 
						|
	docker compose up -d wan2-1
 | 
						|
 | 
						|
docker-down:
 | 
						|
	@echo "Stopping Wan2.1 container..."
 | 
						|
	docker compose down
 | 
						|
 | 
						|
docker-restart: docker-down docker-up
 | 
						|
 | 
						|
docker-shell:
 | 
						|
	@echo "Entering container shell..."
 | 
						|
	docker compose exec wan2-1 bash
 | 
						|
 | 
						|
docker-logs:
 | 
						|
	@echo "Showing container logs..."
 | 
						|
	docker compose logs -f wan2-1
 | 
						|
 | 
						|
docker-clean:
 | 
						|
	@echo "Cleaning up Docker resources..."
 | 
						|
	docker compose down -v
 | 
						|
	docker system prune -f
 | 
						|
 | 
						|
docker-status:
 | 
						|
	@echo "Container status:"
 | 
						|
	docker compose ps
 | 
						|
 | 
						|
# Help command
 | 
						|
help:
 | 
						|
	@echo "Wan2.1 Makefile Commands:"
 | 
						|
	@echo ""
 | 
						|
	@echo "Code Formatting:"
 | 
						|
	@echo "  make format          - Format Python code with isort and yapf"
 | 
						|
	@echo ""
 | 
						|
	@echo "Docker Management:"
 | 
						|
	@echo "  make docker-build    - Build Docker image"
 | 
						|
	@echo "  make docker-up       - Start container (with GPU support)"
 | 
						|
	@echo "  make docker-down     - Stop container"
 | 
						|
	@echo "  make docker-restart  - Restart container"
 | 
						|
	@echo "  make docker-shell    - Enter container shell"
 | 
						|
	@echo "  make docker-logs     - View container logs"
 | 
						|
	@echo "  make docker-status   - Show container status"
 | 
						|
	@echo "  make docker-clean    - Remove containers and clean up"
 | 
						|
	@echo ""
 | 
						|
	@echo "For detailed Docker setup, see DOCKER_SETUP.md"
 |