Skip to content
Open
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
11 changes: 8 additions & 3 deletions vace/gradios/vace_wan_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,16 @@ def generate(self, output_gallery, src_video, src_mask, src_ref_image_1, src_ref
[src_mask],
[src_ref_images],
num_frames=num_frames,
image_size=SIZE_CONFIGS[f"{output_width}*{output_height}"],
#image_size=SIZE_CONFIGS[f"{output_width}*{output_height}"],
image_size=(output_width, output_height), # 20250613 pftq: Use width/height from user input
device=self.pipe.device)
video = self.pipe.generate(
prompt,
src_video,
src_mask,
src_ref_images,
size=(output_width, output_height),
frame_num = num_frames, # 20250613 pftq: Use frame number input from user input
context_scale=context_scale,
shift=shift_scale,
sampling_steps=sample_steps,
Expand All @@ -224,8 +226,11 @@ def generate(self, output_gallery, src_video, src_mask, src_ref_image_1, src_ref
seed=infer_seed,
offload_model=True)

name = '{0:%Y%m%d%H%M%S}'.format(datetime.datetime.now())
video_path = os.path.join(self.save_dir, f'cur_gallery_{name}.mp4')
#name = '{0:%Y%m%d%H%M%S}'.format(datetime.datetime.now())
#video_path = os.path.join(self.save_dir, f'cur_gallery_{name}.mp4')
# 20250613 pftq: friendlier filenames
name = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")+f'_wan-vace_context-{context_scale}_cfg-{guide_scale}_steps-{sample_steps}_seed-{infer_seed}'
video_path = os.path.join(self.save_dir, f'{name}.mp4')
video_frames = (torch.clamp(video / 2 + 0.5, min=0.0, max=1.0).permute(1, 2, 3, 0) * 255).cpu().numpy().astype(np.uint8)

try:
Expand Down
2 changes: 1 addition & 1 deletion vace/models/wan/wan_vace.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def __init__(
def dynamic_load(self):
if hasattr(self, 'inference_pids') and self.inference_pids is not None:
return
gpu_infer = os.environ.get('LOCAL_WORLD_SIZE') or torch.cuda.device_count()
gpu_infer = int(os.environ.get('LOCAL_WORLD_SIZE', torch.cuda.device_count()))
pmi_rank = int(os.environ['RANK'])
pmi_world_size = int(os.environ['WORLD_SIZE'])
in_q_list = [torch.multiprocessing.Manager().Queue() for _ in range(gpu_infer)]
Expand Down