Spaces:
Paused
Paused
| """ | |
| アプリケーション設定 | |
| """ | |
| import os | |
| from pathlib import Path | |
| # 基本ディレクトリ設定 | |
| BASE_DIR = Path(__file__).parent | |
| MODEL_DIR = BASE_DIR / "Wan2.1-VACE-1.3B" | |
| WORK_DIR = BASE_DIR / "workspace" | |
| RESULTS_DIR = BASE_DIR / "results" | |
| EXAMPLES_DIR = BASE_DIR / "examples" | |
| # 環境変数設定 | |
| os.environ["HF_HOME"] = str(BASE_DIR / "cache" / "huggingface") | |
| os.environ["TORCH_HOME"] = str(BASE_DIR / "cache" / "torch") | |
| os.environ["TRANSFORMERS_CACHE"] = str(BASE_DIR / "cache" / "transformers") | |
| # GPU設定 | |
| CUDA_DEVICE = os.environ.get("CUDA_VISIBLE_DEVICES", "0") | |
| USE_GPU = True | |
| # モデル設定 | |
| MODEL_CONFIG = { | |
| "model_id": "Wan-AI/Wan2.1-VACE-1.3B", | |
| "num_inference_steps": 50, | |
| "guidance_scale": 7.5, | |
| "fps": 24, | |
| "num_frames": 240, # 10秒 | |
| "resolution": (512, 512), | |
| } | |
| # Gradio設定 | |
| GRADIO_CONFIG = { | |
| "server_name": "0.0.0.0", | |
| "share": False, | |
| "show_error": True, | |
| "max_threads": 10, | |
| } | |
| # ログ設定 | |
| LOG_CONFIG = { | |
| "level": "INFO", | |
| "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s", | |
| } | |
| # Hugging Face Spaces設定 | |
| SPACES_CONFIG = { | |
| "title": "Wan2.1 VACE Face-Preserving Video Generation", | |
| "description": "Generate videos while preserving facial identity using Wan2.1 VACE", | |
| "article": """ | |
| ### About this Space | |
| This Space demonstrates Wan2.1 VACE's ability to generate videos that preserve facial identity. | |
| Upload a reference face image, first and last frames, and let AI generate smooth transitions. | |
| ### Technical Details | |
| - Model: Wan2.1-VACE-1.3B | |
| - Resolution: 512x512 | |
| - Duration: ~10 seconds (240 frames at 24fps) | |
| - GPU: Recommended A10 or better | |
| """, | |
| "theme": "default", | |
| } |