Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xuwx1
LightX2V
Commits
a843121d
Commit
a843121d
authored
Apr 08, 2025
by
zhiwei.dong
Committed by
Yang Yong(雍洋)
Apr 08, 2025
Browse files
[format]: remove hard-coded path variable,refine shell
parent
b878b073
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
152 additions
and
35 deletions
+152
-35
examples/vae_trt/convert_trt.sh
examples/vae_trt/convert_trt.sh
+4
-2
examples/vae_trt/run.sh
examples/vae_trt/run.sh
+0
-0
lightx2v/attentions/distributed/ring/tests/test.sh
lightx2v/attentions/distributed/ring/tests/test.sh
+2
-1
lightx2v/text2v/models/text_encoders/hf/clip/model.py
lightx2v/text2v/models/text_encoders/hf/clip/model.py
+2
-1
lightx2v/text2v/models/text_encoders/hf/llama/model.py
lightx2v/text2v/models/text_encoders/hf/llama/model.py
+2
-1
lightx2v/text2v/models/text_encoders/hf/t5/model.py
lightx2v/text2v/models/text_encoders/hf/t5/model.py
+1
-1
lightx2v/text2v/models/video_encoders/hf/autoencoder_kl_causal_3d/model.py
...odels/video_encoders/hf/autoencoder_kl_causal_3d/model.py
+2
-1
lightx2v/text2v/models/video_encoders/trt/autoencoder_kl_causal_3d/model.py
...dels/video_encoders/trt/autoencoder_kl_causal_3d/model.py
+2
-1
scripts/run_hunyuan_t2v.sh
scripts/run_hunyuan_t2v.sh
+19
-4
scripts/run_hunyuan_t2v_dist.sh
scripts/run_hunyuan_t2v_dist.sh
+20
-4
scripts/run_hunyuan_t2v_taylorseer.sh
scripts/run_hunyuan_t2v_taylorseer.sh
+20
-4
scripts/run_wan_i2v.sh
scripts/run_wan_i2v.sh
+26
-5
scripts/run_wan_t2v.sh
scripts/run_wan_t2v.sh
+26
-5
scripts/run_wan_t2v_dist.sh
scripts/run_wan_t2v_dist.sh
+26
-5
No files found.
examples/vae_trt/convert_trt.sh
View file @
a843121d
#!/bin/bash
export
PYTHONPATH
=
"./"
:
$PYTHONPATH
# onnx_path=""
# trtexec \
# --onnx=
"/mnt/nvme0/wq/project/sd/code/lightx2v/vae_decoder_hf_sim.onnx"
\
# --onnx=
${onnx_path}
\
# --saveEngine="./vae_decoder_hf_sim.engine" \
# --allowWeightStreaming \
# --stronglyTyped \
...
...
@@ -11,4 +12,5 @@ export PYTHONPATH="./":$PYTHONPATH
# --optShapes=inp:1x16x17x32x16 \
# --maxShapes=inp:1x16x17x32x32
python examples/vae_trt/convert_vae_trt_engine.py
--model_path
"/mnt/nvme1/yongyang/models/hy/ckpts"
model_path
=
""
python examples/vae_trt/convert_vae_trt_engine.py
--model_path
${
model_path
}
examples/vae_trt/run.sh
deleted
100644 → 0
View file @
b878b073
lightx2v/attentions/distributed/ring/tests/test.sh
View file @
a843121d
export
PYTHONPATH
=
/home/devsft/huangxinchi/lightx2v:
$PYTHONPATH
lightx2v_path
=
""
export
PYTHONPATH
=
${
lightx2v_path
}
:
$PYTHONPATH
python3 test.py
lightx2v/text2v/models/text_encoders/hf/clip/model.py
View file @
a843121d
...
...
@@ -50,7 +50,8 @@ class TextEncoderHFClipModel:
if
__name__
==
"__main__"
:
model
=
TextEncoderHFClipModel
(
"/mnt/nvme0/yongyang/projects/hy/HunyuanVideo/ckpts/text_encoder_2"
,
torch
.
device
(
"cuda"
))
model_path
=
""
model
=
TextEncoderHFClipModel
(
model_path
,
torch
.
device
(
"cuda"
))
text
=
"A cat walks on the grass, realistic style."
outputs
=
model
.
infer
(
text
)
print
(
outputs
)
lightx2v/text2v/models/text_encoders/hf/llama/model.py
View file @
a843121d
...
...
@@ -63,7 +63,8 @@ class TextEncoderHFLlamaModel:
if
__name__
==
"__main__"
:
model
=
TextEncoderHFLlamaModel
(
"/mnt/nvme0/yongyang/projects/hy/HunyuanVideo/ckpts/text_encoder"
,
torch
.
device
(
"cuda"
))
model_path
=
""
model
=
TextEncoderHFLlamaModel
(
model_path
,
torch
.
device
(
"cuda"
))
text
=
"A cat walks on the grass, realistic style."
outputs
=
model
.
infer
(
text
)
print
(
outputs
)
lightx2v/text2v/models/text_encoders/hf/t5/model.py
View file @
a843121d
...
...
@@ -509,7 +509,7 @@ class T5EncoderModel:
if
__name__
==
"__main__"
:
checkpoint_dir
=
"
/mnt/nvme0/yongyang/projects/wan/Wan2.1-T2V-1.3B
"
checkpoint_dir
=
""
t5_checkpoint
=
"models_t5_umt5-xxl-enc-bf16.pth"
t5_tokenizer
=
"google/umt5-xxl"
model
=
T5EncoderModel
(
...
...
lightx2v/text2v/models/video_encoders/hf/autoencoder_kl_causal_3d/model.py
View file @
a843121d
...
...
@@ -41,4 +41,5 @@ class VideoEncoderKLCausal3DModel:
if
__name__
==
"__main__"
:
vae_model
=
VideoEncoderKLCausal3DModel
(
"/mnt/nvme0/yongyang/projects/hy/new/HunyuanVideo/ckpts"
,
dtype
=
torch
.
float16
,
device
=
torch
.
device
(
"cuda"
))
model_path
=
""
vae_model
=
VideoEncoderKLCausal3DModel
(
model_path
,
dtype
=
torch
.
float16
,
device
=
torch
.
device
(
"cuda"
))
lightx2v/text2v/models/video_encoders/trt/autoencoder_kl_causal_3d/model.py
View file @
a843121d
...
...
@@ -35,4 +35,5 @@ class VideoEncoderKLCausal3DModel:
if
__name__
==
"__main__"
:
vae_model
=
VideoEncoderKLCausal3DModel
(
"/mnt/nvme1/yongyang/models/hy/ckpts"
,
dtype
=
torch
.
float16
,
device
=
torch
.
device
(
"cuda"
))
model_path
=
""
vae_model
=
VideoEncoderKLCausal3DModel
(
model_path
,
dtype
=
torch
.
float16
,
device
=
torch
.
device
(
"cuda"
))
scripts/run_hunyuan_t2v.sh
View file @
a843121d
#!/bin/bash
lightx2v_path
=
/mtc/yongyang/projects/lightx2v
export
PYTHONPATH
=
${
lightx2v_path
}
:
$PYTHONPATH
# set path and first
lightx2v_path
=
""
model_path
=
""
# check section
if
[
-z
"
${
CUDA_VISIBLE_DEVICES
}
"
]
;
then
echo
"Warn: CUDA_VISIBLE_DEVICES is not set, using defalt value: 0, change at shell script or set env variable."
cuda_devices
=
"0"
export
CUDA_VISIBLE_DEVICES
=
${
cuda_devices
}
fi
export
CUDA_VISIBLE_DEVICES
=
2
if
[
-z
"
${
lightx2v_path
}
"
]
;
then
echo
"Error: lightx2v_path is not set. Please set this variable first."
exit
1
fi
model_path
=
/mtc/yongyang/models/x2v_models/hunyuan/lightx2v_format/t2v
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
python
${
lightx2v_path
}
/lightx2v/__main__.py
\
--model_cls
hunyuan
\
...
...
scripts/run_hunyuan_t2v_dist.sh
View file @
a843121d
#!/bin/bash
lightx2v_path
=
/home/devsft/huangxinchi/lightx2v
export
PYTHONPATH
=
${
lightx2v_path
}
:
$PYTHONPATH
# set path and first
lightx2v_path
=
""
model_path
=
""
# check section
if
[
-z
"
${
CUDA_VISIBLE_DEVICES
}
"
]
;
then
echo
"Warn: CUDA_VISIBLE_DEVICES is not set, using defalt value: 0,1,2,3, change at shell script or set env variable."
cuda_devices
=
"0,1,2,3"
export
CUDA_VISIBLE_DEVICES
=
${
cuda_devices
}
fi
export
CUDA_VISIBLE_DEVICES
=
4,5,6,7
if
[
-z
"
${
lightx2v_path
}
"
]
;
then
echo
"Error: lightx2v_path is not set. Please set this variable first."
exit
1
fi
model_path
=
/mtc/yongyang/models/x2v_models/hunyuan/lightx2v_format/t2v
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
torchrun
--nproc_per_node
=
4
${
lightx2v_path
}
/lightx2v/__main__.py
\
...
...
scripts/run_hunyuan_t2v_taylorseer.sh
View file @
a843121d
#!/bin/bash
lightx2v_path
=
/mtc/yongyang/projects/lightx2v
export
PYTHONPATH
=
${
lightx2v_path
}
:
$PYTHONPATH
# set path and first
lightx2v_path
=
""
model_path
=
""
# check section
if
[
-z
"
${
CUDA_VISIBLE_DEVICES
}
"
]
;
then
echo
"Warn: CUDA_VISIBLE_DEVICES is not set, using defalt value: 0, change at shell script or set env variable."
cuda_devices
=
"0"
export
CUDA_VISIBLE_DEVICES
=
${
cuda_devices
}
fi
export
CUDA_VISIBLE_DEVICES
=
2
if
[
-z
"
${
lightx2v_path
}
"
]
;
then
echo
"Error: lightx2v_path is not set. Please set this variable first."
exit
1
fi
model_path
=
/mtc/yongyang/models/x2v_models/hunyuan/lightx2v_format/t2v
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
python
${
lightx2v_path
}
/lightx2v/__main__.py
\
...
...
scripts/run_wan_i2v.sh
View file @
a843121d
#!/bin/bash
lightx2v_path
=
/mtc/yongyang/projects/lightx2v
export
PYTHONPATH
=
${
lightx2v_path
}
:
$PYTHONPATH
# set path and first
lightx2v_path
=
""
model_path
=
""
config_path
=
""
# check section
if
[
-z
"
${
CUDA_VISIBLE_DEVICES
}
"
]
;
then
echo
"Warn: CUDA_VISIBLE_DEVICES is not set, using defalt value: 0, change at shell script or set env variable."
cuda_devices
=
"0"
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
export
CUDA_VISIBLE_DEVICES
=
2
if
[
-z
"
${
model_path
}
"
]
;
then
echo
"Error: model_path is not set. Please set this variable first."
exit
1
fi
model_path
=
/mtc/yongyang/models/x2v_models/wan/Wan2.1-I2V-14B-480P
config_path
=
/mtc/yongyang/models/x2v_models/wan/Wan2.1-I2V-14B-480P/config.json
if
[
-z
"
${
config_path
}
"
]
;
then
echo
"Error: config_path is not set. Please set this variable first."
exit
1
fi
export
PYTHONPATH
=
${
lightx2v_path
}
:
$PYTHONPATH
python
${
lightx2v_path
}
/lightx2v/__main__.py
\
...
...
scripts/run_wan_t2v.sh
View file @
a843121d
#!/bin/bash
lightx2v_path
=
/mtc/yongyang/projects/lightx2v
export
PYTHONPATH
=
${
lightx2v_path
}
:
$PYTHONPATH
# set path and first
lightx2v_path
=
""
model_path
=
""
config_path
=
""
# check section
if
[
-z
"
${
CUDA_VISIBLE_DEVICES
}
"
]
;
then
echo
"Warn: CUDA_VISIBLE_DEVICES is not set, using defalt value: 0, change at shell script or set env variable."
cuda_devices
=
"0"
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
export
CUDA_VISIBLE_DEVICES
=
2
if
[
-z
"
${
model_path
}
"
]
;
then
echo
"Error: model_path is not set. Please set this variable first."
exit
1
fi
model_path
=
/mtc/yongyang/models/x2v_models/wan/Wan2.1-T2V-1.3B
config_path
=
/mtc/yongyang/models/x2v_models/wan/Wan2.1-T2V-1.3B/config.json
if
[
-z
"
${
config_path
}
"
]
;
then
echo
"Error: config_path is not set. Please set this variable first."
exit
1
fi
export
PYTHONPATH
=
${
lightx2v_path
}
:
$PYTHONPATH
python
${
lightx2v_path
}
/lightx2v/__main__.py
\
...
...
scripts/run_wan_t2v_dist.sh
View file @
a843121d
#!/bin/bash
lightx2v_path
=
/home/devsft/huangxinchi/lightx2v
export
PYTHONPATH
=
${
lightx2v_path
}
:
$PYTHONPATH
# set path and first
lightx2v_path
=
""
model_path
=
""
config_path
=
""
# check section
if
[
-z
"
${
CUDA_VISIBLE_DEVICES
}
"
]
;
then
echo
"Warn: CUDA_VISIBLE_DEVICES is not set, using defalt value: 0,1,2,3 , change at shell script or set env variable."
cuda_devices
=
"0,1,2,3"
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
export
CUDA_VISIBLE_DEVICES
=
4,5,6,7
if
[
-z
"
${
model_path
}
"
]
;
then
echo
"Error: model_path is not set. Please set this variable first."
exit
1
fi
model_path
=
/mtc/yongyang/models/x2v_models/wan/Wan2.1-T2V-1.3B
config_path
=
/mtc/yongyang/models/x2v_models/wan/Wan2.1-T2V-1.3B/config.json
if
[
-z
"
${
config_path
}
"
]
;
then
echo
"Error: config_path is not set. Please set this variable first."
exit
1
fi
export
PYTHONPATH
=
${
lightx2v_path
}
:
$PYTHONPATH
torchrun
--nproc_per_node
=
4
${
lightx2v_path
}
/lightx2v/__main__.py
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment