Skip to content

Commit bccd723

Browse files
committed
fix example
Signed-off-by: David Chen <530634352@qq.com>
1 parent ed881c0 commit bccd723

File tree

2 files changed

+9
-21
lines changed

2 files changed

+9
-21
lines changed

examples/offline_inference/image_to_video/image_to_video.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,12 @@ def main():
219219
"rel_l1_thresh": 0.2,
220220
}
221221

222-
parallel_config = DiffusionParallelConfig(
223-
ulysses_degree=args.ulysses_degree,
224-
ring_degree=args.ring_degree,
225-
)
226-
227222
# Check if profiling is requested via environment variable
228223
profiler_enabled = bool(os.getenv("VLLM_TORCH_PROFILER_DIR"))
229224
parallel_config = DiffusionParallelConfig(
230225
cfg_parallel_size=args.cfg_parallel_size,
226+
ulysses_degree=args.ulysses_degree,
227+
ring_degree=args.ring_degree,
231228
)
232229
omni = Omni(
233230
model=args.model,
@@ -255,7 +252,12 @@ def main():
255252
print(f" Model: {args.model}")
256253
print(f" Inference steps: {args.num_inference_steps}")
257254
print(f" Frames: {args.num_frames}")
258-
print(f" Parallel configuration: cfg_parallel_size={args.cfg_parallel_size}")
255+
print(
256+
" Parallel configuration: "
257+
f"cfg_parallel_size={args.cfg_parallel_size}, "
258+
f"ulysses_degree={args.ulysses_degree}, "
259+
f"ring_degree={args.ring_degree}"
260+
)
259261
print(f" Video size: {args.width}x{args.height}")
260262
print(f"{'=' * 60}\n")
261263

examples/offline_inference/text_to_video/text_to_video.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@ def parse_args() -> argparse.Namespace:
4747
parser.add_argument(
4848
"--flow_shift", type=float, default=5.0, help="Scheduler flow_shift (5.0 for 720p, 12.0 for 480p)."
4949
)
50-
parser.add_argument(
51-
"--cache_backend",
52-
type=str,
53-
default=None,
54-
choices=["cache_dit"],
55-
help=(
56-
"Cache backend to use for acceleration. "
57-
"Options: 'cache_dit' (DBCache + SCM + TaylorSeer). "
58-
"Default: None (no cache acceleration)."
59-
),
60-
)
6150
parser.add_argument(
6251
"--enable-cache-dit-summary",
6352
action="store_true",
@@ -138,8 +127,7 @@ def parse_args() -> argparse.Namespace:
138127

139128
def main():
140129
args = parse_args()
141-
device = detect_device_type()
142-
generator = torch.Generator(device=device).manual_seed(args.seed)
130+
generator = torch.Generator(device=current_omni_platform.device_type).manual_seed(args.seed)
143131
frame_rate = args.frame_rate if args.frame_rate is not None else float(args.fps)
144132

145133
# Wan2.2 cache-dit tuning (from cache-dit examples and cache_alignment).
@@ -179,8 +167,6 @@ def main():
179167
vae_use_tiling=args.vae_use_tiling,
180168
boundary_ratio=args.boundary_ratio,
181169
flow_shift=args.flow_shift,
182-
cache_backend=args.cache_backend,
183-
cache_config=cache_config,
184170
enable_cache_dit_summary=args.enable_cache_dit_summary,
185171
enable_cpu_offload=args.enable_cpu_offload,
186172
parallel_config=parallel_config,

0 commit comments

Comments
 (0)