stream_save_video for infinitetalk#1204
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the single-GPU inference script and introduces a new multi-GPU inference script for InfiniteTalk. The feedback highlights several critical improvements: first, the new multi-GPU script incorrectly restricts execution to a single GPU (CUDA_VISIBLE_DEVICES=7) despite using an 8-GPU configuration; second, both scripts contain hardcoded, user-specific absolute paths that should be replaced with portable environment variables; and third, variable expansions and string arguments in the shell scripts should be double-quoted to prevent word splitting and globbing issues.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| lightx2v_path=/data/nvme4/gushiqiao/new/debug/LightX2V | ||
| model_path=/data/nvme5/gushiqiao/models/InfiniteTalk | ||
|
|
||
| export CUDA_VISIBLE_DEVICES=7 |
There was a problem hiding this comment.
The configuration file infinitetalk_single_distilled_8gpus.json suggests an 8-GPU setup, but CUDA_VISIBLE_DEVICES is set to 7, which restricts execution to a single GPU. Consider setting it to 0,1,2,3,4,5,6,7 or removing/commenting it out to allow multi-GPU execution.
| export CUDA_VISIBLE_DEVICES=7 | |
| export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 |
| lightx2v_path=/data/nvme4/gushiqiao/new/debug/LightX2V | ||
| model_path=/data/nvme5/gushiqiao/models/InfiniteTalk |
There was a problem hiding this comment.
Avoid committing hardcoded, user-specific absolute paths (e.g., containing /gushiqiao/) to the repository, as this breaks portability for other users and environments. Instead, use placeholder paths or allow them to be overridden by environment variables if already set.
| lightx2v_path=/data/nvme4/gushiqiao/new/debug/LightX2V | |
| model_path=/data/nvme5/gushiqiao/models/InfiniteTalk | |
| lightx2v_path=${LIGHTX2V_PATH:-"/path/to/LightX2V"} | |
| model_path=${MODEL_PATH:-"/path/to/InfiniteTalk"} |
| --task s2v \ | ||
| --model_path $model_path \ | ||
| --config_json ${lightx2v_path}/configs/infinitetalk/fp8/infinitetalk_single_distilled.json \ | ||
| --config_json ${lightx2v_path}/configs/infinitetalk/h100/infinitetalk_single_distilled.json \ |
There was a problem hiding this comment.
Double-quote variable expansions in shell scripts to prevent word splitting and globbing issues if the path contains spaces.
| --config_json ${lightx2v_path}/configs/infinitetalk/h100/infinitetalk_single_distilled.json \ | |
| --config_json "${lightx2v_path}/configs/infinitetalk/h100/infinitetalk_single_distilled.json" \ |
| lightx2v_path=/data/nvme4/gushiqiao/new/debug/LightX2V | ||
| model_path=/data/nvme5/gushiqiao/models/InfiniteTalk |
There was a problem hiding this comment.
Avoid committing hardcoded, user-specific absolute paths (e.g., containing /gushiqiao/) to the repository, as this breaks portability for other users and environments. Instead, use placeholder paths or allow them to be overridden by environment variables if already set.
| lightx2v_path=/data/nvme4/gushiqiao/new/debug/LightX2V | |
| model_path=/data/nvme5/gushiqiao/models/InfiniteTalk | |
| lightx2v_path=${LIGHTX2V_PATH:-"/path/to/LightX2V"} | |
| model_path=${MODEL_PATH:-"/path/to/InfiniteTalk"} |
| source ${lightx2v_path}/scripts/base/base.sh | ||
|
|
||
| python -m lightx2v.infer \ | ||
| --model_cls infinitetalk \ | ||
| --task s2v \ | ||
| --model_path $model_path \ | ||
| --config_json ${lightx2v_path}/configs/infinitetalk/5090/infinitetalk_single_distilled_8gpus.json \ | ||
| --prompt "让角色根据音频内容自然说话" \ | ||
| --negative_prompt 色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走 \ | ||
| --image_path /data/nvme5/gushiqiao/cases/wecom-temp-3950334-bfa56035a08485356431b5a1c5c28a82.png \ | ||
| --audio_path ${lightx2v_path}/assets/inputs/audio/seko_input.mp3 \ | ||
| --save_result_path ${lightx2v_path}/save_results/infinitetalk_single_720p_dist_8gpus.mp4 \ | ||
| --seed 42 |
There was a problem hiding this comment.
Double-quote all variable expansions and string arguments in the shell script to prevent word splitting and globbing issues (especially if paths contain spaces). Additionally, avoid hardcoding user-specific absolute paths like /data/nvme5/gushiqiao/... for --image_path; use a placeholder path instead.
| source ${lightx2v_path}/scripts/base/base.sh | |
| python -m lightx2v.infer \ | |
| --model_cls infinitetalk \ | |
| --task s2v \ | |
| --model_path $model_path \ | |
| --config_json ${lightx2v_path}/configs/infinitetalk/5090/infinitetalk_single_distilled_8gpus.json \ | |
| --prompt "让角色根据音频内容自然说话" \ | |
| --negative_prompt 色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走 \ | |
| --image_path /data/nvme5/gushiqiao/cases/wecom-temp-3950334-bfa56035a08485356431b5a1c5c28a82.png \ | |
| --audio_path ${lightx2v_path}/assets/inputs/audio/seko_input.mp3 \ | |
| --save_result_path ${lightx2v_path}/save_results/infinitetalk_single_720p_dist_8gpus.mp4 \ | |
| --seed 42 | |
| source "${lightx2v_path}/scripts/base/base.sh" | |
| python -m lightx2v.infer \ | |
| --model_cls infinitetalk \ | |
| --task s2v \ | |
| --model_path "$model_path" \ | |
| --config_json "${lightx2v_path}/configs/infinitetalk/5090/infinitetalk_single_distilled_8gpus.json" \ | |
| --prompt "让角色根据音频内容自然说话" \ | |
| --negative_prompt "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" \ | |
| --image_path "/path/to/your/image.png" \ | |
| --audio_path "${lightx2v_path}/assets/inputs/audio/seko_input.mp3" \ | |
| --save_result_path "${lightx2v_path}/save_results/infinitetalk_single_720p_dist_8gpus.mp4" \ | |
| --seed 42 |
No description provided.