Commit ac520b50 authored by gushiqiao's avatar gushiqiao
Browse files

Update gradio and docs

parent db4238af
...@@ -45,6 +45,21 @@ For comprehensive usage instructions, please refer to our documentation: **[Engl ...@@ -45,6 +45,21 @@ For comprehensive usage instructions, please refer to our documentation: **[Engl
### Autoregressive Models ### Autoregressive Models
-[Wan2.1-T2V-CausVid](https://huggingface.co/lightx2v/Wan2.1-T2V-14B-CausVid) -[Wan2.1-T2V-CausVid](https://huggingface.co/lightx2v/Wan2.1-T2V-14B-CausVid)
## 🚀 Frontend Interfaces
We provide multiple frontend interface deployment options:
- **🎨 Gradio Interface**: Clean and user-friendly web interface, perfect for quick experience and prototyping
- 📖 [Gradio Deployment Guide](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/deploy_gradio.html)
- **🎯 ComfyUI Interface**: Powerful node-based workflow interface, supporting complex video generation tasks
- 📖 [ComfyUI Deployment Guide](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/deploy_comfyui.html)
- **🚀 Windows One-Click Deployment**: Convenient deployment solution designed for Windows users, featuring automatic environment configuration and intelligent parameter optimization
- 📖 [Windows One-Click Deployment Guide](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/deploy_local_windows.html)
**💡 Recommended Solutions**:
- **First-time Users**: We recommend the Windows one-click deployment solution
- **Advanced Users**: We recommend the ComfyUI interface for more customization options
- **Quick Experience**: The Gradio interface provides the most intuitive operation experience
## 🚀 Core Features ## 🚀 Core Features
...@@ -81,7 +96,6 @@ For detailed performance metrics and comparisons, please refer to our [benchmark ...@@ -81,7 +96,6 @@ For detailed performance metrics and comparisons, please refer to our [benchmark
- [Parameter Offloading](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/offload.html) - Three-tier storage architecture - [Parameter Offloading](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/offload.html) - Three-tier storage architecture
- [Parallel Inference](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/parallel.html) - Multi-GPU acceleration strategies - [Parallel Inference](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/parallel.html) - Multi-GPU acceleration strategies
- [Step Distillation](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/step_distill.html) - 4-step inference technology - [Step Distillation](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/step_distill.html) - 4-step inference technology
- [Video Frame Interpolation](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/video_frame_interpolation.html) - RIFE-based frame interpolation
### 🛠️ **Deployment Guides** ### 🛠️ **Deployment Guides**
- [Low-Resource Deployment](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/for_low_resource.html) - Optimized 8GB VRAM solutions - [Low-Resource Deployment](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/for_low_resource.html) - Optimized 8GB VRAM solutions
......
...@@ -44,6 +44,22 @@ ...@@ -44,6 +44,22 @@
### 自回归模型 ### 自回归模型
-[Wan2.1-T2V-CausVid](https://huggingface.co/lightx2v/Wan2.1-T2V-14B-CausVid) -[Wan2.1-T2V-CausVid](https://huggingface.co/lightx2v/Wan2.1-T2V-14B-CausVid)
## 🚀 前端展示
我们提供了多种前端界面部署方式:
- **🎨 Gradio界面**: 简洁易用的Web界面,适合快速体验和原型开发
- 📖 [Gradio部署文档](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/deploy_gradio.html)
- **🎯 ComfyUI界面**: 强大的节点式工作流界面,支持复杂的视频生成任务
- 📖 [ComfyUI部署文档](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/deploy_comfyui.html)
- **🚀 Windows一键部署**: 专为Windows用户设计的便捷部署方案,支持自动环境配置和智能参数优化
- 📖 [Windows一键部署文档](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/deploy_local_windows.html)
**💡 推荐方案**:
- **首次使用**: 建议选择Windows一键部署方案
- **高级用户**: 推荐使用ComfyUI界面获得更多自定义选项
- **快速体验**: Gradio界面提供最直观的操作体验
## 🚀 核心特性 ## 🚀 核心特性
### 🎯 **极致性能优化** ### 🎯 **极致性能优化**
...@@ -61,7 +77,6 @@ ...@@ -61,7 +77,6 @@
- **🔄 并行推理加速**: 多GPU并行处理,显著提升性能表现 - **🔄 并行推理加速**: 多GPU并行处理,显著提升性能表现
- **📱 灵活部署选择**: 支持Gradio、服务化部署、ComfyUI等多种部署方式 - **📱 灵活部署选择**: 支持Gradio、服务化部署、ComfyUI等多种部署方式
- **🎛️ 动态分辨率推理**: 自适应分辨率调整,优化生成质量 - **🎛️ 动态分辨率推理**: 自适应分辨率调整,优化生成质量
- **🎞️ 视频帧插值**: 基于RIFE的帧插值技术,实现流畅的帧率提升
## 🏆 性能基准测试 ## 🏆 性能基准测试
......
...@@ -5,3 +5,9 @@ Please refer our gradio deployment doc: ...@@ -5,3 +5,9 @@ Please refer our gradio deployment doc:
[English doc: Gradio Deployment](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/deploy_gradio.html) [English doc: Gradio Deployment](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/deploy_gradio.html)
[中文文档: Gradio 部署](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/deploy_gradio.html) [中文文档: Gradio 部署](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/deploy_gradio.html)
## 🚀 Quick Start (快速开始)
For Windows users, we provide a convenient one-click deployment solution with automatic environment configuration and intelligent parameter optimization. Please refer to the [One-Click Gradio Launch](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/deploy_local_windows.html) section for detailed instructions.
对于Windows用户,我们提供了便捷的一键部署方式,支持自动环境配置和智能参数优化。详细操作请参考[一键启动Gradio](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/deploy_local_windows.html)章节。
...@@ -126,10 +126,10 @@ def cleanup_memory(): ...@@ -126,10 +126,10 @@ def cleanup_memory():
pass pass
def generate_unique_filename(base_dir="./saved_videos"): def generate_unique_filename(output_dir):
os.makedirs(base_dir, exist_ok=True) os.makedirs(output_dir, exist_ok=True)
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
return os.path.join(base_dir, f"{model_cls}_{timestamp}.mp4") return os.path.join(output_dir, f"{model_cls}_{timestamp}.mp4")
def is_fp8_supported_gpu(): def is_fp8_supported_gpu():
...@@ -300,7 +300,7 @@ def run_inference( ...@@ -300,7 +300,7 @@ def run_inference(
], ],
] ]
save_video_path = generate_unique_filename() save_video_path = generate_unique_filename(output_dir)
is_dit_quant = dit_quant_scheme != "bf16" is_dit_quant = dit_quant_scheme != "bf16"
is_t5_quant = t5_quant_scheme != "bf16" is_t5_quant = t5_quant_scheme != "bf16"
...@@ -744,7 +744,7 @@ def auto_configure(enable_auto_config, resolution): ...@@ -744,7 +744,7 @@ def auto_configure(enable_auto_config, resolution):
def main(): def main():
def toggle_image_input(task): def toggle_image_input(task):
return gr.update(visible=(task == "Image to Video")) return gr.update(visible=(task == "i2v"))
with gr.Blocks( with gr.Blocks(
title="Lightx2v (Lightweight Video Inference and Generation Engine)", title="Lightx2v (Lightweight Video Inference and Generation Engine)",
...@@ -865,15 +865,35 @@ def main(): ...@@ -865,15 +865,35 @@ def main():
with gr.Column(): with gr.Column():
# Set default inference steps based on model class # Set default inference steps based on model class
default_infer_steps = 4 if model_cls == "wan2.1_distill" else 40 if model_cls == "wan2.1_distill":
infer_steps = gr.Slider( infer_steps = gr.Slider(
label="Inference Steps", label="Inference Steps",
minimum=1, minimum=4,
maximum=100, maximum=4,
step=1, step=1,
value=default_infer_steps, value=4,
info="Number of inference steps for video generation. Increasing steps may improve quality but reduce speed.", interactive=False,
) info="Inference steps fixed at 4 for optimal performance for distill model.",
)
elif model_cls == "wan2.1":
if task == "i2v":
infer_steps = gr.Slider(
label="Inference Steps",
minimum=1,
maximum=100,
step=1,
value=40,
info="Number of inference steps for video generation. Increasing steps may improve quality but reduce speed.",
)
elif task == "t2v":
infer_steps = gr.Slider(
label="Inference Steps",
minimum=1,
maximum=100,
step=1,
value=50,
info="Number of inference steps for video generation. Increasing steps may improve quality but reduce speed.",
)
# Set default CFG based on model class # Set default CFG based on model class
default_enable_cfg = False if model_cls == "wan2.1_distill" else True default_enable_cfg = False if model_cls == "wan2.1_distill" else True
...@@ -918,7 +938,7 @@ def main(): ...@@ -918,7 +938,7 @@ def main():
save_video_path = gr.Textbox( save_video_path = gr.Textbox(
label="Output Video Path", label="Output Video Path",
value=generate_unique_filename(), value=generate_unique_filename(output_dir),
info="Must include .mp4 extension. If left blank or using the default value, a unique filename will be automatically generated.", info="Must include .mp4 extension. If left blank or using the default value, a unique filename will be automatically generated.",
) )
with gr.Column(scale=6): with gr.Column(scale=6):
...@@ -1199,7 +1219,7 @@ def main(): ...@@ -1199,7 +1219,7 @@ def main():
outputs=output_video, outputs=output_video,
) )
demo.launch(share=True, server_port=args.server_port, server_name=args.server_name, inbrowser=True) demo.launch(share=True, server_port=args.server_port, server_name=args.server_name, inbrowser=True, allowed_paths=[output_dir])
if __name__ == "__main__": if __name__ == "__main__":
...@@ -1216,12 +1236,14 @@ if __name__ == "__main__": ...@@ -1216,12 +1236,14 @@ if __name__ == "__main__":
parser.add_argument("--task", type=str, required=True, choices=["i2v", "t2v"], help="Specify the task type. 'i2v' for image-to-video translation, 't2v' for text-to-video generation.") parser.add_argument("--task", type=str, required=True, choices=["i2v", "t2v"], help="Specify the task type. 'i2v' for image-to-video translation, 't2v' for text-to-video generation.")
parser.add_argument("--server_port", type=int, default=7862, help="Server port") parser.add_argument("--server_port", type=int, default=7862, help="Server port")
parser.add_argument("--server_name", type=str, default="0.0.0.0", help="Server ip") parser.add_argument("--server_name", type=str, default="0.0.0.0", help="Server ip")
parser.add_argument("--output_dir", type=str, default="./outputs", help="Output video save directory")
args = parser.parse_args() args = parser.parse_args()
global model_path, model_cls, model_size global model_path, model_cls, model_size, output_dir
model_path = args.model_path model_path = args.model_path
model_cls = args.model_cls model_cls = args.model_cls
model_size = args.model_size model_size = args.model_size
task = args.task task = args.task
output_dir = args.output_dir
main() main()
...@@ -128,10 +128,10 @@ def cleanup_memory(): ...@@ -128,10 +128,10 @@ def cleanup_memory():
pass pass
def generate_unique_filename(base_dir="./saved_videos"): def generate_unique_filename(output_dir):
os.makedirs(base_dir, exist_ok=True) os.makedirs(output_dir, exist_ok=True)
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
return os.path.join(base_dir, f"{model_cls}_{timestamp}.mp4") return os.path.join(output_dir, f"{model_cls}_{timestamp}.mp4")
def is_fp8_supported_gpu(): def is_fp8_supported_gpu():
...@@ -302,7 +302,7 @@ def run_inference( ...@@ -302,7 +302,7 @@ def run_inference(
], ],
] ]
save_video_path = generate_unique_filename() save_video_path = generate_unique_filename(output_dir)
is_dit_quant = dit_quant_scheme != "bf16" is_dit_quant = dit_quant_scheme != "bf16"
is_t5_quant = t5_quant_scheme != "bf16" is_t5_quant = t5_quant_scheme != "bf16"
...@@ -867,15 +867,35 @@ def main(): ...@@ -867,15 +867,35 @@ def main():
with gr.Column(): with gr.Column():
# 根据模型类别设置默认推理步数 # 根据模型类别设置默认推理步数
default_infer_steps = 4 if model_cls == "wan2.1_distill" else 40 if model_cls == "wan2.1_distill":
infer_steps = gr.Slider( infer_steps = gr.Slider(
label="推理步数", label="推理步数",
minimum=1, minimum=4,
maximum=100, maximum=4,
step=1, step=1,
value=default_infer_steps, value=4,
info="视频生成的推理步数。增加步数可能提高质量但降低速度。", interactive=False,
) info="推理步数固定为4,以获得最佳性能(对于蒸馏模型)。",
)
elif model_cls == "wan2.1":
if task == "i2v":
infer_steps = gr.Slider(
label="推理步数",
minimum=1,
maximum=100,
step=1,
value=40,
info="视频生成的推理步数。增加步数可能提高质量但降低速度。",
)
elif task == "t2v":
infer_steps = gr.Slider(
label="推理步数",
minimum=1,
maximum=100,
step=1,
value=50,
info="视频生成的推理步数。增加步数可能提高质量但降低速度。",
)
# 根据模型类别设置默认CFG # 根据模型类别设置默认CFG
default_enable_cfg = False if model_cls == "wan2.1_distill" else True default_enable_cfg = False if model_cls == "wan2.1_distill" else True
...@@ -920,7 +940,7 @@ def main(): ...@@ -920,7 +940,7 @@ def main():
save_video_path = gr.Textbox( save_video_path = gr.Textbox(
label="输出视频路径", label="输出视频路径",
value=generate_unique_filename(), value=generate_unique_filename(output_dir),
info="必须包含.mp4扩展名。如果留空或使用默认值,将自动生成唯一文件名。", info="必须包含.mp4扩展名。如果留空或使用默认值,将自动生成唯一文件名。",
) )
with gr.Column(scale=6): with gr.Column(scale=6):
...@@ -1199,7 +1219,7 @@ def main(): ...@@ -1199,7 +1219,7 @@ def main():
outputs=output_video, outputs=output_video,
) )
demo.launch(share=True, server_port=args.server_port, server_name=args.server_name, inbrowser=True) demo.launch(share=True, server_port=args.server_port, server_name=args.server_name, inbrowser=True, allowed_paths=[output_dir])
if __name__ == "__main__": if __name__ == "__main__":
...@@ -1216,12 +1236,14 @@ if __name__ == "__main__": ...@@ -1216,12 +1236,14 @@ if __name__ == "__main__":
parser.add_argument("--task", type=str, required=True, choices=["i2v", "t2v"], help="指定任务类型。'i2v'用于图像到视频转换,'t2v'用于文本到视频生成。") parser.add_argument("--task", type=str, required=True, choices=["i2v", "t2v"], help="指定任务类型。'i2v'用于图像到视频转换,'t2v'用于文本到视频生成。")
parser.add_argument("--server_port", type=int, default=7862, help="服务器端口") parser.add_argument("--server_port", type=int, default=7862, help="服务器端口")
parser.add_argument("--server_name", type=str, default="0.0.0.0", help="服务器IP") parser.add_argument("--server_name", type=str, default="0.0.0.0", help="服务器IP")
parser.add_argument("--output_dir", type=str, default="./outputs", help="输出视频保存目录")
args = parser.parse_args() args = parser.parse_args()
global model_path, model_cls, model_size global model_path, model_cls, model_size, output_dir
model_path = args.model_path model_path = args.model_path
model_cls = args.model_cls model_cls = args.model_cls
model_size = args.model_size model_size = args.model_size
task = args.task task = args.task
output_dir = args.output_dir
main() main()
...@@ -18,7 +18,7 @@ lightx2v_path=/path/to/lightx2v ...@@ -18,7 +18,7 @@ lightx2v_path=/path/to/lightx2v
# Model path configuration # Model path configuration
# Image-to-video model path (for i2v tasks) # Image-to-video model path (for i2v tasks)
# Example: /path/to/Wan2.1-I2V-14B-720P-Lightx2v # Example: /path/to/Wan2.1-I2V-14B-720P-Lightx2v
i2v_model_path=/Wan_0718/Wan2.1-I2V-14B-480P-StepDistill-CfgDistill-Lightx2v/ i2v_model_path=/path/to/Wan2.1-I2V-14B-480P-StepDistill-CfgDistill-Lightx2v/
# Text-to-video model path (for t2v tasks) # Text-to-video model path (for t2v tasks)
# Example: /path/to/Wan2.1-T2V-1.3B # Example: /path/to/Wan2.1-T2V-1.3B
...@@ -36,6 +36,9 @@ model_cls="wan2.1" ...@@ -36,6 +36,9 @@ model_cls="wan2.1"
server_name="0.0.0.0" server_name="0.0.0.0"
server_port=8032 server_port=8032
# Output directory configuration
output_dir="./outputs"
# GPU configuration # GPU configuration
gpu_id=0 gpu_id=0
...@@ -80,6 +83,10 @@ while [[ $# -gt 0 ]]; do ...@@ -80,6 +83,10 @@ while [[ $# -gt 0 ]]; do
model_cls="$2" model_cls="$2"
shift 2 shift 2
;; ;;
--output_dir)
output_dir="$2"
shift 2
;;
--help) --help)
echo "🎬 Lightx2v Gradio Demo Startup Script" echo "🎬 Lightx2v Gradio Demo Startup Script"
echo "==========================================" echo "=========================================="
...@@ -98,20 +105,23 @@ while [[ $# -gt 0 ]]; do ...@@ -98,20 +105,23 @@ while [[ $# -gt 0 ]]; do
echo " Model size (default: 14b)" echo " Model size (default: 14b)"
echo " 14b: 14 billion parameters model" echo " 14b: 14 billion parameters model"
echo " 1.3b: 1.3 billion parameters model" echo " 1.3b: 1.3 billion parameters model"
echo " --model_cls MODEL_CLASS" echo " --model_cls MODEL_CLASS"
echo " Model class (default: wan2.1)" echo " Model class (default: wan2.1)"
echo " wan2.1: Standard model variant" echo " wan2.1: Standard model variant"
echo " wan2.1_distill: Distilled model variant for faster inference" echo " wan2.1_distill: Distilled model variant for faster inference"
echo " --help Show this help message" echo " --output_dir OUTPUT_DIR"
echo " Output video save directory (default: ./saved_videos)"
echo " --help Show this help message"
echo "" echo ""
echo "🚀 Usage examples:" echo "🚀 Usage examples:"
echo " $0 # Default startup for image-to-video mode" echo " $0 # Default startup for image-to-video mode"
echo " $0 --task i2v --lang zh --port 8032 # Start with specified parameters" echo " $0 --task i2v --lang zh --port 8032 # Start with specified parameters"
echo " $0 --task t2v --lang en --port 7860 # Text-to-video with English interface" echo " $0 --task t2v --lang en --port 7860 # Text-to-video with English interface"
echo " $0 --task i2v --gpu 1 --port 8032 # Use GPU 1" echo " $0 --task i2v --gpu 1 --port 8032 # Use GPU 1"
echo " $0 --task t2v --model_size 1.3b # Use 1.3B model" echo " $0 --task t2v --model_size 1.3b # Use 1.3B model"
echo " $0 --task i2v --model_size 14b # Use 14B model" echo " $0 --task i2v --model_size 14b # Use 14B model"
echo " $0 --task i2v --model_cls wan2.1_distill # Use distilled model" echo " $0 --task i2v --model_cls wan2.1_distill # Use distilled model"
echo " $0 --task i2v --output_dir ./custom_output # Use custom output directory"
echo "" echo ""
echo "📝 Notes:" echo "📝 Notes:"
echo " - Edit script to configure model paths before first use" echo " - Edit script to configure model paths before first use"
...@@ -204,6 +214,7 @@ echo "🤖 Model class: $model_cls" ...@@ -204,6 +214,7 @@ echo "🤖 Model class: $model_cls"
echo "🌏 Interface language: $lang" echo "🌏 Interface language: $lang"
echo "🖥️ GPU device: $gpu_id" echo "🖥️ GPU device: $gpu_id"
echo "🌐 Server address: $server_name:$server_port" echo "🌐 Server address: $server_name:$server_port"
echo "📁 Output directory: $output_dir"
echo "==========================================" echo "=========================================="
# Display system resource information # Display system resource information
...@@ -232,7 +243,8 @@ python $demo_file \ ...@@ -232,7 +243,8 @@ python $demo_file \
--task "$task" \ --task "$task" \
--server_name "$server_name" \ --server_name "$server_name" \
--server_port "$server_port" \ --server_port "$server_port" \
--model_size "$model_size" --model_size "$model_size" \
--output_dir "$output_dir"
# Display final system resource usage # Display final system resource usage
echo "" echo ""
......
...@@ -36,6 +36,9 @@ REM Server configuration ...@@ -36,6 +36,9 @@ REM Server configuration
set server_name=127.0.0.1 set server_name=127.0.0.1
set server_port=8032 set server_port=8032
REM Output directory configuration
set output_dir=./outputs
REM GPU configuration REM GPU configuration
set gpu_id=0 set gpu_id=0
...@@ -91,6 +94,12 @@ if "%1"=="--model_cls" ( ...@@ -91,6 +94,12 @@ if "%1"=="--model_cls" (
shift shift
goto :parse_args goto :parse_args
) )
if "%1"=="--output_dir" (
set output_dir=%2
shift
shift
goto :parse_args
)
if "%1"=="--help" ( if "%1"=="--help" (
echo 🎬 LightX2V Gradio Windows Startup Script echo 🎬 LightX2V Gradio Windows Startup Script
echo ========================================== echo ==========================================
...@@ -113,6 +122,8 @@ if "%1"=="--help" ( ...@@ -113,6 +122,8 @@ if "%1"=="--help" (
echo Model class (default: wan2.1) echo Model class (default: wan2.1)
echo wan2.1: Standard model variant echo wan2.1: Standard model variant
echo wan2.1_distill: Distilled model variant for faster inference echo wan2.1_distill: Distilled model variant for faster inference
echo --output_dir OUTPUT_DIR
echo Output video save directory (default: ./saved_videos)
echo --help Show this help message echo --help Show this help message
echo. echo.
echo 🚀 Usage examples: echo 🚀 Usage examples:
...@@ -123,6 +134,7 @@ if "%1"=="--help" ( ...@@ -123,6 +134,7 @@ if "%1"=="--help" (
echo %0 --task t2v --model_size 1.3b # Use 1.3B model echo %0 --task t2v --model_size 1.3b # Use 1.3B model
echo %0 --task i2v --model_size 14b # Use 14B model echo %0 --task i2v --model_size 14b # Use 14B model
echo %0 --task i2v --model_cls wan2.1_distill # Use distilled model echo %0 --task i2v --model_cls wan2.1_distill # Use distilled model
echo %0 --task i2v --output_dir ./custom_output # Use custom output directory
echo. echo.
echo 📝 Notes: echo 📝 Notes:
echo - Edit script to configure model paths before first use echo - Edit script to configure model paths before first use
...@@ -224,6 +236,7 @@ echo 🤖 Model class: %model_cls% ...@@ -224,6 +236,7 @@ echo 🤖 Model class: %model_cls%
echo 🌏 Interface language: %lang% echo 🌏 Interface language: %lang%
echo 🖥️ GPU device: %gpu_id% echo 🖥️ GPU device: %gpu_id%
echo 🌐 Server address: %server_name%:%server_port% echo 🌐 Server address: %server_name%:%server_port%
echo 📁 Output directory: %output_dir%
echo ========================================== echo ==========================================
REM Display system resource information REM Display system resource information
...@@ -253,7 +266,8 @@ python %demo_file% ^ ...@@ -253,7 +266,8 @@ python %demo_file% ^
--task %task% ^ --task %task% ^
--server_name %server_name% ^ --server_name %server_name% ^
--server_port %server_port% ^ --server_port %server_port% ^
--model_size %model_size% --model_size %model_size% ^
--output_dir "%output_dir%"
REM Display final system resource usage REM Display final system resource usage
echo. echo.
......
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
Lightx2v is a lightweight video inference and generation engine that provides a web interface based on Gradio, supporting both Image-to-Video and Text-to-Video generation modes. Lightx2v is a lightweight video inference and generation engine that provides a web interface based on Gradio, supporting both Image-to-Video and Text-to-Video generation modes.
For Windows systems, we provide a convenient one-click deployment solution with automatic environment configuration and intelligent parameter optimization. Please refer to the [One-Click Gradio Startup (Recommended)](./deploy_local_windows.md/#one-click-gradio-startup-recommended) section for detailed instructions.
![Gradio English Interface](../../../../assets/figs/portabl_windows/pig_gradio_en.png)
## 📁 File Structure ## 📁 File Structure
``` ```
...@@ -12,7 +16,7 @@ LightX2V/app/ ...@@ -12,7 +16,7 @@ LightX2V/app/
├── gradio_demo_zh.py # Chinese interface demo ├── gradio_demo_zh.py # Chinese interface demo
├── run_gradio.sh # Startup script ├── run_gradio.sh # Startup script
├── README.md # Documentation ├── README.md # Documentation
├── saved_videos/ # Generated video save directory ├── outputs/ # Generated video save directory
└── inference_logs.log # Inference logs └── inference_logs.log # Inference logs
``` ```
...@@ -274,17 +278,20 @@ After enabling "Auto-configure Inference Options", the system will automatically ...@@ -274,17 +278,20 @@ After enabling "Auto-configure Inference Options", the system will automatically
**💡 Tip**: Generally, after enabling "Auto-configure Inference Options", the system will automatically optimize parameter settings based on your hardware configuration, and performance issues usually won't occur. If you encounter problems, please refer to the following solutions: **💡 Tip**: Generally, after enabling "Auto-configure Inference Options", the system will automatically optimize parameter settings based on your hardware configuration, and performance issues usually won't occur. If you encounter problems, please refer to the following solutions:
1. **CUDA Memory Insufficient** 1. **Gradio Webpage Opens Blank**
- Try upgrading gradio: `pip install --upgrade gradio`
2. **CUDA Memory Insufficient**
- Enable CPU offloading - Enable CPU offloading
- Reduce resolution - Reduce resolution
- Enable quantization options - Enable quantization options
2. **System Memory Insufficient** 3. **System Memory Insufficient**
- Enable CPU offloading - Enable CPU offloading
- Enable lazy loading option - Enable lazy loading option
- Enable quantization options - Enable quantization options
3. **Slow Generation Speed** 4. **Slow Generation Speed**
- Reduce inference steps - Reduce inference steps
- Enable auto-configuration - Enable auto-configuration
- Use lightweight models - Use lightweight models
...@@ -292,13 +299,13 @@ After enabling "Auto-configure Inference Options", the system will automatically ...@@ -292,13 +299,13 @@ After enabling "Auto-configure Inference Options", the system will automatically
- Use quantization operators - Use quantization operators
- 💾 **Check if models are stored on SSD** - 💾 **Check if models are stored on SSD**
4. **Slow Model Loading** 5. **Slow Model Loading**
- 💾 **Migrate models to SSD storage** - 💾 **Migrate models to SSD storage**
- Enable lazy loading option - Enable lazy loading option
- Check disk I/O performance - Check disk I/O performance
- Consider using NVMe SSD - Consider using NVMe SSD
5. **Poor Video Quality** 6. **Poor Video Quality**
- Increase inference steps - Increase inference steps
- Increase CFG scale factor - Increase CFG scale factor
- Use 14B models - Use 14B models
......
...@@ -13,11 +13,6 @@ This document provides detailed instructions for deploying LightX2V locally on W ...@@ -13,11 +13,6 @@ This document provides detailed instructions for deploying LightX2V locally on W
- **Memory**: Recommended 16GB+ RAM - **Memory**: Recommended 16GB+ RAM
- **Storage**: Strongly recommended to use SSD solid-state drives, mechanical hard drives will cause slow model loading - **Storage**: Strongly recommended to use SSD solid-state drives, mechanical hard drives will cause slow model loading
#### Software Requirements
- **Operating System**: Windows 10/11
- **Python**: 3.12 or higher version
- **CUDA**: 12.4 or higher version
- **Dependencies**: Refer to LightX2V project's requirements_win.txt
## 🎯 Usage Methods ## 🎯 Usage Methods
...@@ -34,8 +29,8 @@ Refer to [Quick Start Guide](../getting_started/quickstart.md) to install enviro ...@@ -34,8 +29,8 @@ Refer to [Quick Start Guide](../getting_started/quickstart.md) to install enviro
#### One-Click Gradio Startup (Recommended) #### One-Click Gradio Startup (Recommended)
**📦 Download Software Package** **📦 Download Software Package**
- [Baidu Cloud](https://pan.baidu.com/s/1ef3hEXyIuO0z6z9MoXe4nQ?pwd=7g4f) - [Baidu Cloud](https://pan.baidu.com/s/1lLb2LYl8kbmjluaM9-jCjg?pwd=ugd4)
- [Quark Cloud](https://pan.quark.cn/s/36a0cdbde7d9) - [Quark Cloud](https://pan.quark.cn/s/d0b8be4bc619)
**📁 Directory Structure** **📁 Directory Structure**
After extraction, ensure the directory structure is as follows: After extraction, ensure the directory structure is as follows:
...@@ -93,7 +88,12 @@ Double-click to run the `start_lightx2v.bat` file, the script will: ...@@ -93,7 +88,12 @@ Double-click to run the `start_lightx2v.bat` file, the script will:
**💡 Usage Suggestion**: After opening the Gradio Web page, it's recommended to check "Auto-configure Inference Options", the system will automatically select appropriate optimization configurations for your machine. When reselecting resolution, you also need to re-check "Auto-configure Inference Options". **💡 Usage Suggestion**: After opening the Gradio Web page, it's recommended to check "Auto-configure Inference Options", the system will automatically select appropriate optimization configurations for your machine. When reselecting resolution, you also need to re-check "Auto-configure Inference Options".
**⚠️ Important Note**: On first run, the system will automatically extract the environment file `env.zip`, which may take several minutes. Please be patient. Subsequent launches will skip this step. You can also manually extract the `env.zip` file to the current directory to save time on first startup. ![Gradio English Interface](../../../../assets/figs/portabl_windows/pig_gradio_en.png)
**⚠️ Important Notes**:
- **First Run**: The system will automatically extract the environment file `env.zip`, which may take several minutes. Please be patient. Subsequent launches will skip this step.
- **Faster Startup**: You can also manually extract the `env.zip` file to the current directory to save time on first startup.
- **Display Issues**: If the webpage opens blank or displays abnormally, please run `pip install --upgrade gradio` to upgrade the Gradio version.
### Method 3: Using ComfyUI Inference ### Method 3: Using ComfyUI Inference
......
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
Lightx2v 是一个轻量级的视频推理和生成引擎,提供基于 Gradio 的 Web 界面,支持图像到视频(Image-to-Video)和文本到视频(Text-to-Video)两种生成模式。 Lightx2v 是一个轻量级的视频推理和生成引擎,提供基于 Gradio 的 Web 界面,支持图像到视频(Image-to-Video)和文本到视频(Text-to-Video)两种生成模式。
对于Windows系统,我们提供了便捷的一键部署方式,支持自动环境配置和智能参数优化。详细操作请参考[一键启动Gradio](./deploy_local_windows.md/#一键启动gradio推荐)章节。
![Gradio中文界面](../../../../assets/figs/portabl_windows/pig_gradio_zh.png)
## 📁 文件结构 ## 📁 文件结构
``` ```
...@@ -12,7 +16,7 @@ LightX2V/app/ ...@@ -12,7 +16,7 @@ LightX2V/app/
├── gradio_demo_zh.py # 中文界面演示 ├── gradio_demo_zh.py # 中文界面演示
├── run_gradio.sh # 启动脚本 ├── run_gradio.sh # 启动脚本
├── README.md # 说明文档 ├── README.md # 说明文档
├── saved_videos/ # 生成视频保存目录 ├── outputs/ # 生成视频保存目录
└── inference_logs.log # 推理日志 └── inference_logs.log # 推理日志
``` ```
...@@ -274,17 +278,20 @@ python gradio_demo_zh.py ^ ...@@ -274,17 +278,20 @@ python gradio_demo_zh.py ^
**💡 提示**: 一般情况下,启用"自动配置推理选项"后,系统会根据您的硬件配置自动优化参数设置,通常不会出现性能问题。如果遇到问题,请参考以下解决方案: **💡 提示**: 一般情况下,启用"自动配置推理选项"后,系统会根据您的硬件配置自动优化参数设置,通常不会出现性能问题。如果遇到问题,请参考以下解决方案:
1. **CUDA内存不足** 1. **Gradio网页打开空白**
- 尝试升级gradio `pip install --upgrade gradio`
2. **CUDA内存不足**
- 启用CPU卸载 - 启用CPU卸载
- 降低分辨率 - 降低分辨率
- 启用量化选项 - 启用量化选项
2. **系统内存不足** 3. **系统内存不足**
- 启用CPU卸载 - 启用CPU卸载
- 启用延迟加载选项 - 启用延迟加载选项
- 启用量化选项 - 启用量化选项
3. **生成速度慢** 4. **生成速度慢**
- 减少推理步数 - 减少推理步数
- 启用自动配置 - 启用自动配置
- 使用轻量级模型 - 使用轻量级模型
...@@ -292,13 +299,13 @@ python gradio_demo_zh.py ^ ...@@ -292,13 +299,13 @@ python gradio_demo_zh.py ^
- 使用量化算子 - 使用量化算子
- 💾 **检查模型是否存放在SSD上** - 💾 **检查模型是否存放在SSD上**
4. **模型加载缓慢** 5. **模型加载缓慢**
- 💾 **将模型迁移到SSD存储** - 💾 **将模型迁移到SSD存储**
- 启用延迟加载选项 - 启用延迟加载选项
- 检查磁盘I/O性能 - 检查磁盘I/O性能
- 考虑使用NVMe SSD - 考虑使用NVMe SSD
5. **视频质量不佳** 6. **视频质量不佳**
- 增加推理步数 - 增加推理步数
- 提高CFG缩放因子 - 提高CFG缩放因子
- 使用14B模型 - 使用14B模型
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
#### 一键启动Gradio(推荐) #### 一键启动Gradio(推荐)
**📦 下载软件包** **📦 下载软件包**
- [百度云](https://pan.baidu.com/s/1ef3hEXyIuO0z6z9MoXe4nQ?pwd=7g4f) - [百度云](https://pan.baidu.com/s/1lLb2LYl8kbmjluaM9-jCjg?pwd=ugd4)
- [夸克网盘](https://pan.quark.cn/s/36a0cdbde7d9) - [夸克网盘](https://pan.quark.cn/s/d0b8be4bc619)
**📁 目录结构** **📁 目录结构**
解压后,确保目录结构如下: 解压后,确保目录结构如下:
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
├── start_lightx2v.bat # 一键启动脚本 ├── start_lightx2v.bat # 一键启动脚本
├── lightx2v_config.txt # 配置文件 ├── lightx2v_config.txt # 配置文件
├── LightX2V使用说明.txt # LightX2V使用说明 ├── LightX2V使用说明.txt # LightX2V使用说明
├── outputs/ # 生成的视频保存目录
└── models/ # 模型存放目录 └── models/ # 模型存放目录
├── 说明.txt # 模型说明文档 ├── 说明.txt # 模型说明文档
├── Wan2.1-I2V-14B-480P-Lightx2v/ # 图像转视频模型(480P) ├── Wan2.1-I2V-14B-480P-Lightx2v/ # 图像转视频模型(480P)
...@@ -87,7 +88,12 @@ model_cls=wan2.1 ...@@ -87,7 +88,12 @@ model_cls=wan2.1
**💡 使用建议**: 当打开Gradio Web页面后,建议勾选"自动配置推理选项",系统会自动选择合适的优化配置针对您的机器。当重新选择分辨率后,也需要重新勾选"自动配置推理选项"。 **💡 使用建议**: 当打开Gradio Web页面后,建议勾选"自动配置推理选项",系统会自动选择合适的优化配置针对您的机器。当重新选择分辨率后,也需要重新勾选"自动配置推理选项"。
**⚠️ 重要提示**: 首次运行时会自动解压环境文件 `env.zip`,此过程需要几分钟时间,请耐心等待。后续启动无需重复此步骤。您也可以手动解压 `env.zip` 文件到当前目录以节省首次启动时间。 ![Gradio中文界面](../../../../assets/figs/portabl_windows/pig_gradio_zh.png)
**⚠️ 重要提示**:
- **首次运行**: 系统会自动解压环境文件 `env.zip`,此过程需要几分钟时间,请耐心等待。后续启动无需重复此步骤。
- **加速启动**: 您也可以手动解压 `env.zip` 文件到当前目录以节省首次启动时间。
- **页面显示问题**: 如果网页打开空白或显示异常,请运行 `pip install --upgrade gradio` 升级Gradio版本。
### 方式三:使用ComfyUI推理 ### 方式三:使用ComfyUI推理
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment