anycoder-8d7d31b2 / config.py
Onise's picture
Update config.py from anycoder
06e50fb verified
"""
Configuration for Wan2.2-TI2V-5B Video Generator
"""
# Model Configuration
MODEL_CONFIG = {
"model_id": "Wan-AI/Wan2.1-T2V-14B-Diffusers",
"revision": "main",
"torch_dtype": "bfloat16",
"use_safetensors": True,
}
# Default Generation Parameters
DEFAULT_PARAMS = {
"height": 480,
"width": 848,
"num_frames": 25,
"guidance_scale": 5.0,
"num_inference_steps": 20,
"fps": 16,
}
# LoRA Configuration
LORA_CONFIG = {
"default_scale": 0.8,
"max_scale": 1.0,
"cache_dir": "/tmp/lora_cache",
}
# Memory Optimization
MEMORY_CONFIG = {
"enable_cpu_offload": True,
"enable_attention_slicing": True,
"enable_vae_slicing": True,
"max_memory_reserved_gb": 24,
}
# Available LoRAs with their configurations
AVAILABLE_LORAS = {
"wan-fast-lora": {
"repo": "Kijai/Wan2.1-fp8-diffusers",
"filename": "wan2.1_fast_lora.safetensors",
"description": "Optimized for 2-3x faster generation",
"trigger_words": [],
"recommended_scale": 0.8,
"speed_factor": 2.5,
},
"wan-quality-lora": {
"repo": "Kijai/Wan2.1-fp8-diffusers",
"filename": "wan2.1_quality_lora.safetensors",
"description": "Enhanced visual quality",
"trigger_words": ["high quality", "detailed", "4K"],
"recommended_scale": 0.7,
"speed_factor": 1.0,
},
"wan-motion-lora": {
"repo": "Kijai/Wan2.1-fp8-diffusers",
"filename": "wan2.1_motion_lora.safetensors",
"description": "Better motion dynamics",
"trigger_words": ["smooth motion", "dynamic", "flowing"],
"recommended_scale": 0.75,
"speed_factor": 1.0,
},
}
# UI Configuration
UI_CONFIG = {
"title": "Wan2.2-TI2V-5B Video Generator",
"description": "Generate stunning videos from text or image prompts with LoRA acceleration",
"theme": {
"primary_hue": "indigo",
"secondary_hue": "purple",
"neutral_hue": "slate",
},
"max_prompt_length": 500,
"example_prompts": [
"A majestic dragon flying through clouds at sunset, cinematic lighting, 4K quality",
"A serene ocean wave crashing on a beach, slow motion, golden hour",
"A futuristic city with flying cars and neon lights, cyberpunk style",
"A cat playing with a ball of yarn, cute, fluffy, soft lighting",
"Time-lapse of flowers blooming in a garden, vibrant colors",
],
}
# API Configuration
API_CONFIG = {
"max_concurrent_requests": 3,
"request_timeout_seconds": 600,
"max_video_duration_frames": 81,
"supported_output_formats": ["mp4", "webm"],
}