Commit a3d0f2d9 authored by helloyongyang's avatar helloyongyang
Browse files

update scripts

parent 26105692
...@@ -43,7 +43,7 @@ def GET_DTYPE(): ...@@ -43,7 +43,7 @@ def GET_DTYPE():
@lru_cache(maxsize=None) @lru_cache(maxsize=None)
def GET_SENSITIVE_DTYPE(): def GET_SENSITIVE_DTYPE():
RUNNING_FLAG = os.getenv("SENSITIVE_LAYER_DTYPE", None) RUNNING_FLAG = os.getenv("SENSITIVE_LAYER_DTYPE", "None")
if RUNNING_FLAG is None: if RUNNING_FLAG == "None":
return GET_DTYPE() return GET_DTYPE()
return DTYPE_MAP[RUNNING_FLAG] return DTYPE_MAP[RUNNING_FLAG]
#!/bin/bash
if [ -z "${lightx2v_path}" ]; then
echo "Error: lightx2v_path is not set. Please set this variable first."
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
# always set false to avoid some warnings
export TOKENIZERS_PARALLELISM=false
# =====================================================================================
# ⚠️ IMPORTANT CONFIGURATION PARAMETERS - READ CAREFULLY AND MODIFY WITH CAUTION ⚠️
# =====================================================================================
# Model Inference Data Type Setting (IMPORTANT!)
# Key parameter affecting model accuracy and performance
# Available options: [BF16, FP16]
# If not set, default value: BF16
export DTYPE=BF16
# Sensitive Layer Data Type Setting (IMPORTANT!)
# Used for layers requiring higher precision
# Available options: [FP32, None]
# If not set, default value: None (follows DTYPE setting)
# Note: If set to FP32, it will be slower, so we recommend set ENABLE_GRAPH_MODE to true.
export SENSITIVE_LAYER_DTYPE=FP32
# Performance Profiling Debug Mode (Debug Only)
# Enables detailed performance analysis output, such as time cost and memory usage
# Available options: [true, false]
# If not set, default value: false
# Note: This option can be set to false for production.
export ENABLE_PROFILING_DEBUG=true
# Graph Mode Optimization (Performance Enhancement)
# Enables torch.compile for graph optimization, can improve inference performance
# Available options: [true, false]
# If not set, default value: false
# Note: First run may require compilation time, subsequent runs will be faster
# Note: When you use lightx2v as a service, you can set this option to true.
export ENABLE_GRAPH_MODE=true
echo "==============================================================================="
echo "LightX2V Environment Variables Summary:"
echo "-------------------------------------------------------------------------------"
echo "lightx2v_path: ${lightx2v_path}"
echo "model_path: ${model_path}"
echo "-------------------------------------------------------------------------------"
echo "Model Inference Data Type: ${DTYPE}"
echo "Sensitive Layer Data Type: ${SENSITIVE_LAYER_DTYPE}"
echo "Performance Profiling Debug Mode: ${ENABLE_PROFILING_DEBUG}"
echo "Graph Mode Optimization: ${ENABLE_GRAPH_MODE}"
echo "==============================================================================="
...@@ -4,29 +4,10 @@ ...@@ -4,29 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export DTYPE=BF16
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
python -m lightx2v.infer \ python -m lightx2v.infer \
--model_cls wan2.1 \ --model_cls wan2.1 \
......
...@@ -4,29 +4,10 @@ ...@@ -4,29 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export DTYPE=BF16
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
python -m lightx2v.infer \ python -m lightx2v.infer \
--model_cls wan2.1 \ --model_cls wan2.1 \
......
...@@ -4,30 +4,10 @@ ...@@ -4,30 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
export DTYPE=BF16 # remove this can get high quality video
python -m lightx2v.infer \ python -m lightx2v.infer \
--model_cls wan2.1 \ --model_cls wan2.1 \
......
...@@ -4,29 +4,10 @@ ...@@ -4,29 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export DTYPE=BF16
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
python -m lightx2v.infer \ python -m lightx2v.infer \
--model_cls wan2.1 \ --model_cls wan2.1 \
......
...@@ -4,29 +4,10 @@ ...@@ -4,29 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0,1
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0,1
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export DTYPE=BF16
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
torchrun --nproc_per_node=2 -m lightx2v.infer \ torchrun --nproc_per_node=2 -m lightx2v.infer \
--model_cls wan2.2_moe \ --model_cls wan2.2_moe \
......
...@@ -4,30 +4,10 @@ ...@@ -4,30 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0,1,2,3,4,5,6,7
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export DTYPE=BF16
export SENSITIVE_LAYER_DTYPE=FP32
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
torchrun --nproc_per_node=8 -m lightx2v.infer \ torchrun --nproc_per_node=8 -m lightx2v.infer \
--model_cls wan2.2_moe \ --model_cls wan2.2_moe \
......
...@@ -4,29 +4,10 @@ ...@@ -4,29 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0,1,2,3
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0,1,2,3
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export DTYPE=BF16
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
torchrun --nproc_per_node=4 -m lightx2v.infer \ torchrun --nproc_per_node=4 -m lightx2v.infer \
--model_cls wan2.2_moe \ --model_cls wan2.2_moe \
......
...@@ -4,29 +4,10 @@ ...@@ -4,29 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0,1,2,3,4,5,6,7
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export DTYPE=BF16
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
torchrun --nproc_per_node=8 -m lightx2v.infer \ torchrun --nproc_per_node=8 -m lightx2v.infer \
--model_cls wan2.1 \ --model_cls wan2.1 \
......
...@@ -4,29 +4,10 @@ ...@@ -4,29 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0,1,2,3
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0,1,2,3
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export DTYPE=BF16
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
torchrun --nproc_per_node=4 -m lightx2v.infer \ torchrun --nproc_per_node=4 -m lightx2v.infer \
--model_cls wan2.1 \ --model_cls wan2.1 \
......
...@@ -4,29 +4,10 @@ ...@@ -4,29 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0,1,2,3
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0,1,2,3
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export DTYPE=BF16
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
torchrun --nproc_per_node=4 -m lightx2v.infer \ torchrun --nproc_per_node=4 -m lightx2v.infer \
--model_cls wan2.1 \ --model_cls wan2.1 \
......
...@@ -4,29 +4,10 @@ ...@@ -4,29 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0,1
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0,1,2,3,4,5,6,7
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export DTYPE=BF16
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
torchrun --nproc_per_node=2 -m lightx2v.infer \ torchrun --nproc_per_node=2 -m lightx2v.infer \
--model_cls wan2.1 \ --model_cls wan2.1 \
......
...@@ -4,29 +4,10 @@ ...@@ -4,29 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0,1,2,3,4,5,6,7
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export DTYPE=BF16
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
torchrun --nproc_per_node=8 -m lightx2v.infer \ torchrun --nproc_per_node=8 -m lightx2v.infer \
--model_cls wan2.1 \ --model_cls wan2.1 \
......
...@@ -4,29 +4,10 @@ ...@@ -4,29 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0,1,2,3
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0,1,2,3
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export DTYPE=BF16
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
torchrun --nproc_per_node=4 -m lightx2v.infer \ torchrun --nproc_per_node=4 -m lightx2v.infer \
--model_cls wan2.1 \ --model_cls wan2.1 \
......
...@@ -4,29 +4,10 @@ ...@@ -4,29 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0,1,2,3
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0,1,2,3
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export DTYPE=BF16
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
torchrun --nproc_per_node=4 -m lightx2v.infer \ torchrun --nproc_per_node=4 -m lightx2v.infer \
--model_cls wan2.1 \ --model_cls wan2.1 \
......
...@@ -4,30 +4,10 @@ ...@@ -4,30 +4,10 @@
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
export DTYPE=BF16 # remove this can get high quality video
python -m lightx2v.infer \ python -m lightx2v.infer \
--model_cls wan2.1 \ --model_cls wan2.1 \
......
#!/bin/bash #!/bin/bash
# Default values # set path and first
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0,1,2,3,4,5,6,7
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${num_gpus}" ]; then # set environment variables
num_gpus=8 source ${lightx2v_path}/scripts/base/base.sh
fi
# Check required parameters
if [ -z "${lightx2v_path}" ]; then
echo "Error: lightx2v_path is not set. Please set this variable first."
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
# Set environment variables
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
export DTYPE=BF16
# Start multiple servers # Start multiple servers
python -m lightx2v.api_multi_servers \ python -m lightx2v.api_multi_servers \
......
#!/bin/bash #!/bin/bash
# Set paths # set path and first
lightx2v_path="/data/lightx2v-dev/" lightx2v_path=
model_path="/data/lightx2v-dev/Wan2.1-I2V-14B-480P/" model_path=
# Check parameters export CUDA_VISIBLE_DEVICES=0
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}"
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then # set environment variables
echo "Error: lightx2v_path is not set. Please set this variable first." source ${lightx2v_path}/scripts/base/base.sh
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
# Set environment variables
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
export DTYPE=BF16
echo "=========================================="
echo "Starting distributed inference API server"
echo "Model path: $model_path"
echo "CUDA devices: $CUDA_VISIBLE_DEVICES"
echo "API port: 8000"
echo "=========================================="
# Start API server with distributed inference service # Start API server with distributed inference service
python -m lightx2v.api_server \ python -m lightx2v.api_server \
......
#!/bin/bash #!/bin/bash
# Video Frame Interpolation Example Script for WAN T2V
# This script demonstrates how to use RIFE frame interpolation with LightX2V
# VFI is enabled through configuration file, not command line parameters
# set path and first # set path and first
lightx2v_path= lightx2v_path=
model_path= model_path=
# check section export CUDA_VISIBLE_DEVICES=0
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
cuda_devices=0
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then
echo "Error: lightx2v_path is not set. Please set this variable first."
exit 1
fi
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export TOKENIZERS_PARALLELISM=false # set environment variables
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH source ${lightx2v_path}/scripts/base/base.sh
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
export DTYPE=BF16 # remove this can get high quality video
# Run inference with VFI enabled through config file # Run inference with VFI enabled through config file
# The wan_t2v.json config contains video_frame_interpolation settings # The wan_t2v.json config contains video_frame_interpolation settings
......
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