ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Support is required to run wan2.1 on the Ascend NPU.

Open WooXinyi opened this issue 10 months ago • 4 comments

Feature Idea

Support is required to enable the operation of wan2.1 on the Ascend NPU.

Existing Solutions

No response

Other

No response

WooXinyi avatar Mar 19 '25 03:03 WooXinyi

The basic functionalities of ComfyUI, such as running Stable Diffusion, already work on Ascend. Did you see any error when running Wan?

woct0rdho avatar Mar 20 '25 01:03 woct0rdho

Yes, wan2.1 encounters an error when using the uni_pc sampler. Switching to the euler sampler does not result in an error, but it generates completely black images.

WooXinyi avatar Mar 20 '25 06:03 WooXinyi

The basic functionalities of ComfyUI, such as running Stable Diffusion, already work on Ascend. Did you see any error when running Wan?

I use the official sample workflow, 480 model, reported the following error, hope to get your advice, thank you first! 我用的是官方的示例工作流,480的模型,报如下错,希望得到你的指点,先谢为敬!

o see the GUI go to: http://127.0.0.1:8188 127.0.0.1: Client protocols [''] don’t overlap server-known ones () got prompt Using pytorch attention in VAE Using pytorch attention in VAE VAE load device: npu:0, offload device: cpu, dtype: torch.bfloat16 Requested to load CLIPVisionModelProjection loaded completely 60916.70234375 1208.09814453125 True CLIP/text encoder model load device: npu:0, offload device: cpu, current: cpu, dtype: torch.float16 127.0.0.1: Client protocols [''] don’t overlap server-known ones () Requested to load WanTEModel loaded completely 59657.76875 10835.4765625 True Requested to load WanVAE loaded completely 46630.3974609375 242.02829551696777 True /home/ma-user/work/ComfyUI/comfy/ldm/wan/vae.py:209: UserWarning: current tensor is running as_strided, don't perform inplace operations on the returned value. If you encounter this warning and have precision issues, you can try torch.npu.config.allow_internal_format = False to resolve precision issues. (Triggered internally at build/CMakeFiles/torch_npu.dir/compiler_depend.ts:123.) feat_cache[idx][:, :, -1, :, :].unsqueeze(2).to( 127.0.0.1: Client protocols [''] don’t overlap server-known ones () /home/ma-user/work/ComfyUI/custom_nodes/ComfyUI-GGUF/loader.py:91: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:206.) torch_tensor = torch.from_numpy(tensor.data) # mmap model weight dtype torch.float16, manual cast: None model_type FLOW Requested to load WAN21 127.0.0.1: Client protocols [''] don’t overlap server-known ones () 127.0.0.1: Client protocols [''] don’t overlap server-known ones () 127.0.0.1: Client protocols [''] don’t overlap server-known ones () 127.0.0.1: Client protocols [''] don’t overlap server-known ones () loaded completely 46230.6442546875 31734.013916015625 True [ComfyUI-Easy-Use] server: v1.2.8 Loaded [ComfyUI-Easy-Use] web root: /home/ma-user/work/ComfyUI/custom_nodes/ComfyUI-Easy-Use/web_version/v2 Loaded gguf qtypes: F32 (823), F16 (480) 0%| | 0/20 [00:00<?, ?it/s][W404 21:26:55.710019296 compiler_depend.ts:387] Warning: EZ3002: 2025-04-04-21:26:55.052.111 Optype [Conv3D] of Ops kernel [AIcoreEngine] is unsupported. Reason: [tbe-custom]:op type Conv3D is not found in this op store.[tbe-custom]:op type Conv3D is not found in this op store.[Dynamic shape check]: data type DT_FLOAT of input [x] is not supported. All supported data type and format of tensor input0.x is: Data Type: {DT_FLOAT16,DT_INT8,DT_BFLOAT16}Format:{NDC1HWC0,NDC1HWC0,NDC1HWC0}. Possible Cause: The operator type is unsupported in the operator information library due to specification mismatch. Solution: Submit an issue to request for support at https://gitee.com/ascend, or remove this type of operators from your model. TraceBack (most recent call last): No supported Ops kernel and engine are found for [Conv3D81], optype [Conv3D]. Assert ((SelectEngine(node_ptr, exclude_engines, is_check_support_success, op_info)) == ge::SUCCESS) failed[FUNC:operator()][FILE:engine_place.cc][LINE:144] build graph failed, graph id:80, ret:-1[FUNC:BuildModelWithGraphId][FILE:ge_generator.cc][LINE:1608] [Build][SingleOpModel]call ge interface generator.BuildSingleOpModel failed. ge result = 4294967295[FUNC:ReportCallError][FILE:log_inner.cpp][LINE:161] [Build][Op]Fail to build op model[FUNC:ReportInnerError][FILE:log_inner.cpp][LINE:145] build op model failed, result = 500002[FUNC:ReportInnerError][FILE:log_inner.cpp][LINE:145] (function ExecFunc) 0%| | 0/20 [00:00<?, ?it/s] !!! Exception during processing !!! The Inner error is reported as above. The process exits for this inner error, and the current working operator name is Conv3D. Since the operator is called asynchronously, the stacktrace may be inaccurate. If you want to get the accurate stacktrace, pleace set the environment variable ASCEND_LAUNCH_BLOCKING=1. [ERROR] 2025-04-04-21:26:55 (PID:1310, Device:0, RankID:-1) ERR00100 PTA call acl api failed Traceback (most recent call last): File "/home/ma-user/work/ComfyUI/execution.py", line 327, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "/home/ma-user/work/ComfyUI/execution.py", line 202, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "/home/ma-user/work/ComfyUI/execution.py", line 174, in _map_node_over_list process_inputs(input_dict, i) File "/home/ma-user/work/ComfyUI/execution.py", line 163, in process_inputs results.append(getattr(obj, func)(**inputs)) File "/home/ma-user/work/ComfyUI/nodes.py", line 1543, in sample return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise) File "/home/ma-user/work/ComfyUI/nodes.py", line 1510, in common_ksampler samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, File "/home/ma-user/work/ComfyUI/comfy/sample.py", line 45, in sample samples = sampler.sample(noise, positive, negative, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed) File "/home/ma-user/work/ComfyUI/comfy/samplers.py", line 1133, in sample return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed) File "/home/ma-user/work/ComfyUI/comfy/samplers.py", line 1023, in sample return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) File "/home/ma-user/work/ComfyUI/comfy/samplers.py", line 1008, in sample output = executor.execute(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) File "/home/ma-user/work/ComfyUI/comfy/patcher_extension.py", line 110, in execute return self.original(*args, **kwargs) File "/home/ma-user/work/ComfyUI/comfy/samplers.py", line 976, in outer_sample output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) File "/home/ma-user/work/ComfyUI/comfy/samplers.py", line 959, in inner_sample samples = executor.execute(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar) File "/home/ma-user/work/ComfyUI/comfy/patcher_extension.py", line 110, in execute return self.original(*args, **kwargs) File "/home/ma-user/work/ComfyUI/comfy/samplers.py", line 738, in sample samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options) File "/home/ma-user/work/ComfyUI/comfy/extra_samplers/uni_pc.py", line 868, in sample_unipc x = uni_pc.sample(noise, timesteps=timesteps, skip_type="time_uniform", method="multistep", order=order, lower_order_final=True, callback=callback, disable_pbar=disable) File "/home/ma-user/work/ComfyUI/comfy/extra_samplers/uni_pc.py", line 715, in sample model_prev_list = [self.model_fn(x, vec_t)] File "/home/ma-user/work/ComfyUI/comfy/extra_samplers/uni_pc.py", line 410, in model_fn return self.data_prediction_fn(x, t) File "/home/ma-user/work/ComfyUI/comfy/extra_samplers/uni_pc.py", line 394, in data_prediction_fn noise = self.noise_prediction_fn(x, t) File "/home/ma-user/work/ComfyUI/comfy/extra_samplers/uni_pc.py", line 388, in noise_prediction_fn return self.model(x, t) File "/home/ma-user/work/ComfyUI/comfy/extra_samplers/uni_pc.py", line 329, in model_fn return noise_pred_fn(x, t_continuous) File "/home/ma-user/work/ComfyUI/comfy/extra_samplers/uni_pc.py", line 297, in noise_pred_fn output = model(x, t_input, **model_kwargs) File "/home/ma-user/work/ComfyUI/comfy/extra_samplers/uni_pc.py", line 859, in lambda input, sigma, **kwargs: predict_eps_sigma(model, input, sigma, **kwargs), File "/home/ma-user/work/ComfyUI/comfy/extra_samplers/uni_pc.py", line 843, in predict_eps_sigma return (input - model(input, sigma_in, **kwargs)) / sigma File "/home/ma-user/work/ComfyUI/comfy/samplers.py", line 390, in call out = self.inner_model(x, sigma, model_options=model_options, seed=seed) File "/home/ma-user/work/ComfyUI/comfy/samplers.py", line 939, in call return self.predict_noise(*args, **kwargs) File "/home/ma-user/work/ComfyUI/comfy/samplers.py", line 942, in predict_noise return sampling_function(self.inner_model, x, timestep, self.conds.get("negative", None), self.conds.get("positive", None), self.cfg, model_options=model_options, seed=seed) File "/home/ma-user/work/ComfyUI/comfy/samplers.py", line 370, in sampling_function out = calc_cond_batch(model, conds, x, timestep, model_options) File "/home/ma-user/work/ComfyUI/comfy/samplers.py", line 206, in calc_cond_batch return executor.execute(model, conds, x_in, timestep, model_options) File "/home/ma-user/work/ComfyUI/comfy/patcher_extension.py", line 110, in execute return self.original(*args, **kwargs) File "/home/ma-user/work/ComfyUI/comfy/samplers.py", line 319, in calc_cond_batch output = model.apply_model(input_x, timestep, **c).chunk(batch_chunks) File "/home/ma-user/work/ComfyUI/comfy/model_base.py", line 137, in apply_model return comfy.patcher_extension.WrapperExecutor.new_class_executor( File "/home/ma-user/work/ComfyUI/comfy/patcher_extension.py", line 110, in execute return self.original(*args, **kwargs) File "/home/ma-user/work/ComfyUI/comfy/model_base.py", line 170, in _apply_model model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float() File "/home/ma-user/work/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/home/ma-user/work/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl return forward_call(*args, **kwargs) File "/home/ma-user/work/ComfyUI/comfy/ldm/wan/model.py", line 461, in forward return self.forward_orig(x, timestep, context, clip_fea=clip_fea, freqs=freqs, transformer_options=transformer_options)[:, :, :t, :h, :w] File "/home/ma-user/work/ComfyUI/comfy/ldm/wan/model.py", line 417, in forward_orig sinusoidal_embedding_1d(self.freq_dim, t).to(dtype=x[0].dtype)) File "/home/ma-user/work/ComfyUI/comfy/ldm/wan/model.py", line 25, in sinusoidal_embedding_1d position, torch.pow(10000, -torch.arange(half).to(position).div(half))) RuntimeError: The Inner error is reported as above. The process exits for this inner error, and the current working operator name is Conv3D. Since the operator is called asynchronously, the stacktrace may be inaccurate. If you want to get the accurate stacktrace, pleace set the environment variable ASCEND_LAUNCH_BLOCKING=1. [ERROR] 2025-04-04-21:26:55 (PID:1310, Device:0, RankID:-1) ERR00100 PTA call acl api failed

kenic123 avatar Apr 04 '25 13:04 kenic123

I seem to be having the same problem, has it been resolved?

text_to_video_wan.json

Ading163 avatar Apr 24 '25 16:04 Ading163