Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions examples/neopp/neopp_dense_2k.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

pipe.generate(
seed=200,
save_result_path="/data/nvme1/yongyang/FL/LightX2V/save_results/output_lightx2v_neopp_dense_2k_0.png",
save_result_path="/data/nvme1/yongyang/kkk/LightX2V/save_results/output_lightx2v_neopp_dense_2k_0.png",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding absolute paths that include personal user directories (e.g., /yongyang/kkk/) makes the example less portable and harder for others to use. Consider using relative paths or environment variables for output directories.

target_shape=[2048, 2048], # Height, Width
)

Expand All @@ -58,8 +58,8 @@
)

pipe.generate(
seed=201,
save_result_path="/data/nvme1/yongyang/FL/LightX2V/save_results/output_lightx2v_neopp_dense_2k_1.png",
seed=None,
save_result_path="/data/nvme1/yongyang/kkk/LightX2V/save_results/output_lightx2v_neopp_dense_2k_1.png",
target_shape=[2048, 2048], # Height, Width
)

Expand All @@ -81,7 +81,7 @@
)

pipe.generate(
seed=202,
save_result_path="/data/nvme1/yongyang/FL/LightX2V/save_results/output_lightx2v_neopp_dense_2k_2.png",
seed=None,
save_result_path="/data/nvme1/yongyang/kkk/LightX2V/save_results/output_lightx2v_neopp_dense_2k_2.png",
target_shape=[2048, 2048], # Height, Width
)
10 changes: 8 additions & 2 deletions lightx2v/models/runners/wan/wan_matrix_game3_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@
from diffusers.utils import deprecate
from einops import rearrange
from loguru import logger
from scipy.interpolate import interp1d
from scipy.spatial.transform import Rotation, Slerp

try:
from scipy.interpolate import interp1d
from scipy.spatial.transform import Rotation, Slerp
except ImportError:
interp1d = None
Rotation = None
Slerp = None
Comment on lines +18 to +24
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Wrapping these imports in a try-except block without corresponding checks in the functions that use them (e.g., _matrix_game3_interpolate_camera_poses) will lead to a TypeError at runtime if scipy is missing. If scipy is an optional dependency, please add checks to provide a more helpful error message when these features are accessed.


from lightx2v.models.runners.wan.wan_runner import Wan22DenseRunner, build_wan_model_with_lora
from lightx2v.models.schedulers.scheduler import BaseScheduler
Expand Down
3 changes: 2 additions & 1 deletion lightx2v/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ def generate(
self.modify_config({"task": self.task})

input_info = init_empty_input_info(self.task, self.support_tasks)
seed_all(self.seed)
if self.seed is not None:
seed_all(self.seed)
Comment on lines +463 to +464
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Setting self.seed to None and skipping seed_all will result in input_info.seed being None. This will cause a crash in runners that use torch.manual_seed(input_info.seed) (such as WanMatrixGame3Runner at line 1624). It is better to initialize self.seed with a random integer if it is None to ensure downstream compatibility.

Suggested change
if self.seed is not None:
seed_all(self.seed)
if self.seed is None:
self.seed = torch.randint(0, 2**32, (1,)).item()
seed_all(self.seed)

update_input_info_from_dict(input_info, self)
gen_result = self.runner.run_pipeline(input_info)
logger.info("Generated successfully!")
Expand Down
Loading